Fix language/theme settings dialog and remove delay (#8244)
* Fix language/theme settings dialog and remove delay * inline UI preferences * use `by remember` * remove unused variable * remove unused importpull/8250/head
parent
84bcd8d1d2
commit
d03cbbe0cd
@ -1,7 +1,19 @@
|
||||
package eu.kanade.domain.ui.model
|
||||
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
|
||||
enum class ThemeMode {
|
||||
LIGHT,
|
||||
DARK,
|
||||
SYSTEM,
|
||||
}
|
||||
|
||||
fun setAppCompatDelegateThemeMode(themeMode: ThemeMode) {
|
||||
AppCompatDelegate.setDefaultNightMode(
|
||||
when (themeMode) {
|
||||
ThemeMode.LIGHT -> AppCompatDelegate.MODE_NIGHT_NO
|
||||
ThemeMode.DARK -> AppCompatDelegate.MODE_NIGHT_YES
|
||||
ThemeMode.SYSTEM -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in new issue