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