mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-20 22:29:19 +00:00
Add: System Amoled Theme
Fix: Use similar switches in Settings
This commit is contained in:
@ -173,7 +173,7 @@ object Preferences {
|
||||
|
||||
sealed class Theme(override val valueString: String) : Enumeration<Theme> {
|
||||
override val values: List<Theme>
|
||||
get() = if (Android.sdk(29)) listOf(System, Light, Dark, Amoled)
|
||||
get() = if (Android.sdk(29)) listOf(System, AmoledSystem, Light, Dark, Amoled)
|
||||
else listOf(Light, Dark, Amoled)
|
||||
|
||||
abstract fun getResId(configuration: Configuration): Int
|
||||
@ -185,6 +185,13 @@ object Preferences {
|
||||
}
|
||||
}
|
||||
|
||||
object AmoledSystem : Theme("system-amoled") {
|
||||
override fun getResId(configuration: Configuration): Int {
|
||||
return if ((configuration.uiMode and Configuration.UI_MODE_NIGHT_YES) != 0)
|
||||
R.style.Theme_Main_Amoled else R.style.Theme_Main_Light
|
||||
}
|
||||
}
|
||||
|
||||
object Light : Theme("light") {
|
||||
override fun getResId(configuration: Configuration): Int = R.style.Theme_Main_Light
|
||||
}
|
||||
|
Reference in New Issue
Block a user