mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-27 10:17:18 +00:00
Make sure unpinning is possible
This commit is contained in:
parent
7e270b0c78
commit
d5b95d4eee
1 changed files with 5 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue