fix: customize colors locked

This commit is contained in:
FunkyMuse 2023-09-28 23:35:32 +02:00
parent b161c5fa69
commit a990bad4b9
2 changed files with 5 additions and 9 deletions

View file

@ -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()
)
}
}

View file

@ -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"
)
}