From bfe4342bd7acf4848231c88754d6cb8da4c32501 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Tue, 2 Mar 2021 13:31:50 -0600 Subject: [PATCH] Update Help & feedback screen --- .../java/org/tasks/dialogs/WhatsNewDialog.kt | 2 +- .../preferences/fragments/HelpAndFeedback.kt | 10 +- .../main/java/org/tasks/themes/CustomIcons.kt | 2 + .../main/res/drawable/ic_outline_forum_24.xml | 5 + .../res/drawable/ic_twitter_logo_black.xml | 4 + app/src/main/res/values/keys.xml | 2 + app/src/main/res/values/strings.xml | 9 +- app/src/main/res/xml/help_and_feedback.xml | 151 +++++++++++------- 8 files changed, 127 insertions(+), 58 deletions(-) create mode 100644 app/src/main/res/drawable/ic_outline_forum_24.xml create mode 100644 app/src/main/res/drawable/ic_twitter_logo_black.xml diff --git a/app/src/main/java/org/tasks/dialogs/WhatsNewDialog.kt b/app/src/main/java/org/tasks/dialogs/WhatsNewDialog.kt index 1a9a562dc..fc201b3a0 100644 --- a/app/src/main/java/org/tasks/dialogs/WhatsNewDialog.kt +++ b/app/src/main/java/org/tasks/dialogs/WhatsNewDialog.kt @@ -57,7 +57,7 @@ class WhatsNewDialog : DialogFragment() { changelog.movementMethod = LinkMovementMethod.getInstance() changelog.text = markwon.toMarkdown(text) - val begForSubscription = firebase.noChurn() && !inventory.hasPro + val begForSubscription = !inventory.hasPro val begForRating = !preferences.getBoolean(R.string.p_clicked_rate, false) && (inventory.purchasedThemes() || firebase.noChurn()) && (!begForSubscription || Random.nextBoolean()) diff --git a/app/src/main/java/org/tasks/preferences/fragments/HelpAndFeedback.kt b/app/src/main/java/org/tasks/preferences/fragments/HelpAndFeedback.kt index 1b575f0c3..965ae3e55 100644 --- a/app/src/main/java/org/tasks/preferences/fragments/HelpAndFeedback.kt +++ b/app/src/main/java/org/tasks/preferences/fragments/HelpAndFeedback.kt @@ -7,14 +7,19 @@ import androidx.fragment.app.FragmentManager import dagger.hilt.android.AndroidEntryPoint import org.tasks.BuildConfig import org.tasks.R +import org.tasks.Tasks.Companion.IS_GENERIC +import org.tasks.analytics.Firebase import org.tasks.dialogs.WhatsNewDialog import org.tasks.injection.InjectingPreferenceFragment +import javax.inject.Inject private const val FRAG_TAG_WHATS_NEW = "frag_tag_whats_new" @AndroidEntryPoint class HelpAndFeedback : InjectingPreferenceFragment() { + @Inject lateinit var firebase: Firebase + override fun getPreferenceXml() = R.xml.help_and_feedback override suspend fun setupPreferences(savedInstanceState: Bundle?) { @@ -48,12 +53,13 @@ class HelpAndFeedback : InjectingPreferenceFragment() { true } - @Suppress("ConstantConditionIf") - if (BuildConfig.FLAVOR == "generic") { + if (IS_GENERIC) { remove( R.string.p_collect_statistics, R.string.rate_tasks, ) + } else if (!firebase.noChurn()) { + remove(R.string.rate_tasks) } } diff --git a/app/src/main/java/org/tasks/themes/CustomIcons.kt b/app/src/main/java/org/tasks/themes/CustomIcons.kt index 75783affb..5896ecaa4 100644 --- a/app/src/main/java/org/tasks/themes/CustomIcons.kt +++ b/app/src/main/java/org/tasks/themes/CustomIcons.kt @@ -205,6 +205,8 @@ object CustomIcons { 1180 to R.drawable.ic_plumbing_24px, 1181 to R.drawable.ic_pest_control_rodent_24px, 1182 to R.drawable.ic_outline_people_outline_24, + 1183 to R.drawable.ic_outline_forum_24, + 1184 to R.drawable.ic_twitter_logo_black, ) @JvmStatic diff --git a/app/src/main/res/drawable/ic_outline_forum_24.xml b/app/src/main/res/drawable/ic_outline_forum_24.xml new file mode 100644 index 000000000..0af1d7fbf --- /dev/null +++ b/app/src/main/res/drawable/ic_outline_forum_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_twitter_logo_black.xml b/app/src/main/res/drawable/ic_twitter_logo_black.xml new file mode 100644 index 000000000..131726c57 --- /dev/null +++ b/app/src/main/res/drawable/ic_twitter_logo_black.xml @@ -0,0 +1,4 @@ + + + diff --git a/app/src/main/res/values/keys.xml b/app/src/main/res/values/keys.xml index 23fa5c4ed..435fda0a0 100644 --- a/app/src/main/res/values/keys.xml +++ b/app/src/main/res/values/keys.xml @@ -28,6 +28,8 @@ https://tasks.org/help/tasker https://tasks.org/donate https://reddit.com/r/tasks + https://twitter.com/tasks_org + https://webchat.freenode.net/?channels=tasks https://github.com/sponsors/abaker https://tasks.org/passwords diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bbf7a10da..d5d751fcf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -651,7 +651,14 @@ File %1$s contained %2$s.\n\n $%s/month $%s/mo Current subscription: %s - Follow r/tasks + Join r/tasks + Follow @tasks_org + Join #tasks on Freenode + Social + Support + Issue tracker + Open source + Privacy Authorization cancelled Not signed in Google Play subscribers diff --git a/app/src/main/res/xml/help_and_feedback.xml b/app/src/main/res/xml/help_and_feedback.xml index a11984dbc..d8373022f 100644 --- a/app/src/main/res/xml/help_and_feedback.xml +++ b/app/src/main/res/xml/help_and_feedback.xml @@ -8,68 +8,111 @@ app:icon="@drawable/ic_outline_new_releases_24px"/> + android:key="@string/rate_tasks" + android:title="@string/rate_tasks" + app:icon="@drawable/ic_outline_star_border_24px"> + android:action="android.intent.action.VIEW" + android:data="@string/market_url" /> - - - + - + + + - - - + + + - - - + - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file