From 9ac47972f9b03e072111c1da53d92751b37ea085 Mon Sep 17 00:00:00 2001 From: daichi-matsumoto Date: Mon, 11 Dec 2023 14:07:28 +0900 Subject: [PATCH] fix default color --- .../fanbox/core/datastore/PixiViewPreferencesDataStore.kt | 4 ++-- core/datastore/src/main/proto/items/theme_color_config.proto | 2 +- .../java/caios/android/fanbox/core/model/ThemeColorConfig.kt | 2 +- .../src/main/java/caios/android/fanbox/core/model/UserData.kt | 2 +- .../src/main/java/caios/android/fanbox/core/ui/theme/Theme.kt | 2 +- .../feature/setting/theme/items/SettingThemeColorSection.kt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/datastore/src/main/java/caios/android/fanbox/core/datastore/PixiViewPreferencesDataStore.kt b/core/datastore/src/main/java/caios/android/fanbox/core/datastore/PixiViewPreferencesDataStore.kt index 3ce790ca..c9808f05 100644 --- a/core/datastore/src/main/java/caios/android/fanbox/core/datastore/PixiViewPreferencesDataStore.kt +++ b/core/datastore/src/main/java/caios/android/fanbox/core/datastore/PixiViewPreferencesDataStore.kt @@ -24,6 +24,7 @@ class PixiViewPreferencesDataStore( else -> ThemeConfig.System }, themeColorConfig = when (it.themeColorConfig) { + ThemeColorConfigProto.THEME_COLOR_CONFIG_RED -> ThemeColorConfig.Red ThemeColorConfigProto.THEME_COLOR_CONFIG_BLUE -> ThemeColorConfig.Blue ThemeColorConfigProto.THEME_COLOR_CONFIG_BROWN -> ThemeColorConfig.Brown ThemeColorConfigProto.THEME_COLOR_CONFIG_GREEN -> ThemeColorConfig.Green @@ -99,8 +100,7 @@ class PixiViewPreferencesDataStore( ThemeColorConfig.Green -> ThemeColorConfigProto.THEME_COLOR_CONFIG_GREEN ThemeColorConfig.Pink -> ThemeColorConfigProto.THEME_COLOR_CONFIG_PINK ThemeColorConfig.Purple -> ThemeColorConfigProto.THEME_COLOR_CONFIG_PURPLE - ThemeColorConfig.Default -> ThemeColorConfigProto.THEME_COLOR_CONFIG_DEFAULT - else -> ThemeColorConfigProto.THEME_COLOR_CONFIG_BLUE + ThemeColorConfig.Red -> ThemeColorConfigProto.THEME_COLOR_CONFIG_RED } } } diff --git a/core/datastore/src/main/proto/items/theme_color_config.proto b/core/datastore/src/main/proto/items/theme_color_config.proto index 6da10d60..0cc88574 100644 --- a/core/datastore/src/main/proto/items/theme_color_config.proto +++ b/core/datastore/src/main/proto/items/theme_color_config.proto @@ -5,7 +5,7 @@ option java_multiple_files = true; enum ThemeColorConfigProto { THEME_COLOR_CONFIG_UNSPECIFIED = 0; - THEME_COLOR_CONFIG_DEFAULT = 1; + THEME_COLOR_CONFIG_RED = 1; THEME_COLOR_CONFIG_BLUE = 2; THEME_COLOR_CONFIG_BROWN = 3; THEME_COLOR_CONFIG_GREEN = 4; diff --git a/core/model/src/main/java/caios/android/fanbox/core/model/ThemeColorConfig.kt b/core/model/src/main/java/caios/android/fanbox/core/model/ThemeColorConfig.kt index fd40bf3f..2d4fe50f 100644 --- a/core/model/src/main/java/caios/android/fanbox/core/model/ThemeColorConfig.kt +++ b/core/model/src/main/java/caios/android/fanbox/core/model/ThemeColorConfig.kt @@ -4,5 +4,5 @@ import androidx.compose.runtime.Stable @Stable enum class ThemeColorConfig { - Default, Blue, Brown, Green, Pink, Purple + Red, Blue, Brown, Green, Pink, Purple } diff --git a/core/model/src/main/java/caios/android/fanbox/core/model/UserData.kt b/core/model/src/main/java/caios/android/fanbox/core/model/UserData.kt index a99776fe..815b4b8c 100644 --- a/core/model/src/main/java/caios/android/fanbox/core/model/UserData.kt +++ b/core/model/src/main/java/caios/android/fanbox/core/model/UserData.kt @@ -29,7 +29,7 @@ data class UserData( return UserData( pixiViewId = "", themeConfig = ThemeConfig.System, - themeColorConfig = ThemeColorConfig.Default, + themeColorConfig = ThemeColorConfig.Red, isAgreedPrivacyPolicy = false, isAgreedTermsOfService = false, isAppLock = false, diff --git a/core/ui/src/main/java/caios/android/fanbox/core/ui/theme/Theme.kt b/core/ui/src/main/java/caios/android/fanbox/core/ui/theme/Theme.kt index 03d6a356..c48936eb 100644 --- a/core/ui/src/main/java/caios/android/fanbox/core/ui/theme/Theme.kt +++ b/core/ui/src/main/java/caios/android/fanbox/core/ui/theme/Theme.kt @@ -89,7 +89,7 @@ val DarkDefaultColorScheme = darkColorScheme( fun PixiViewTheme( fanboxCookie: String = "", fanboxMetadata: FanboxMetaData = FanboxMetaData.dummy(), - themeColorConfig: ThemeColorConfig = ThemeColorConfig.Default, + themeColorConfig: ThemeColorConfig = ThemeColorConfig.Red, shouldUseDarkTheme: Boolean = isSystemInDarkTheme(), enableDynamicTheme: Boolean = false, content: @Composable () -> Unit, diff --git a/feature/setting/src/main/java/caios/android/fanbox/feature/setting/theme/items/SettingThemeColorSection.kt b/feature/setting/src/main/java/caios/android/fanbox/feature/setting/theme/items/SettingThemeColorSection.kt index 3a2c6b17..cd049360 100644 --- a/feature/setting/src/main/java/caios/android/fanbox/feature/setting/theme/items/SettingThemeColorSection.kt +++ b/feature/setting/src/main/java/caios/android/fanbox/feature/setting/theme/items/SettingThemeColorSection.kt @@ -70,12 +70,12 @@ internal fun SettingThemeColorSection( key = { it.name }, ) { val color = when (it) { + ThemeColorConfig.Red -> if (isDarkMode) DarkDefaultColorScheme else LightDefaultColorScheme ThemeColorConfig.Blue -> if (isDarkMode) DarkBlueColorScheme else LightBlueColorScheme ThemeColorConfig.Brown -> if (isDarkMode) DarkBrownColorScheme else LightBrownColorScheme ThemeColorConfig.Green -> if (isDarkMode) DarkGreenColorScheme else LightGreenColorScheme ThemeColorConfig.Purple -> if (isDarkMode) DarkPurpleColorScheme else LightPurpleColorScheme ThemeColorConfig.Pink -> if (isDarkMode) DarkPinkColorScheme else LightPinckColorScheme - else -> if (isDarkMode) DarkDefaultColorScheme else LightDefaultColorScheme } SettingThemeColorItem(