fix: customize colors locked
This commit is contained in:
parent
b161c5fa69
commit
a990bad4b9
2 changed files with 5 additions and 9 deletions
|
@ -43,9 +43,6 @@ class SettingsActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
val isOrWasThankYouInstalled = onEventValue { context.isOrWasThankYouInstalled() }
|
||||
val lockedCustomizeColorText by remember(isOrWasThankYouInstalled) {
|
||||
derivedStateOf { if (isOrWasThankYouInstalled) null else getCustomizeColorsString() }
|
||||
}
|
||||
val displayLanguage = remember { Locale.getDefault().displayLanguage }
|
||||
SettingsScreen(
|
||||
displayLanguage = displayLanguage,
|
||||
|
@ -73,7 +70,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
applicationContext.calculatorDB.deleteHistory()
|
||||
}
|
||||
},
|
||||
lockedCustomizeColorText = lockedCustomizeColorText
|
||||
lockedCustomizeColorText = getCustomizeColorsString()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ internal fun SettingsScreen(
|
|||
onSetupLanguagePress: () -> Unit,
|
||||
useCommaAsDecimalMarkFlow: Boolean,
|
||||
onUseCommaAsDecimalMarkFlow: (Boolean) -> Unit,
|
||||
lockedCustomizeColorText: String?,
|
||||
lockedCustomizeColorText: String,
|
||||
displayLanguage: String
|
||||
) {
|
||||
SettingsScaffold(title = stringResource(id = R.string.settings), goBack = goBack) {
|
||||
|
@ -40,10 +40,9 @@ internal fun SettingsScreen(
|
|||
SettingsTitleTextComponent(text = stringResource(id = R.string.color_customization))
|
||||
}) {
|
||||
SettingsPreferenceComponent(
|
||||
preferenceTitle = stringResource(id = R.string.customize_colors),
|
||||
preferenceTitle = lockedCustomizeColorText,
|
||||
doOnPreferenceClick = customizeColors,
|
||||
isPreferenceEnabled = isOrWasThankYouInstalled,
|
||||
preferenceSummary = lockedCustomizeColorText
|
||||
)
|
||||
SettingsPreferenceComponent(
|
||||
preferenceTitle = stringResource(id = R.string.customize_widget_colors),
|
||||
|
@ -106,7 +105,7 @@ private fun SettingsScreenPreview() {
|
|||
onPreventPhoneFromSleeping = {},
|
||||
vibrateOnButtonPressFlow = false,
|
||||
onVibrateOnButtonPressFlow = {},
|
||||
isOrWasThankYouInstalled = false,
|
||||
isOrWasThankYouInstalled = true,
|
||||
onThankYou = {},
|
||||
isUseEnglishEnabled = false,
|
||||
isUseEnglishChecked = false,
|
||||
|
@ -114,7 +113,7 @@ private fun SettingsScreenPreview() {
|
|||
onSetupLanguagePress = {},
|
||||
useCommaAsDecimalMarkFlow = false,
|
||||
onUseCommaAsDecimalMarkFlow = {},
|
||||
lockedCustomizeColorText = null,
|
||||
lockedCustomizeColorText = "Customize Colors",
|
||||
displayLanguage = "English"
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue