File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
app/src/main/java/com/android/unio Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
1
package com.android.unio.model.preferences
2
2
3
- import android.content.Context
4
3
import com.android.unio.R
5
4
import me.zhanghai.compose.preference.Preferences
6
5
@@ -30,13 +29,11 @@ object AppPreferences {
30
29
31
30
val asList = listOf (LIGHT , DARK , SYSTEM )
32
31
33
- fun toDisplayText (theme : String , context : Context ) =
32
+ fun toDisplayText (theme : String ) =
34
33
when (theme) {
35
- LIGHT -> context.getString(R .string.app_preferences_theme_text_display_light)
36
- DARK -> context.getString(R .string.app_preferences_theme_text_display_dark)
37
- SYSTEM ->
38
- context.getString(R .string.app_preferences_theme_text_display_system_default_auto)
39
- else -> theme
34
+ LIGHT -> R .string.app_preferences_theme_text_display_light
35
+ DARK -> R .string.app_preferences_theme_text_display_dark
36
+ else -> R .string.app_preferences_theme_text_display_system_default_auto
40
37
}
41
38
}
42
39
Original file line number Diff line number Diff line change @@ -127,8 +127,10 @@ fun SettingsContainer(onPasswordChange: (() -> Unit) -> Unit) {
127
127
modifier = Modifier .testTag(AppPreferences .THEME ),
128
128
key = AppPreferences .THEME ,
129
129
title = { Text (context.getString(R .string.settings_theme_title)) },
130
- summary = { Text (AppPreferences .Theme .toDisplayText(it, context)) },
131
- valueToText = { AnnotatedString (AppPreferences .Theme .toDisplayText(it, context)) },
130
+ summary = { Text (context.getString(AppPreferences .Theme .toDisplayText(it))) },
131
+ valueToText = {
132
+ AnnotatedString (context.getString(AppPreferences .Theme .toDisplayText(it)))
133
+ },
132
134
values = AppPreferences .Theme .asList,
133
135
defaultValue = AppPreferences .Theme .default,
134
136
icon = {
You can’t perform that action at this time.
0 commit comments