Ensure the height of the toolbar is set

pull/215/head
M66B 1 year ago
parent 96686111b8
commit 19adb34026

@ -117,6 +117,10 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
Toolbar toolbar = holder.findViewById(R.id.toolbar);
View placeholder = holder.findViewById(R.id.placeholder);
ViewGroup.LayoutParams lp = toolbar.getLayoutParams();
lp.height = Helper.getActionBarHeight(this);
toolbar.setLayoutParams(lp);
toolbar.setPopupTheme(getThemeId());
if (hide_toolbar) {
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();

@ -920,7 +920,8 @@ public class Helper {
if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
DisplayMetrics dm = context.getResources().getDisplayMetrics();
actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, dm);
} else
}
if (actionBarHeight == null || actionBarHeight <= 0)
actionBarHeight = Helper.dp2pixels(context, 56);
}

Loading…
Cancel
Save