From 0f7caa66fb17069d0b331189122b5bbded63320f Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 4 Jul 2020 03:28:10 -0700 Subject: [PATCH] Remove usage of grid layouts --- .../main/java/com/topjohnwu/magisk/core/Config.kt | 12 ++---------- .../magisk/model/events/dialog/DarkThemeDialog.kt | 2 +- .../com/topjohnwu/magisk/ui/base/BaseUIActivity.kt | 2 +- .../topjohnwu/magisk/ui/settings/SettingsItems.kt | 13 ------------- .../magisk/ui/settings/SettingsViewModel.kt | 2 +- app/src/main/res/layout/fragment_module_md2.xml | 1 - app/src/main/res/layout/fragment_settings_md2.xml | 3 +-- app/src/main/res/layout/include_module_filter.xml | 3 +-- 8 files changed, 7 insertions(+), 31 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/Config.kt b/app/src/main/java/com/topjohnwu/magisk/core/Config.kt index 32378f3e6..a847e665f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/Config.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/Config.kt @@ -47,16 +47,13 @@ object Config : PreferenceModel, DBConfig { const val UPDATE_CHANNEL = "update_channel" const val CUSTOM_CHANNEL = "custom_channel" const val LOCALE = "locale" - const val DARK_THEME = "dark_theme" - const val DARK_THEME_EXTENDED = "dark_theme_extended" + const val DARK_THEME = "dark_theme_extended" const val REPO_ORDER = "repo_order" const val SHOW_SYSTEM_APP = "show_system" const val DOWNLOAD_PATH = "download_path" - const val REDESIGN = "redesign" const val SAFETY = "safety_notice" const val THEME_ORDINAL = "theme_ordinal" const val BOOT_ID = "boot_id" - const val LIST_SPAN_COUNT = "column_count" // system state const val MAGISKHIDE = "magiskhide" @@ -120,17 +117,12 @@ object Config : PreferenceModel, DBConfig { var updateChannel by preferenceStrInt(Key.UPDATE_CHANNEL, defaultChannel) var safetyNotice by preference(Key.SAFETY, true) - var darkThemeExtended by preference( - Key.DARK_THEME_EXTENDED, - AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM - ) + var darkTheme by preference(Key.DARK_THEME, AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) var themeOrdinal by preference(Key.THEME_ORDINAL, Theme.Piplup.ordinal) var suReAuth by preference(Key.SU_REAUTH, false) var checkUpdate by preference(Key.CHECK_UPDATES, true) var magiskHide by preference(Key.MAGISKHIDE, true) var showSystemApp by preference(Key.SHOW_SYSTEM_APP, false) - @JvmStatic - var listSpanCount by preference(Key.LIST_SPAN_COUNT, 1) var customChannelUrl by preference(Key.CUSTOM_CHANNEL, "") var locale by preference(Key.LOCALE, "") diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt index 4244fdac2..4d864faea 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt @@ -42,7 +42,7 @@ class DarkThemeDialog : DialogEvent(), ActivityExecutor { } private fun selectTheme(mode: Int) { - Config.darkThemeExtended = mode + Config.darkTheme = mode activity?.get()?.recreate() } diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt index ae357e48c..c11267f8d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt @@ -47,7 +47,7 @@ abstract class BaseUIActivity