Removed normal screen limitations

This commit is contained in:
M66B
2021-08-10 09:23:05 +02:00
parent 73e824c3ec
commit cbb39fa46f
6 changed files with 49 additions and 30 deletions

View File

@@ -239,11 +239,20 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
else
boot.execute(this, new Bundle(), "main:accounts");
} else {
// 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();
SharedPreferences.Editor editor = prefs.edit();
Configuration config = getResources().getConfiguration();
// Default enable compact mode for smaller screens
if (!config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE))
editor.putBoolean("compact", true);
// Default disable landscape columns for small screens
if (!config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_NORMAL)) {
editor.putBoolean("landscape", false);
editor.putBoolean("landscape3", false);
}
editor.apply();
if (Helper.isNight(this))
setTheme(R.style.AppThemeBlueOrangeDark);