1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 03:05:31 +00:00

Minimum content width when pinned nav menu

This commit is contained in:
M66B 2021-08-11 21:25:25 +02:00
parent 37f8d7df32
commit c05f14269d

View file

@ -801,10 +801,10 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
return Helper.dp2pixels(this, 48); return Helper.dp2pixels(this, 48);
DisplayMetrics dm = getResources().getDisplayMetrics(); DisplayMetrics dm = getResources().getDisplayMetrics();
if (layoutId == R.layout.activity_view_landscape_split && nav_pinned) if (nav_pinned) {
return Helper.dp2pixels(this, 300); int maxWidth = dm.widthPixels - Helper.dp2pixels(this, 300);
else if (layoutId != R.layout.activity_view_landscape_split && nav_pinned) return Math.min(Helper.dp2pixels(this, 300), maxWidth);
return Math.min(Helper.dp2pixels(this, 300), dm.widthPixels / 2); }
else { else {
int actionBarHeight; int actionBarHeight;
TypedValue tv = new TypedValue(); TypedValue tv = new TypedValue();