Added option for fixed nav menu in portrait mode

This commit is contained in:
M66B
2021-08-10 08:19:03 +02:00
parent 2e77bc34d3
commit 0dcbe6430d
6 changed files with 47 additions and 13 deletions

View File

@@ -51,10 +51,12 @@ public class DrawerLayoutEx extends DrawerLayout {
void setup(Configuration config, View drawerContainer, ActionBarDrawerToggle drawerToggle) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean normal = config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_NORMAL);
boolean portrait3 = prefs.getBoolean("portrait3", false);
boolean landscape3 = prefs.getBoolean("landscape3", true);
if (normal && landscape3 &&
config.orientation == Configuration.ORIENTATION_LANDSCAPE) {
if (normal &&
((portrait3 && config.orientation == Configuration.ORIENTATION_PORTRAIT) ||
(landscape3 && config.orientation == Configuration.ORIENTATION_LANDSCAPE))) {
setScrimColor(Color.TRANSPARENT);
openDrawer(drawerContainer, false);
drawerToggle.onDrawerOpened(drawerContainer);