Added tabletUI option: "Automatic" (#6208)

* added automatic tablet ui option; useful for foldables

* set automatic as default, rename setting

* remove redundant checks

Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>

* remove redundant checks

Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>

* fix defaultValue

Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>
This commit is contained in:
OncePunchedMan
2021-11-11 22:32:28 +01:00
committed by GitHub
parent bfcc883f01
commit 41952f0215
5 changed files with 6 additions and 11 deletions

View File

@@ -53,6 +53,7 @@ object PreferenceValues {
}
enum class TabletUiMode {
AUTOMATIC,
ALWAYS,
LANDSCAPE,
NEVER,

View File

@@ -326,10 +326,7 @@ class PreferencesHelper(val context: Context) {
fun incognitoMode() = flowPrefs.getBoolean(Keys.incognitoMode, false)
fun tabletUiMode() = flowPrefs.getEnum(
Keys.tabletUiMode,
if (context.applicationContext.isTablet()) Values.TabletUiMode.ALWAYS else Values.TabletUiMode.NEVER
)
fun tabletUiMode() = flowPrefs.getEnum(Keys.tabletUiMode, Values.TabletUiMode.AUTOMATIC)
fun extensionInstaller() = flowPrefs.getEnum(
Keys.extensionInstaller,