Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavpandey committed Nov 27, 2022
1 parent bef0987 commit d30a4b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ public static boolean isValidMimeType(@Nullable Context context,
} else {
validMime = isValidMimeType(context, intent.getData(),
MIME_OCTET_STREAM, extension) && isValidExtension(
context, intent.getData(), extension);
context, intent.getData(), extension);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.pranavpandey.android.dynamic.util;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
Expand Down Expand Up @@ -45,6 +46,11 @@
*/
public class DynamicWindowUtils {

/**
* Maximum height for the gesture navigation in DP.
*/
public static final int GESTURE_NAVIGATION_BAR_HEIGHT = 24;

/**
* Returns the correct display according to the different API levels.
*
Expand Down Expand Up @@ -225,6 +231,7 @@ public static float getDisplayDensity(@Nullable Context context) {
*
* @return The status bar size in pixels.
*/
@SuppressLint({"InternalInsetResource", "DiscouragedApi"})
public static int getStatusBarSize(@NonNull Context context) {
int resourceId = context.getResources().getIdentifier(
"status_bar_height", "dimen", "android");
Expand Down Expand Up @@ -295,8 +302,8 @@ public static boolean isNavigationBarThemeSupported(@NonNull Context context) {
*/
public static boolean isGestureNavigation(@NonNull Context context) {
Point navigationBarSize = getNavigationBarSize(context);
return DynamicSdkUtils.is29() && navigationBarSize.y > 0
&& navigationBarSize.y <= DynamicUnitUtils.convertDpToPixels(24);
return DynamicSdkUtils.is29() && navigationBarSize.y > 0 && navigationBarSize.y
<= DynamicUnitUtils.convertDpToPixels(GESTURE_NAVIGATION_BAR_HEIGHT);
}

/**
Expand Down

0 comments on commit d30a4b9

Please sign in to comment.