replacing Purchase Thank You buttons with Upgrade to Pro

This commit is contained in:
tibbi 2018-11-04 21:03:32 +01:00
parent 08459503eb
commit d3e743aba6
4 changed files with 15 additions and 9 deletions

View file

@ -48,7 +48,7 @@ android {
} }
dependencies { 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 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'androidx.multidex:multidex:2.0.0' implementation 'androidx.multidex:multidex:2.0.0'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -20,6 +20,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog
import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.dialogs.UpgradeToProDialog
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.models.FileDirItem
@ -147,6 +148,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
config.filterMedia += TYPE_SVGS config.filterMedia += TYPE_SVGS
} }
} }
if (!config.wasInitialUpgradeToProShown) {
UpgradeToProDialog(this)
config.wasInitialUpgradeToProShown = true
}
} }
override fun onStart() { override fun onStart() {

View file

@ -32,7 +32,7 @@ class SettingsActivity : SimpleActivity() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
setupPurchaseThankYou() setupUpgradeToPro()
setupCustomizeColors() setupCustomizeColors()
setupUseEnglish() setupUseEnglish()
setupManageIncludedFolders() setupManageIncludedFolders()
@ -87,10 +87,10 @@ class SettingsActivity : SimpleActivity() {
} }
} }
private fun setupPurchaseThankYou() { private fun setupUpgradeToPro() {
settings_purchase_thank_you_holder.beVisibleIf(config.appRunCount > 10 && !isThankYouInstalled()) settings_upgrade_to_pro_holder.beGoneIf(isAProApp())
settings_purchase_thank_you_holder.setOnClickListener { settings_upgrade_to_pro_holder.setOnClickListener {
launchPurchaseThankYouIntent() launchUpgradeToProIntent()
} }
} }

View file

@ -13,7 +13,7 @@
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:id="@+id/settings_purchase_thank_you_holder" android:id="@+id/settings_upgrade_to_pro_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin" android:layout_marginTop="@dimen/medium_margin"
@ -24,13 +24,13 @@
android:paddingBottom="@dimen/activity_margin"> android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_purchase_thank_you" android:id="@+id/settings_upgrade_to_pro"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:paddingStart="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin" android:paddingLeft="@dimen/medium_margin"
android:text="@string/purchase_simple_thank_you"/> android:text="@string/upgrade_to_pro"/>
</RelativeLayout> </RelativeLayout>