Make sure unpinning is possible

This commit is contained in:
M66B 2021-08-12 15:34:29 +02:00
parent 7e270b0c78
commit d5b95d4eee
1 changed files with 5 additions and 3 deletions

View File

@ -910,12 +910,14 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
private int getDrawerWidth() {
if (!nav_expanded)
return Helper.dp2pixels(this, 48);
return Helper.dp2pixels(this, 48); // One icon + padding
DisplayMetrics dm = getResources().getDisplayMetrics();
if (nav_pinned) {
int maxWidth = dm.widthPixels - Helper.dp2pixels(this, 300);
return Math.min(Helper.dp2pixels(this, 300), maxWidth);
int minWidth = Helper.dp2pixels(this, 72); // Make sure unpinning is possible
int dp300 = Helper.dp2pixels(this, 300);
int maxWidth = dm.widthPixels - dp300;
return Math.max(Math.min(dp300, maxWidth), minWidth);
} else {
int actionBarHeight;
TypedValue tv = new TypedValue();