Explorar el Código

fix: 修复阅读界面切换亮暗色主题无效的问题

HapeLee hace 5 meses
padre
commit
e5c6643da8

+ 1 - 1
app/src/main/java/io/legado/app/data/repository/ReadSettingsRepository.kt

@@ -442,7 +442,7 @@ class ReadSettingsRepository(
             readMenuCustomIcons = this[Keys.ReadMenuCustomIcons] ?: "",
             readMenuCustomIcons = this[Keys.ReadMenuCustomIcons] ?: "",
             titleBarCustomIcons = this[Keys.TitleBarCustomIcons] ?: "",
             titleBarCustomIcons = this[Keys.TitleBarCustomIcons] ?: "",
             titleBarIconPosition = this[Keys.TitleBarIconPosition] ?: 0,
             titleBarIconPosition = this[Keys.TitleBarIconPosition] ?: 0,
-            showTitleBarIcons = this[Keys.ShowTitleBarIcons] ?: true,
+            showTitleBarIcons = this[Keys.ShowTitleBarIcons] ?: false,
             chineseConverterType = this[Keys.ChineseConverterType] ?: 0,
             chineseConverterType = this[Keys.ChineseConverterType] ?: 0,
         )
         )
     }
     }

+ 1 - 1
app/src/main/java/io/legado/app/ui/book/read/ReadBookContract.kt

@@ -159,7 +159,7 @@ data class ReadBookUiState(
 @Stable
 @Stable
 data class ReadMenuConfig(
 data class ReadMenuConfig(
     val titleBarIconPosition: Int = 0,
     val titleBarIconPosition: Int = 0,
-    val showTitleBarIcons: Boolean = true,
+    val showTitleBarIcons: Boolean = false,
     val readMenuFloatingBottomBar: Boolean = false,
     val readMenuFloatingBottomBar: Boolean = false,
     val readMenuBottomCornerRadius: Int = 0,
     val readMenuBottomCornerRadius: Int = 0,
     val readMenuIconItemsPerRow: Int = 5,
     val readMenuIconItemsPerRow: Int = 5,

+ 3 - 1
app/src/main/java/io/legado/app/ui/config/themeConfig/ThemeConfig.kt

@@ -52,7 +52,9 @@ object ThemeConfig {
 
 
     var appTheme by prefDelegate(PreferKey.appTheme, "0")
     var appTheme by prefDelegate(PreferKey.appTheme, "0")
 
 
-    var themeMode by prefDelegate(PreferKey.themeMode, "0")
+    var themeMode by prefDelegate(PreferKey.themeMode, "0") {
+        initNightMode()
+    }
 
 
     fun initNightMode() {
     fun initNightMode() {
         when (appCtx.getPrefString(PreferKey.themeMode, "0")) {
         when (appCtx.getPrefString(PreferKey.themeMode, "0")) {