From e6cc16afcd6eb7b948be58531e0b7fd129bc9b82 Mon Sep 17 00:00:00 2001 From: FunkyMuse Date: Wed, 20 Sep 2023 09:44:30 +0200 Subject: [PATCH] feat: fully migrate to compose, main and settings --- app/src/main/AndroidManifest.xml | 2 + .../thankyou/activities/MainActivity.kt | 7 +- .../thankyou/activities/SettingsActivity.kt | 122 ++++++++---------- .../thankyou/extensions/Context.kt | 112 ++++++++++++++++ .../thankyou/helpers/Config.kt | 7 + .../thankyou/screens/MainScreen.kt | 66 +++++----- .../thankyou/screens/SettingsScreen.kt | 72 ++++++++++- app/src/main/res/layout/activity_main.xml | 36 ------ app/src/main/res/layout/activity_settings.xml | 121 ----------------- app/src/main/res/menu/menu_main.xml | 18 --- 10 files changed, 281 insertions(+), 282 deletions(-) delete mode 100644 app/src/main/res/layout/activity_main.xml delete mode 100644 app/src/main/res/layout/activity_settings.xml delete mode 100644 app/src/main/res/menu/menu_main.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 44d259c..3df625e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,12 +28,14 @@ diff --git a/app/src/main/kotlin/com/simplemobiletools/thankyou/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/thankyou/activities/MainActivity.kt index 7b09372..d02860b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/thankyou/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/thankyou/activities/MainActivity.kt @@ -2,21 +2,23 @@ package com.simplemobiletools.thankyou.activities import android.content.Intent import android.os.Bundle +import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import com.simplemobiletools.commons.compose.extensions.enableEdgeToEdgeSimple import com.simplemobiletools.commons.compose.extensions.onEventValue import com.simplemobiletools.commons.compose.theme.AppThemeSurface import com.simplemobiletools.commons.extensions.appLaunched -import com.simplemobiletools.commons.extensions.checkWhatsNew import com.simplemobiletools.commons.extensions.hideKeyboard import com.simplemobiletools.commons.extensions.launchMoreAppsFromUsIntent import com.simplemobiletools.commons.models.FAQItem import com.simplemobiletools.commons.models.Release import com.simplemobiletools.thankyou.BuildConfig import com.simplemobiletools.thankyou.R +import com.simplemobiletools.thankyou.extensions.checkWhatsNew +import com.simplemobiletools.thankyou.extensions.startAboutActivity import com.simplemobiletools.thankyou.screens.MainScreen -class MainActivity : SimpleActivity() { +class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdgeSimple() @@ -34,6 +36,7 @@ class MainActivity : SimpleActivity() { appLaunched(BuildConfig.APPLICATION_ID) checkWhatsNewDialog() } + private fun launchSettings() { hideKeyboard() startActivity(Intent(this, SettingsActivity::class.java)) diff --git a/app/src/main/kotlin/com/simplemobiletools/thankyou/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/thankyou/activities/SettingsActivity.kt index 78d6cc0..0630341 100644 --- a/app/src/main/kotlin/com/simplemobiletools/thankyou/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/thankyou/activities/SettingsActivity.kt @@ -1,93 +1,75 @@ package com.simplemobiletools.thankyou.activities +import android.annotation.SuppressLint import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.runtime.derivedStateOf +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.simplemobiletools.commons.compose.extensions.enableEdgeToEdgeSimple +import com.simplemobiletools.commons.compose.theme.AppThemeSurface import com.simplemobiletools.commons.dialogs.ConfirmationDialog -import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.NavigationIcon +import com.simplemobiletools.commons.extensions.getAppIconColors +import com.simplemobiletools.commons.extensions.toggleAppIconColor import com.simplemobiletools.commons.helpers.isTiramisuPlus import com.simplemobiletools.thankyou.BuildConfig import com.simplemobiletools.thankyou.R -import com.simplemobiletools.thankyou.databinding.ActivitySettingsBinding import com.simplemobiletools.thankyou.extensions.config +import com.simplemobiletools.thankyou.extensions.launchChangeAppLanguageIntent +import com.simplemobiletools.thankyou.extensions.startCustomizationActivity +import com.simplemobiletools.thankyou.screens.SettingsScreen import java.util.Locale import kotlin.system.exitProcess -class SettingsActivity : SimpleActivity() { - private val binding by lazy(LazyThreadSafetyMode.NONE) { ActivitySettingsBinding.inflate(layoutInflater) } +class SettingsActivity : ComponentActivity() { + private val preferences by lazy { config } + + @SuppressLint("NewApi") override fun onCreate(savedInstanceState: Bundle?) { - isMaterialActivity = true super.onCreate(savedInstanceState) - setContentView(binding.root) - - binding.apply { - updateMaterialActivityViews(settingsCoordinator, settingsHolder, useTransparentNavigation = true, useTopSearchMenu = false) - setupMaterialScrollListener(settingsNestedScrollview, settingsToolbar) - } - } - - override fun onResume() { - super.onResume() - setupToolbar(binding.settingsToolbar, NavigationIcon.Arrow) - - setupCustomizeColors() - setupUseEnglish() - setupLanguage() - setupHideLauncherIcon() - updateTextColors(binding.settingsNestedScrollview) - - binding.apply { - arrayOf(settingsColorCustomizationSectionLabel, settingsGeneralSettingsLabel).forEach { - it.setTextColor(getProperPrimaryColor()) - } - } - } - - private fun setupCustomizeColors() { - binding.settingsColorCustomizationHolder.setOnClickListener { - startCustomizationActivity() - } - } - - private fun setupUseEnglish() { - binding.apply { - settingsUseEnglishHolder.beVisibleIf((config.wasUseEnglishToggled || Locale.getDefault().language != "en") && !isTiramisuPlus()) - settingsUseEnglish.isChecked = config.useEnglish - settingsUseEnglishHolder.setOnClickListener { - settingsUseEnglish.toggle() - config.useEnglish = settingsUseEnglish.isChecked - exitProcess(0) - } - } - } - - private fun setupLanguage() { - binding.apply { - settingsLanguage.text = Locale.getDefault().displayLanguage - settingsLanguageHolder.beVisibleIf(isTiramisuPlus()) - settingsLanguageHolder.setOnClickListener { - launchChangeAppLanguageIntent() - } - } - } - - private fun setupHideLauncherIcon() { - binding.settingsHideLauncherIcon.isChecked = config.hideLauncherIcon - binding.settingsHideLauncherIconHolder.setOnClickListener { - if (config.hideLauncherIcon) { - toggleHideLauncherIcon() - } else { - ConfirmationDialog(this, "", R.string.hide_launcher_icon_explanation, R.string.ok, R.string.cancel) { - toggleHideLauncherIcon() + enableEdgeToEdgeSimple() + setContent { + AppThemeSurface { + val wasUseEnglishToggledFlow by preferences.wasUseEnglishToggledFlow.collectAsStateWithLifecycle(preferences.wasUseEnglishToggled) + val useEnglishFlow by preferences.useEnglishFlow.collectAsStateWithLifecycle(preferences.useEnglish) + val hideLauncherIconFlow by preferences.hideLauncherIconFlow.collectAsStateWithLifecycle(preferences.useEnglish) + val displayLanguage = remember { Locale.getDefault().displayLanguage } + val isUseEnglishEnabled by remember(wasUseEnglishToggledFlow) { + derivedStateOf { + (wasUseEnglishToggledFlow || Locale.getDefault().language != "en") && !isTiramisuPlus() + } } + SettingsScreen( + displayLanguage = displayLanguage, + isUseEnglishEnabled = isUseEnglishEnabled, + isUseEnglishChecked = useEnglishFlow, + onUseEnglishPress = { isChecked -> + preferences.useEnglish = isChecked + exitProcess(0) + }, + onSetupLanguagePress = ::launchChangeAppLanguageIntent, + isHidingLauncherIcon = hideLauncherIconFlow, + hideLauncherIconClick = { isChecked -> + preferences.hideLauncherIcon = isChecked + if (isChecked) { + toggleHideLauncherIcon() + } else { + ConfirmationDialog(this, "", R.string.hide_launcher_icon_explanation, R.string.ok, R.string.cancel) { + toggleHideLauncherIcon() + } + } + }, + customizeColors = ::startCustomizationActivity, + goBack = ::finish + ) } } } private fun toggleHideLauncherIcon() { - binding.settingsHideLauncherIcon.toggle() - config.hideLauncherIcon = binding.settingsHideLauncherIcon.isChecked - val appId = BuildConfig.APPLICATION_ID getAppIconColors().forEachIndexed { index, color -> toggleAppIconColor(appId, index, color, false) diff --git a/app/src/main/kotlin/com/simplemobiletools/thankyou/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/thankyou/extensions/Context.kt index a8ebe9a..32fb6ed 100644 --- a/app/src/main/kotlin/com/simplemobiletools/thankyou/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/thankyou/extensions/Context.kt @@ -1,6 +1,118 @@ package com.simplemobiletools.thankyou.extensions +import android.app.Activity import android.content.Context +import android.content.Intent +import android.net.Uri +import android.os.Build +import android.provider.Settings +import androidx.annotation.RequiresApi +import com.simplemobiletools.commons.activities.AboutActivity +import com.simplemobiletools.commons.activities.BaseSimpleActivity +import com.simplemobiletools.commons.activities.CustomizationActivity +import com.simplemobiletools.commons.compose.theme.getAppLauncherName +import com.simplemobiletools.commons.dialogs.ConfirmationDialog +import com.simplemobiletools.commons.dialogs.WhatsNewDialog +import com.simplemobiletools.commons.extensions.baseConfig +import com.simplemobiletools.commons.extensions.hideKeyboard +import com.simplemobiletools.commons.extensions.launchViewIntent +import com.simplemobiletools.commons.extensions.openDeviceSettings +import com.simplemobiletools.commons.helpers.* +import com.simplemobiletools.commons.models.FAQItem +import com.simplemobiletools.commons.models.Release +import com.simplemobiletools.thankyou.R import com.simplemobiletools.thankyou.helpers.Config val Context.config: Config get() = Config.newInstance(applicationContext) + +internal fun Activity.startAboutActivity( + appNameId: Int, licenseMask: Long, versionName: String, faqItems: ArrayList, showFAQBeforeMail: Boolean, + getAppIconIDs: ArrayList = getAppIconIDs(), + getAppLauncherName : String = launcherName() +) { + hideKeyboard() + Intent(applicationContext, AboutActivity::class.java).apply { + putExtra(APP_ICON_IDS, getAppIconIDs) + putExtra(APP_LAUNCHER_NAME, getAppLauncherName) + putExtra(APP_NAME, getString(appNameId)) + putExtra(APP_LICENSES, licenseMask) + putExtra(APP_VERSION_NAME, versionName) + putExtra(APP_FAQ, faqItems) + putExtra(SHOW_FAQ_BEFORE_MAIL, showFAQBeforeMail) + startActivity(this) + } +} + +internal fun Activity.startCustomizationActivity( + getAppIconIDs: ArrayList = getAppIconIDs(), + getAppLauncherName : String = launcherName() +) { + if (!packageName.contains("slootelibomelpmis".reversed(), true)) { + if (baseConfig.appRunCount > 100) { + val label = "You are using a fake version of the app. For your own safety download the original one from www.simplemobiletools.com. Thanks" + ConfirmationDialog(this, label, positive = R.string.ok, negative = 0) { + launchViewIntent("https://play.google.com/store/apps/dev?id=9070296388022589266") + } + return + } + } + + Intent(applicationContext, CustomizationActivity::class.java).apply { + putExtra(APP_ICON_IDS, getAppIconIDs) + putExtra(APP_LAUNCHER_NAME, getAppLauncherName) + startActivity(this) + } +} + + +@RequiresApi(Build.VERSION_CODES.TIRAMISU) +internal fun Activity.launchChangeAppLanguageIntent() { + try { + Intent(Settings.ACTION_APP_LOCALE_SETTINGS).apply { + data = Uri.fromParts("package", packageName, null) + startActivity(this) + } + } catch (e: Exception) { + openDeviceSettings() + } +} + +internal fun Activity.checkWhatsNew(releases: List, currVersion: Int) { + if (baseConfig.lastVersion == 0) { + baseConfig.lastVersion = currVersion + return + } + + val newReleases = arrayListOf() + releases.filterTo(newReleases) { it.id > baseConfig.lastVersion } + + if (newReleases.isNotEmpty()) { + WhatsNewDialog(this, newReleases) + } + + baseConfig.lastVersion = currVersion +} + +private fun getAppIconIDs() = arrayListOf( + R.mipmap.ic_launcher_red, + R.mipmap.ic_launcher_pink, + R.mipmap.ic_launcher_purple, + R.mipmap.ic_launcher_deep_purple, + R.mipmap.ic_launcher_indigo, + R.mipmap.ic_launcher_blue, + R.mipmap.ic_launcher_light_blue, + R.mipmap.ic_launcher_cyan, + R.mipmap.ic_launcher_teal, + R.mipmap.ic_launcher_green, + R.mipmap.ic_launcher_light_green, + R.mipmap.ic_launcher_lime, + R.mipmap.ic_launcher_yellow, + R.mipmap.ic_launcher_amber, + R.mipmap.ic_launcher, + R.mipmap.ic_launcher_deep_orange, + R.mipmap.ic_launcher_brown, + R.mipmap.ic_launcher_blue_grey, + R.mipmap.ic_launcher_grey_black +) + +private fun Context.launcherName() = getString(R.string.app_launcher_name) diff --git a/app/src/main/kotlin/com/simplemobiletools/thankyou/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/thankyou/helpers/Config.kt index acbdac9..4b3d6b9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/thankyou/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/thankyou/helpers/Config.kt @@ -1,7 +1,10 @@ package com.simplemobiletools.thankyou.helpers import android.content.Context +import com.simplemobiletools.commons.extensions.sharedPreferencesCallback import com.simplemobiletools.commons.helpers.BaseConfig +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.filterNotNull class Config(context: Context) : BaseConfig(context) { companion object { @@ -11,4 +14,8 @@ class Config(context: Context) : BaseConfig(context) { var hideLauncherIcon: Boolean get() = prefs.getBoolean(HIDE_LAUNCHER_ICON, false) set(hideLauncherIcon) = prefs.edit().putBoolean(HIDE_LAUNCHER_ICON, hideLauncherIcon).apply() + + val hideLauncherIconFlow: Flow = prefs.run { sharedPreferencesCallback { hideLauncherIcon } }.filterNotNull() + val wasUseEnglishToggledFlow: Flow = prefs.run { sharedPreferencesCallback { wasUseEnglishToggled } }.filterNotNull() + val useEnglishFlow: Flow = prefs.run { sharedPreferencesCallback { useEnglish } }.filterNotNull() } diff --git a/app/src/main/kotlin/com/simplemobiletools/thankyou/screens/MainScreen.kt b/app/src/main/kotlin/com/simplemobiletools/thankyou/screens/MainScreen.kt index ca3f528..7aa8a42 100644 --- a/app/src/main/kotlin/com/simplemobiletools/thankyou/screens/MainScreen.kt +++ b/app/src/main/kotlin/com/simplemobiletools/thankyou/screens/MainScreen.kt @@ -2,30 +2,29 @@ package com.simplemobiletools.thankyou.screens +import android.text.util.Linkify +import android.view.Gravity +import android.widget.TextView import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.* import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Info import androidx.compose.material.icons.filled.Settings import androidx.compose.material.icons.outlined.Info -import androidx.compose.material.icons.outlined.Settings import androidx.compose.material3.* import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.stringResource +import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import androidx.compose.ui.viewinterop.AndroidView import com.simplemobiletools.commons.R import com.simplemobiletools.commons.compose.extensions.MyDevices import com.simplemobiletools.commons.compose.menus.ActionItem import com.simplemobiletools.commons.compose.menus.ActionMenu import com.simplemobiletools.commons.compose.menus.OverflowMode -import com.simplemobiletools.commons.compose.screens.LinkifyText -import com.simplemobiletools.commons.compose.screens.stringFromHTML import com.simplemobiletools.commons.compose.settings.scaffold.* import com.simplemobiletools.commons.compose.theme.AppThemeSurface -import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList @Composable @@ -35,18 +34,19 @@ internal fun MainScreen( openAbout: () -> Unit, moreAppsFromUs: () -> Unit, ) { - SettingsLazyScaffold(customTopBar = { scrolledColor: Color, _: MutableInteractionSource, scrollBehavior: TopAppBarScrollBehavior, statusBarColor: Int, colorTransitionFraction: Float, contrastColor: Color -> TopAppBar( title = {}, actions = { val actionMenus = remember { - val list = listOf( - ActionItem(R.string.settings, icon = Icons.Outlined.Settings, doAction = openSettings, overflowMode = OverflowMode.NEVER_OVERFLOW), - ActionItem(R.string.about, icon = Icons.Outlined.Info, doAction = openAbout, overflowMode = OverflowMode.NEVER_OVERFLOW), - ) - if (showMoreApps) { - list + ActionItem(R.string.more_apps_from_us, doAction = moreAppsFromUs, overflowMode = OverflowMode.ALWAYS_OVERFLOW) + val settings = + ActionItem(R.string.settings, icon = Icons.Filled.Settings, doAction = openSettings, overflowMode = OverflowMode.NEVER_OVERFLOW) + val about = ActionItem(R.string.about, icon = Icons.Outlined.Info, doAction = openAbout, overflowMode = OverflowMode.NEVER_OVERFLOW) + + val list = if (showMoreApps) { + listOf(settings, about, ActionItem(R.string.more_apps_from_us, doAction = moreAppsFromUs, overflowMode = OverflowMode.ALWAYS_OVERFLOW)) + } else { + listOf(settings, about) } list.toImmutableList() } @@ -58,11 +58,26 @@ internal fun MainScreen( modifier = Modifier.topAppBarPaddings(), windowInsets = topAppBarInsets() ) - }) { - val source = stringResource(id = com.simplemobiletools.thankyou.R.string.main_text) - LinkifyText(modifier = Modifier.padding(40.dp), fontSize = 16.sp) { - stringFromHTML(source) - } + }) { paddingValues -> + val textColor = MaterialTheme.colorScheme.onSurface.toArgb() + AndroidView( + factory = { context -> + TextView(context).apply { + setText(com.simplemobiletools.thankyou.R.string.main_text) + textSize = 16.sp.value + setLineSpacing(3.dp.value, 1f) + gravity = Gravity.CENTER_HORIZONTAL + Linkify.addLinks(this, Linkify.WEB_URLS) + Linkify.addLinks(this, Linkify.EMAIL_ADDRESSES) + } + }, modifier = Modifier + .fillMaxSize() + .padding(bottom = paddingValues.calculateBottomPadding()) + .padding(40.dp), + update = { textView -> + textView.setTextColor(textColor) + } + ) } } @@ -77,21 +92,6 @@ fun topAppBarColors( navigationIconContentColor = if (colorTransitionFraction == 1f) contrastColor else MaterialTheme.colorScheme.surface ) -@Composable -private fun ActionMenuMainScreen( -) { - var isMenuVisible by remember { mutableStateOf(false) } - val actionMenus: ImmutableList = remember { - listOf( - ActionItem(nameRes = R.string.settings, icon = Icons.Default.Settings, overflowMode = OverflowMode.NEVER_OVERFLOW, doAction = {}), - ActionItem(nameRes = R.string.about, icon = Icons.Default.Info, overflowMode = OverflowMode.NEVER_OVERFLOW, doAction = {}), - ActionItem(nameRes = R.string.more_apps_from_us, icon = null, overflowMode = OverflowMode.ALWAYS_OVERFLOW, doAction = {}), - ).toImmutableList() - } - ActionMenu(items = actionMenus, numIcons = 2, isMenuVisible = isMenuVisible, onMenuToggle = { isMenuVisible = !isMenuVisible }) -} - - @Composable @MyDevices private fun MainScreenPreview() { diff --git a/app/src/main/kotlin/com/simplemobiletools/thankyou/screens/SettingsScreen.kt b/app/src/main/kotlin/com/simplemobiletools/thankyou/screens/SettingsScreen.kt index c98f430..0b42068 100644 --- a/app/src/main/kotlin/com/simplemobiletools/thankyou/screens/SettingsScreen.kt +++ b/app/src/main/kotlin/com/simplemobiletools/thankyou/screens/SettingsScreen.kt @@ -1,17 +1,85 @@ package com.simplemobiletools.thankyou.screens +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable +import androidx.compose.ui.res.stringResource +import com.simplemobiletools.commons.R import com.simplemobiletools.commons.compose.extensions.MyDevices +import com.simplemobiletools.commons.compose.settings.SettingsCheckBoxComponent +import com.simplemobiletools.commons.compose.settings.SettingsGroup +import com.simplemobiletools.commons.compose.settings.SettingsPreferenceComponent +import com.simplemobiletools.commons.compose.settings.SettingsTitleTextComponent +import com.simplemobiletools.commons.compose.settings.scaffold.SettingsScaffold import com.simplemobiletools.commons.compose.theme.AppThemeSurface +import com.simplemobiletools.commons.compose.theme.divider_grey +import com.simplemobiletools.commons.helpers.isTiramisuPlus @Composable -internal fun SettingsScreen() { +internal fun SettingsScreen( + displayLanguage: String, + isUseEnglishEnabled: Boolean, + isUseEnglishChecked: Boolean, + isHidingLauncherIcon: Boolean, + onUseEnglishPress: (Boolean) -> Unit, + onSetupLanguagePress: () -> Unit, + hideLauncherIconClick: (Boolean) -> Unit, + customizeColors: () -> Unit, + goBack: () -> Unit, +) { + SettingsScaffold(title = stringResource(id = R.string.settings), goBack = goBack) { + SettingsGroup(title = { + SettingsTitleTextComponent(text = stringResource(id = R.string.color_customization)) + }) { + SettingsPreferenceComponent( + preferenceTitle = stringResource(id = R.string.customize_colors), + doOnPreferenceClick = customizeColors, + ) + } + HorizontalDivider(color = divider_grey) + SettingsGroup(title = { + SettingsTitleTextComponent(text = stringResource(id = R.string.general_settings)) + }) { + if (isUseEnglishEnabled) { + SettingsCheckBoxComponent( + title = stringResource(id = R.string.use_english_language), + initialValue = isUseEnglishChecked, + onChange = onUseEnglishPress, + ) + } + if (isTiramisuPlus()) { + SettingsPreferenceComponent( + preferenceTitle = stringResource(id = R.string.language), + preferenceSummary = displayLanguage, + doOnPreferenceClick = onSetupLanguagePress, + preferenceSummaryColor = MaterialTheme.colorScheme.onSurface, + ) + } + SettingsCheckBoxComponent( + title = stringResource(id = com.simplemobiletools.thankyou.R.string.hide_launcher_icon), + initialValue = isHidingLauncherIcon, + onChange = hideLauncherIconClick, + ) + } + } } @Composable @MyDevices private fun SettingsScreenPreview() { - AppThemeSurface { SettingsScreen() } + AppThemeSurface { + SettingsScreen( + displayLanguage = "English", + isUseEnglishEnabled = false, + isUseEnglishChecked = false, + isHidingLauncherIcon = false, + onUseEnglishPress = {}, + onSetupLanguagePress = {}, + hideLauncherIconClick = {}, + customizeColors = {}, + goBack = {}, + ) + } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 640c6d8..0000000 --- a/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml deleted file mode 100644 index 1b01681..0000000 --- a/app/src/main/res/layout/activity_settings.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml deleted file mode 100644 index 0d87848..0000000 --- a/app/src/main/res/menu/menu_main.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -