Browse Source

状态栏透明 #304

HapeLee 1 year ago
parent
commit
3cda129ec9
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/src/main/java/io/legado/app/base/BaseActivity.kt

+ 5 - 1
app/src/main/java/io/legado/app/base/BaseActivity.kt

@@ -126,7 +126,11 @@ abstract class BaseActivity<VB : ViewBinding>(
         if (fullScreen && !isInMultiWindow) {
         if (fullScreen && !isInMultiWindow) {
             fullScreen()
             fullScreen()
         }
         }
-        setStatusBarColorAuto(Color.TRANSPARENT, false, fullScreen)
+        setStatusBarColorAuto(
+            themeColor(com.google.android.material.R.attr.colorSurface),
+            true,
+            fullScreen
+        )
         val isDarkTheme = when (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) {
         val isDarkTheme = when (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) {
             Configuration.UI_MODE_NIGHT_YES -> true
             Configuration.UI_MODE_NIGHT_YES -> true
             Configuration.UI_MODE_NIGHT_NO,
             Configuration.UI_MODE_NIGHT_NO,