From 0cfcc9b90017d64294b781d44ecd93c2804336a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 5 Oct 2023 16:50:25 +0200 Subject: [PATCH] Use compose version of `CheckAppOnSdCard` --- .../flashlight/activities/MainActivity.kt | 12 +++--------- gradle/libs.versions.toml | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/MainActivity.kt index e8c6af9..92aba7b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/MainActivity.kt @@ -31,6 +31,7 @@ import androidx.lifecycle.viewModelScope import com.google.android.material.math.MathUtils import com.simplemobiletools.commons.compose.alert_dialog.AlertDialogState import com.simplemobiletools.commons.compose.alert_dialog.rememberAlertDialogState +import com.simplemobiletools.commons.compose.extensions.CheckAppOnSdCard import com.simplemobiletools.commons.compose.extensions.onEventValue import com.simplemobiletools.commons.compose.theme.AppThemeSurface import com.simplemobiletools.commons.dialogs.ConfirmationDialog @@ -213,10 +214,10 @@ class MainActivity : ComponentActivity() { }, moreAppsFromUs = ::launchMoreAppsFromUsIntent ) + + CheckAppOnSdCard() } } - - checkAppOnSDCard() } override fun onResume() { @@ -257,13 +258,6 @@ class MainActivity : ComponentActivity() { startAboutActivity(R.string.app_name, 0, BuildConfig.VERSION_NAME, faqItems, true) } - private fun checkAppOnSDCard() { - if (!baseConfig.wasAppOnSDShown && isAppInstalledOnSDCard()) { - baseConfig.wasAppOnSDShown = true - ConfirmationDialog(this, "", R.string.app_on_sd_card, R.string.ok, 0) {} - } - } - private fun toggleStroboscope(isSOS: Boolean, launcher: ManagedActivityResultLauncher) { // use the old Camera API for stroboscope, the new Camera Manager is way too slow if (isNougatPlus()) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1c0c9a9..3c6bb43 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ androidx-customView = "1.2.0-alpha02" androidx-customViewPooling = "1.0.0" androidx-lifecycle = "2.7.0-alpha02" #Simple tools -simple-commons = "b72ded2a75" +simple-commons = "543593cc03" #Compose composeActivity = "1.8.0-rc01" compose = "1.6.0-alpha06"