From 3aa4a8dab6ef4c8a0e3d7741633de105565a41b9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 29 Dec 2020 17:18:06 +0100 Subject: [PATCH] require Simple Thank You purchase for color customization --- app/build.gradle | 2 +- .../flashlight/activities/SettingsActivity.kt | 20 +++++++++---------- app/src/main/res/layout/activity_settings.xml | 2 +- build.gradle | 4 ++-- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5d30759..73b421b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,7 +55,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.31.25' + implementation 'com.simplemobiletools:commons:5.32.16' implementation 'org.greenrobot:eventbus:3.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' } diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt index 17ea7cd..01d735c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt @@ -3,10 +3,7 @@ package com.simplemobiletools.flashlight.activities import android.content.Intent import android.os.Bundle import android.view.Menu -import com.simplemobiletools.commons.extensions.beVisibleIf -import com.simplemobiletools.commons.extensions.isThankYouInstalled -import com.simplemobiletools.commons.extensions.launchPurchaseThankYouIntent -import com.simplemobiletools.commons.extensions.updateTextColors +import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS import com.simplemobiletools.flashlight.R import com.simplemobiletools.flashlight.extensions.config @@ -40,16 +37,17 @@ class SettingsActivity : SimpleActivity() { return super.onCreateOptionsMenu(menu) } - private fun setupCustomizeColors() { - settings_customize_colors_holder.setOnClickListener { - startCustomizationActivity() + private fun setupPurchaseThankYou() { + settings_purchase_thank_you_holder.beGoneIf(isOrWasThankYouInstalled()) + settings_purchase_thank_you_holder.setOnClickListener { + launchPurchaseThankYouIntent() } } - private fun setupPurchaseThankYou() { - settings_purchase_thank_you_holder.beVisibleIf(!isThankYouInstalled()) - settings_purchase_thank_you_holder.setOnClickListener { - launchPurchaseThankYouIntent() + private fun setupCustomizeColors() { + settings_customize_colors_label.text = getCustomizeColorsString() + settings_customize_colors_holder.setOnClickListener { + handleCustomizeColorsClick() } } diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 04d64c6..8568ec8 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -44,7 +44,7 @@ android:paddingBottom="@dimen/activity_margin">