Added auto hide toolbar

This commit is contained in:
M66B
2023-01-07 11:26:19 +01:00
parent 0d395e54dc
commit de672d0c05
12 changed files with 121 additions and 11 deletions

View File

@@ -883,14 +883,19 @@ public class Helper {
// View
static Integer actionBarHeight = null;
static int getActionBarHeight(Context context) {
int actionBarHeight;
TypedValue tv = new TypedValue();
if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
DisplayMetrics dm = context.getResources().getDisplayMetrics();
return TypedValue.complexToDimensionPixelSize(tv.data, dm);
} else
return Helper.dp2pixels(context, 56);
if (actionBarHeight == null) {
TypedValue tv = new TypedValue();
if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
DisplayMetrics dm = context.getResources().getDisplayMetrics();
actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, dm);
} else
actionBarHeight = Helper.dp2pixels(context, 56);
}
return actionBarHeight;
}
static int getBottomNavigationHeight(Context context) {