From 45fdf9efc6efacc19f44134e5105ba8e76fdbfe4 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 7 Aug 2020 16:09:25 +0200 Subject: [PATCH] Added "1.5" column mode --- app/src/main/java/eu/faircode/email/ActivityView.java | 4 ++-- app/src/main/java/eu/faircode/email/DrawerLayoutEx.java | 3 +-- .../main/java/eu/faircode/email/FragmentOptionsDisplay.java | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index c3737e5c1a..41b37f81dd 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -197,7 +197,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB Log.i("Drawer opened"); owner.start(); - if (normal && landscape && landscape3 && + if (normal && landscape3 && config.orientation == Configuration.ORIENTATION_LANDSCAPE) { drawerLayout.setDrawerLockMode(LOCK_MODE_LOCKED_OPEN); childContent.setPaddingRelative(childDrawer.getLayoutParams().width, 0, 0, 0); @@ -214,7 +214,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB else owner.stop(); - if (normal && landscape && landscape3 && + if (normal && landscape3 && config.orientation == Configuration.ORIENTATION_LANDSCAPE) childContent.setPaddingRelative( Math.round(slideOffset * childDrawer.getLayoutParams().width), 0, 0, 0); diff --git a/app/src/main/java/eu/faircode/email/DrawerLayoutEx.java b/app/src/main/java/eu/faircode/email/DrawerLayoutEx.java index f2bdb33fae..8f1a05d569 100644 --- a/app/src/main/java/eu/faircode/email/DrawerLayoutEx.java +++ b/app/src/main/java/eu/faircode/email/DrawerLayoutEx.java @@ -51,10 +51,9 @@ 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 landscape = prefs.getBoolean("landscape", true); boolean landscape3 = prefs.getBoolean("landscape3", false); - if (normal && landscape && landscape3 && + if (normal && landscape3 && config.orientation == Configuration.ORIENTATION_LANDSCAPE) { setScrimColor(Color.TRANSPARENT); openDrawer(drawerContainer, false); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index b24e84f0cb..c9c1f54794 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -273,7 +273,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { prefs.edit().putBoolean("landscape", checked).apply(); - swLandscape3.setEnabled(checked); } }); @@ -794,7 +793,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swLandscape.setChecked(prefs.getBoolean("landscape", true)); swLandscape.setEnabled(normal); swLandscape3.setChecked(prefs.getBoolean("landscape3", false)); - swLandscape3.setEnabled(normal && swLandscape.isChecked()); + swLandscape3.setEnabled(normal); swThreading.setChecked(prefs.getBoolean("threading", true)); swThreadingUnread.setChecked(prefs.getBoolean("threading_unread", false));