replace the Purchase Thank You settings button with Upgrade to Pro

This commit is contained in:
tibbi 2018-11-04 12:10:19 +01:00
parent df2ab51618
commit 0329816a4e
3 changed files with 10 additions and 13 deletions

View File

@ -41,7 +41,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.3.3' implementation 'com.simplemobiletools:commons:5.3.6'
} }
Properties props = new Properties() Properties props = new Properties()

View File

@ -1,10 +1,7 @@
package com.simplemobiletools.draw.activities package com.simplemobiletools.draw.activities
import android.os.Bundle import android.os.Bundle
import com.simplemobiletools.commons.extensions.beVisibleIf import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.extensions.isThankYouInstalled
import com.simplemobiletools.commons.extensions.launchPurchaseThankYouIntent
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.draw.R import com.simplemobiletools.draw.R
import com.simplemobiletools.draw.extensions.config import com.simplemobiletools.draw.extensions.config
import kotlinx.android.synthetic.main.activity_settings.* import kotlinx.android.synthetic.main.activity_settings.*
@ -19,7 +16,7 @@ class SettingsActivity : SimpleActivity() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
setupPurchaseThankYou() setupUpgradeToPro()
setupCustomizeColors() setupCustomizeColors()
setupUseEnglish() setupUseEnglish()
setupPreventPhoneFromSleeping() setupPreventPhoneFromSleeping()
@ -29,10 +26,10 @@ class SettingsActivity : SimpleActivity() {
updateTextColors(settings_holder) updateTextColors(settings_holder)
} }
private fun setupPurchaseThankYou() { private fun setupUpgradeToPro() {
settings_purchase_thank_you_holder.beVisibleIf(!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>