Added more standard night-mode system

This commit is contained in:
Viktor De Pasquale
2019-10-20 17:27:39 +02:00
parent 7f0a87742a
commit 27fb0474d5
2 changed files with 13 additions and 3 deletions
@@ -39,10 +39,13 @@ abstract class BaseActivity<ViewModel : BaseViewModel, Binding : ViewDataBinding
private val resultCallbacks by lazy { SparseArrayCompat<RequestCallback>() }
init {
val theme = if (Config.darkTheme) {
AppCompatDelegate.MODE_NIGHT_YES
val theme = if (Config.redesign) {
Config.darkThemeExtended
} else {
AppCompatDelegate.MODE_NIGHT_NO
when {
Config.darkTheme -> AppCompatDelegate.MODE_NIGHT_YES
else -> AppCompatDelegate.MODE_NIGHT_NO
}
}
AppCompatDelegate.setDefaultNightMode(theme)
}