From ef1895c899f7b443644cbca0dc00b4c07c39d636 Mon Sep 17 00:00:00 2001 From: FunkyMuse Date: Fri, 29 Sep 2023 13:11:19 +0200 Subject: [PATCH] refactor: extract getFeatureLockedDialogState --- .../calculator/activities/SettingsActivity.kt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/SettingsActivity.kt index 91bddd2e..80b90461 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/SettingsActivity.kt @@ -46,13 +46,7 @@ class SettingsActivity : AppCompatActivity() { } val isOrWasThankYouInstalled = onEventValue { context.isOrWasThankYouInstalled() } val displayLanguage = remember { Locale.getDefault().displayLanguage } - val featureLockedDialogState = rememberAlertDialogState().apply { - DialogMember { - FeatureLockedAlertDialog(alertDialogState = this) { - - } - } - } + val featureLockedDialogState = getFeatureLockedDialogState() SettingsScreen( displayLanguage = displayLanguage, goBack = ::finish, @@ -86,6 +80,14 @@ class SettingsActivity : AppCompatActivity() { } } + @Composable + private fun getFeatureLockedDialogState() = + rememberAlertDialogState().apply { + DialogMember { + FeatureLockedAlertDialog(alertDialogState = this, callback = {}) + } + } + private fun handleCustomizeColorsClick() { Intent(applicationContext, CustomizationActivity::class.java).apply { putExtra(APP_ICON_IDS, getAppIconIds())