mirror of https://github.com/M66B/FairEmail.git
Enable 3-col mode on large screens
This commit is contained in:
parent
cb5e9827c4
commit
f03c4d2ba1
|
@ -175,8 +175,10 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
|
|||
else
|
||||
boot.execute(this, new Bundle(), "main:accounts");
|
||||
} else {
|
||||
// Enable compact view on small screens
|
||||
if (!getResources().getConfiguration().isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE))
|
||||
// Enable 3-col mode on large screen / compact view on small screens
|
||||
if (getResources().getConfiguration().isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE))
|
||||
prefs.edit().putBoolean("landscape3", true).apply();
|
||||
else
|
||||
prefs.edit().putBoolean("compact", true).apply();
|
||||
|
||||
setTheme(R.style.AppThemeBlueOrangeLight);
|
||||
|
|
|
@ -226,6 +226,10 @@ public class ApplicationEx extends Application {
|
|||
editor.putBoolean("resize_attachments", autoresize);
|
||||
editor.remove("autoresize");
|
||||
}
|
||||
} else if (version < 930) {
|
||||
boolean large = context.getResources().getConfiguration()
|
||||
.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE);
|
||||
editor.putBoolean("landscape3", large);
|
||||
}
|
||||
|
||||
if (BuildConfig.DEBUG && false) {
|
||||
|
|
|
@ -52,7 +52,7 @@ public class DrawerLayoutEx extends DrawerLayout {
|
|||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
boolean normal = config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_NORMAL);
|
||||
boolean landscape = prefs.getBoolean("landscape", true);
|
||||
boolean landscape3 = prefs.getBoolean("landscape3", true);
|
||||
boolean landscape3 = prefs.getBoolean("landscape3", false);
|
||||
|
||||
if (normal && landscape && landscape3 &&
|
||||
config.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
|
|
|
@ -599,7 +599,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
|
||||
swLandscape.setChecked(prefs.getBoolean("landscape", true));
|
||||
swLandscape.setEnabled(normal);
|
||||
swLandscape3.setChecked(prefs.getBoolean("landscape3", true));
|
||||
swLandscape3.setChecked(prefs.getBoolean("landscape3", false));
|
||||
swLandscape3.setEnabled(normal && swLandscape.isChecked());
|
||||
|
||||
String startup = prefs.getString("startup", "unified");
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:checked="true"
|
||||
android:text="@string/title_advanced_landscape3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
Loading…
Reference in New Issue