From d3e743aba615440f970856d942c69be15918fec4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 4 Nov 2018 21:03:32 +0100 Subject: [PATCH] replacing Purchase Thank You buttons with Upgrade to Pro --- app/build.gradle | 2 +- .../gallery/activities/MainActivity.kt | 6 ++++++ .../gallery/activities/SettingsActivity.kt | 10 +++++----- app/src/main/res/layout/activity_settings.xml | 6 +++--- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 174761961..93bfd071a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -48,7 +48,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.3.0' + implementation 'com.simplemobiletools:commons:5.3.9' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'androidx.multidex:multidex:2.0.0' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 8662466f9..c79ef6987 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -20,6 +20,7 @@ import androidx.recyclerview.widget.RecyclerView import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog +import com.simplemobiletools.commons.dialogs.UpgradeToProDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.commons.models.FileDirItem @@ -147,6 +148,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { config.filterMedia += TYPE_SVGS } } + + if (!config.wasInitialUpgradeToProShown) { + UpgradeToProDialog(this) + config.wasInitialUpgradeToProShown = true + } } override fun onStart() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 5d3f56c6c..82583cf37 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -32,7 +32,7 @@ class SettingsActivity : SimpleActivity() { override fun onResume() { super.onResume() - setupPurchaseThankYou() + setupUpgradeToPro() setupCustomizeColors() setupUseEnglish() setupManageIncludedFolders() @@ -87,10 +87,10 @@ class SettingsActivity : SimpleActivity() { } } - private fun setupPurchaseThankYou() { - settings_purchase_thank_you_holder.beVisibleIf(config.appRunCount > 10 && !isThankYouInstalled()) - settings_purchase_thank_you_holder.setOnClickListener { - launchPurchaseThankYouIntent() + private fun setupUpgradeToPro() { + settings_upgrade_to_pro_holder.beGoneIf(isAProApp()) + settings_upgrade_to_pro_holder.setOnClickListener { + launchUpgradeToProIntent() } } diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index a76152ada..d46e510fe 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -13,7 +13,7 @@ android:orientation="vertical"> + android:text="@string/upgrade_to_pro"/>