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

@@ -247,13 +247,9 @@ class SettingsAdvancedController : SettingsController() {
key = Keys.tabletUiMode
titleRes = R.string.pref_tablet_ui_mode
summary = "%s"
entriesRes = arrayOf(R.string.lock_always, R.string.landscape, R.string.lock_never)
entriesRes = arrayOf(R.string.automatic_background, R.string.lock_always, R.string.landscape, R.string.lock_never)
entryValues = PreferenceValues.TabletUiMode.values().map { it.name }.toTypedArray()
defaultValue = if (context.isTablet()) {
PreferenceValues.TabletUiMode.ALWAYS
} else {
PreferenceValues.TabletUiMode.NEVER
}.name
defaultValue = PreferenceValues.TabletUiMode.AUTOMATIC.name
onChange {
activity?.toast(R.string.requires_app_restart)