From 4fe8a0bf397443f55c1e3f7bd67482ab6db77934 Mon Sep 17 00:00:00 2001 From: Arvi Fox Date: Thu, 9 Nov 2023 23:51:26 +0300 Subject: [PATCH] release sora v3.7.0.0 107 --- .../common/domain/DarkThemeManager.kt | 20 +++++++++---------- .../presentation/compose/theme/SoraTheme.kt | 4 ++-- .../profile/appsettings/AppSettingsScreen.kt | 8 ++++---- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/common/src/main/java/jp/co/soramitsu/common/domain/DarkThemeManager.kt b/common/src/main/java/jp/co/soramitsu/common/domain/DarkThemeManager.kt index 464ed6491..be1687385 100644 --- a/common/src/main/java/jp/co/soramitsu/common/domain/DarkThemeManager.kt +++ b/common/src/main/java/jp/co/soramitsu/common/domain/DarkThemeManager.kt @@ -138,23 +138,21 @@ class DarkThemeManager @Inject constructor( }.flowOn(coroutineManager.main.immediate).stateIn( scope = coroutineManager.applicationScope, started = SharingStarted.Eagerly, // Eager mode is used to apply changes as soon as possible - initialValue = AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_NO + initialValue = AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES ) fun updateUiModeFromCache() { coroutineManager.applicationScope.launch { mutableDarkThemeSharedFlow.emit( value = DarkModeSettings( -// isSystemDrivenUiEnabled = soraPreferences.getBoolean( -// field = KEY_SYSTEM_DRIVEN_UI_ENABLED, -// defaultValue = false -// ), - isSystemDrivenUiEnabled = false, -// isDarkModeEnabled = soraPreferences.getBoolean( -// field = KEY_DARK_THEME_ENABLED, -// defaultValue = false -// ) - isDarkModeEnabled = false, + isSystemDrivenUiEnabled = soraPreferences.getBoolean( + field = KEY_SYSTEM_DRIVEN_UI_ENABLED, + defaultValue = false + ), + isDarkModeEnabled = soraPreferences.getBoolean( + field = KEY_DARK_THEME_ENABLED, + defaultValue = false + ) ) ) } diff --git a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/theme/SoraTheme.kt b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/theme/SoraTheme.kt index 41ad7247e..976a81e56 100644 --- a/common/src/main/java/jp/co/soramitsu/common/presentation/compose/theme/SoraTheme.kt +++ b/common/src/main/java/jp/co/soramitsu/common/presentation/compose/theme/SoraTheme.kt @@ -66,9 +66,9 @@ fun SoraAppTheme( content: @Composable () -> Unit, ) { AppTheme( - darkTheme = false, + darkTheme = darkTheme, lightColors = soraLightColors, - darkColors = soraLightColors, + darkColors = soraDarkColors, typography = soraTypography, borderRadius = soraBorderRadius, content = content, diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/appsettings/AppSettingsScreen.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/appsettings/AppSettingsScreen.kt index 793941c8e..4af3c48f6 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/appsettings/AppSettingsScreen.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/appsettings/AppSettingsScreen.kt @@ -68,16 +68,16 @@ internal fun AppSettingsScreen( icon = null, label = stringResource(id = R.string.system_appearance), bottomDivider = false, - available = false, - checked = false, + available = true, + checked = checkedSystem, onClick = onSystemToggle, ) OptionSwitch( icon = null, label = stringResource(id = R.string.dark_mode), bottomDivider = false, - available = false, - checked = false, + available = true, + checked = checkedDark, onClick = onDarkToggle, ) }