mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
very slight optimize when not using amoled themes
This commit is contained in:
parent
3c5fc24058
commit
52fb2a8be9
1 changed files with 2 additions and 2 deletions
|
@ -102,10 +102,10 @@ fun AppCompatActivity.getThemeWithExtras(theme: Resources.Theme, preferences: Pr
|
|||
val useAmoled =
|
||||
(isInNightMode() || preferences.nightMode().get() == AppCompatDelegate.MODE_NIGHT_YES) &&
|
||||
preferences.themeDarkAmoled().get()
|
||||
if (oldTheme != null) {
|
||||
if (oldTheme != null && useAmoled) {
|
||||
val array = oldTheme.obtainStyledAttributes(intArrayOf(R.attr.background))
|
||||
val bg = array.getColor(0, 0)
|
||||
if (bg == Color.BLACK && useAmoled) {
|
||||
if (bg == Color.BLACK) {
|
||||
return oldTheme
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue