replacing Purchase Thank You buttons with Upgrade to Pro

This commit is contained in:
tibbi 2018-11-09 11:28:22 +01:00
parent f52ec826f4
commit aee36d0d86
3 changed files with 14 additions and 9 deletions

View File

@ -18,7 +18,6 @@ import androidx.appcompat.widget.SearchView
import androidx.core.view.MenuItemCompat
import com.simplemobiletools.calendar.BuildConfig
import com.simplemobiletools.calendar.R
import com.simplemobiletools.calendar.R.id.*
import com.simplemobiletools.calendar.adapters.EventListAdapter
import com.simplemobiletools.calendar.dialogs.ExportEventsDialog
import com.simplemobiletools.calendar.dialogs.FilterEventTypesDialog
@ -32,6 +31,7 @@ import com.simplemobiletools.calendar.models.EventType
import com.simplemobiletools.calendar.models.ListEvent
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.interfaces.RefreshRecyclerViewListener
@ -103,6 +103,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
checkAppOnSDCard()
if (!config.wasInitialUpgradeToProShown) {
UpgradeToProDialog(this)
config.wasInitialUpgradeToProShown
}
}
override fun onResume() {

View File

@ -43,7 +43,7 @@ class SettingsActivity : SimpleActivity() {
override fun onResume() {
super.onResume()
setupPurchaseThankYou()
setupUpgradeToPro()
setupCustomizeColors()
setupUseEnglish()
setupManageEventTypes()
@ -110,10 +110,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()
}
}

View File

@ -12,7 +12,7 @@
android:orientation="vertical">
<RelativeLayout
android:id="@+id/settings_purchase_thank_you_holder"
android:id="@+id/settings_upgrade_to_pro_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
@ -23,13 +23,13 @@
android:paddingBottom="@dimen/activity_margin">
<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_height="wrap_content"
android:layout_centerVertical="true"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/purchase_simple_thank_you"/>
android:text="@string/upgrade_to_pro"/>
</RelativeLayout>