瀏覽代碼

fix: preserve theme input color and startup update check

HapeLee 3 月之前
父節點
當前提交
6b0967beed

+ 1 - 1
app/src/main/java/io/legado/app/ui/main/MainActivity.kt

@@ -166,10 +166,10 @@ open class MainActivity : BaseComposeActivity(), VariableDialog.Callback {
         restoredReadBookRoute = savedInstanceState?.restoreReadBookRoute()
         super.onCreate(savedInstanceState)
 
+        if (checkStartupRoute()) return
         val shouldAutoCheckUpdate = startupUpdateCheckGate.consume(
             OtherConfig.autoCheckUpdateOnStart
         )
-        if (checkStartupRoute()) return
 
         // 智能自启:如果上次是手动开启状态(web_service_auto 为 true),则自启
         if (AppConfig.webServiceAutoStart) {

+ 5 - 1
app/src/main/java/io/legado/app/ui/theme/ThemeColorSchemeOverride.kt

@@ -76,7 +76,11 @@ fun ColorScheme.toLegadoColorScheme(
         onCardContainer = primary,
         onSheetContent = surface,
         cardPrimaryContainer = primaryContainer,
-        surfaceInput = surface.copy(alpha = (ThemeConfig.containerOpacity / 100f).coerceIn(0f, 1f))
+        surfaceInput = if (ThemeConfig.bookInfoInputColor != 0) {
+            Color(ThemeConfig.bookInfoInputColor)
+        } else {
+            surface.copy(alpha = (ThemeConfig.containerOpacity / 100f).coerceIn(0f, 1f))
+        }
     )
 }
 

+ 7 - 1
app/src/main/java/io/legado/app/ui/theme/ThemeComponents.kt

@@ -191,7 +191,13 @@ fun MiuixThemeWrapper(
                 onSheetContent = miuixColorScheme.surface.copy(alpha = 0.5f),
                 cardPrimaryContainer = miuixColorScheme.primary.copy(alpha = 0.1f)
                     .compositeOver(miuixColorScheme.surface),
-                surfaceInput = miuixColorScheme.surface.copy(alpha = (ThemeConfig.containerOpacity / 100f).coerceIn(0f, 1f))
+                surfaceInput = if (ThemeConfig.bookInfoInputColor != 0) {
+                    Color(ThemeConfig.bookInfoInputColor)
+                } else {
+                    miuixColorScheme.surface.copy(
+                        alpha = (ThemeConfig.containerOpacity / 100f).coerceIn(0f, 1f)
+                    )
+                }
             )
         }