Added helper for BNV height

This commit is contained in:
M66B 2021-12-30 15:49:39 +01:00
parent dcdf09f841
commit 328a864f95
1 changed files with 9 additions and 2 deletions

View File

@ -619,11 +619,18 @@ public class Helper {
if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) { if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
DisplayMetrics dm = context.getResources().getDisplayMetrics(); DisplayMetrics dm = context.getResources().getDisplayMetrics();
return TypedValue.complexToDimensionPixelSize(tv.data, dm); return TypedValue.complexToDimensionPixelSize(tv.data, dm);
} } else
else
return Helper.dp2pixels(context, 56); return Helper.dp2pixels(context, 56);
} }
static int getBottomNavigationHeight(Context context) {
int resid = context.getResources().getIdentifier("design_bottom_navigation_height", "dimen", context.getPackageName());
if (resid <= 0)
return Helper.dp2pixels(context, 56);
else
return context.getResources().getDimensionPixelSize(resid);
}
static Intent getChooser(Context context, Intent intent) { static Intent getChooser(Context context, Intent intent) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
PackageManager pm = context.getPackageManager(); PackageManager pm = context.getPackageManager();