Fix status bar colors
This commit is contained in:
@@ -2,6 +2,7 @@ package org.koitharu.kotatsu.base.ui
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
@@ -48,6 +49,8 @@ abstract class BaseActivity<B : ViewBinding> :
|
|||||||
@JvmField
|
@JvmField
|
||||||
val actionModeDelegate = ActionModeDelegate()
|
val actionModeDelegate = ActionModeDelegate()
|
||||||
|
|
||||||
|
private var defaultStatusBarColor = Color.TRANSPARENT
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
val settings = EntryPointAccessors.fromApplication(this, BaseActivityEntryPoint::class.java).settings
|
val settings = EntryPointAccessors.fromApplication(this, BaseActivityEntryPoint::class.java).settings
|
||||||
isAmoledTheme = settings.isAmoledTheme
|
isAmoledTheme = settings.isAmoledTheme
|
||||||
@@ -131,6 +134,7 @@ abstract class BaseActivity<B : ViewBinding> :
|
|||||||
topMargin = insets.top
|
topMargin = insets.top
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
defaultStatusBarColor = window.statusBarColor
|
||||||
window.statusBarColor = actionModeColor
|
window.statusBarColor = actionModeColor
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +142,7 @@ abstract class BaseActivity<B : ViewBinding> :
|
|||||||
override fun onSupportActionModeFinished(mode: ActionMode) {
|
override fun onSupportActionModeFinished(mode: ActionMode) {
|
||||||
super.onSupportActionModeFinished(mode)
|
super.onSupportActionModeFinished(mode)
|
||||||
actionModeDelegate.onSupportActionModeFinished(mode)
|
actionModeDelegate.onSupportActionModeFinished(mode)
|
||||||
window.statusBarColor = getThemeColor(android.R.attr.statusBarColor)
|
window.statusBarColor = defaultStatusBarColor
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun putDataToExtras(intent: Intent?) {
|
private fun putDataToExtras(intent: Intent?) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<color name="scrollbar">#66FFFFFF</color>
|
<color name="scrollbar">#66FFFFFF</color>
|
||||||
<color name="selector_foreground">#29FFFFFF</color>
|
<color name="selector_foreground">#29FFFFFF</color>
|
||||||
<color name="divider_default">#1FFFFFFF</color>
|
<color name="divider_default">#1FFFFFFF</color>
|
||||||
<color name="status_bar_incognito">#260052</color>
|
<color name="status_bar_incognito">#66311B92</color>
|
||||||
<color name="warning">#FB8C00</color>
|
<color name="warning">#FB8C00</color>
|
||||||
<color name="launcher_background">#000000</color>
|
<color name="launcher_background">#000000</color>
|
||||||
<color name="splash_primary">#0C4091</color>
|
<color name="splash_primary">#0C4091</color>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<color name="scrollbar">#66000000</color>
|
<color name="scrollbar">#66000000</color>
|
||||||
<color name="selector_foreground">#29000000</color>
|
<color name="selector_foreground">#29000000</color>
|
||||||
<color name="divider_default">#1F000000</color>
|
<color name="divider_default">#1F000000</color>
|
||||||
<color name="status_bar_incognito">#334800E0</color>
|
<color name="status_bar_incognito">#99B39DDB</color>
|
||||||
<color name="warning">#E65100</color>
|
<color name="warning">#E65100</color>
|
||||||
<color name="launcher_background">#FFFFFF</color>
|
<color name="launcher_background">#FFFFFF</color>
|
||||||
<color name="splash_primary">#90CAF9</color>
|
<color name="splash_primary">#90CAF9</color>
|
||||||
|
|||||||
Reference in New Issue
Block a user