Fix dark mode not automatically switching

This commit is contained in:
Aleksandras Kostarevas 2024-05-26 14:25:39 +03:00
parent 0d7d6b816e
commit 5865dde3d7

View File

@ -23,7 +23,7 @@ val DynamicSystemTheme = ThemeOption(
when (uiModeManager.nightMode) { when (uiModeManager.nightMode) {
UiModeManager.MODE_NIGHT_YES -> dynamicDarkColorScheme(it) UiModeManager.MODE_NIGHT_YES -> dynamicDarkColorScheme(it)
UiModeManager.MODE_NIGHT_NO -> dynamicLightColorScheme(it) UiModeManager.MODE_NIGHT_NO -> dynamicLightColorScheme(it)
UiModeManager.MODE_NIGHT_AUTO -> { else -> {
val currentNightMode = it.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK val currentNightMode = it.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
if(currentNightMode == Configuration.UI_MODE_NIGHT_NO) { if(currentNightMode == Configuration.UI_MODE_NIGHT_NO) {
dynamicLightColorScheme(it) dynamicLightColorScheme(it)
@ -31,7 +31,6 @@ val DynamicSystemTheme = ThemeOption(
dynamicDarkColorScheme(it) dynamicDarkColorScheme(it)
} }
} }
else -> dynamicDarkColorScheme(it)
} }
} }
) )