mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Fix nav bar spacing and coloring.
This commit is contained in:
@@ -385,15 +385,19 @@ public final class ViewUtil {
|
||||
if (Build.VERSION.SDK_INT > 29 && rootWindowInsets != null) {
|
||||
return rootWindowInsets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
|
||||
} else {
|
||||
int result = 0;
|
||||
int resourceId = view.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = view.getResources().getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
return getNavigationBarHeight(view.getResources());
|
||||
}
|
||||
}
|
||||
|
||||
public static int getNavigationBarHeight(@NonNull Resources resources) {
|
||||
int result = 0;
|
||||
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = resources.getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void hideKeyboard(@NonNull Context context, @NonNull View view) {
|
||||
InputMethodManager inputManager = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||
inputManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
|
||||
Reference in New Issue
Block a user