Wider navigation menu on extra large screens

This commit is contained in:
M66B 2024-09-15 20:58:19 +02:00
parent 6f66b299cf
commit bedc399ecc
1 changed files with 11 additions and 2 deletions

View File

@ -1400,8 +1400,17 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
// Screen width 320 - action bar 56 = 264 dp
// Icons 6 x (24 width + 2x6 padding) = 216 dp
int drawerWidth = screenWidth - actionBarHeight;
int dp320 = Helper.dp2pixels(this, 320);
return Math.min(drawerWidth, dp320);
// https://github.com/flutter/flutter/issues/123380
// https://m3.material.io/components/navigation-drawer/specs
Configuration config = getResources().getConfiguration();
if (config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_XLARGE)) {
int dp360 = Helper.dp2pixels(this, 360);
return Math.min(drawerWidth, dp360);
} else {
int dp320 = Helper.dp2pixels(this, 320);
return Math.min(drawerWidth, dp320);
}
}
}