From 6b20b46761646da10bcc1e047deca45c6701b097 Mon Sep 17 00:00:00 2001
From: FooIbar <118464521+FooIbar@users.noreply.github.com>
Date: Wed, 25 Oct 2023 19:36:34 +0800
Subject: [PATCH] Revert "Set bar style correctly"
This reverts 216a04309408684c141db1d34114f271cf20cc01.
Reason for revert: Incorrect status bar color when app's night mode
setting is different from system's
---
app/src/main/kotlin/com/hippo/ehviewer/ui/EhActivity.kt | 3 +++
app/src/main/res/values/themes.xml | 2 --
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/EhActivity.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/EhActivity.kt
index 039ae47fc..4d49cf246 100644
--- a/app/src/main/kotlin/com/hippo/ehviewer/ui/EhActivity.kt
+++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/EhActivity.kt
@@ -19,6 +19,7 @@ import android.content.res.Resources.Theme
import android.os.Bundle
import androidx.annotation.StyleRes
import androidx.appcompat.app.AppCompatActivity
+import androidx.core.view.WindowCompat
import androidx.navigation.ActivityNavigator
import com.hippo.ehviewer.R
import com.hippo.ehviewer.Settings
@@ -45,6 +46,8 @@ abstract class EhActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
layoutInflater.factory2 = LayoutInflaterFactory(delegate).addOnViewCreatedListener(WindowInsetsHelper.LISTENER)
super.onCreate(savedInstanceState)
+ WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightStatusBars = !isNightMode()
+ WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightNavigationBars = !isNightMode()
}
override fun onResume() {
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 94d00e765..41b5bcc2e 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -29,11 +29,9 @@
- true
- - ?isLightTheme
- @android:color/transparent
- - ?isLightTheme
- @android:color/transparent
- false