From 96d865b388fef4b7d120aba4a6003c3dd222cac8 Mon Sep 17 00:00:00 2001 From: Matt Chowning Date: Wed, 10 May 2023 12:51:29 -0400 Subject: [PATCH 1/3] Direct free users to forums --- .../pocketcasts/settings/HelpFragment.kt | 51 ++++++++++++++++--- .../pocketcasts/analytics/AnalyticsEvent.kt | 2 + .../src/main/res/values/strings.xml | 3 ++ 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/HelpFragment.kt b/modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/HelpFragment.kt index 4f9863700f1..b14fcc7260d 100644 --- a/modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/HelpFragment.kt +++ b/modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/HelpFragment.kt @@ -14,13 +14,18 @@ import android.webkit.WebResourceRequest import android.webkit.WebView import android.webkit.WebViewClient import android.widget.Button +import androidx.appcompat.app.AlertDialog import androidx.appcompat.widget.Toolbar import androidx.core.view.isVisible import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.lifecycle.lifecycleScope +import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsEvent +import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTrackerWrapper import au.com.shiftyjelly.pocketcasts.analytics.FirebaseAnalyticsTracker +import au.com.shiftyjelly.pocketcasts.models.to.SubscriptionStatus import au.com.shiftyjelly.pocketcasts.preferences.Settings +import au.com.shiftyjelly.pocketcasts.repositories.subscription.SubscriptionManager import au.com.shiftyjelly.pocketcasts.repositories.support.Support import au.com.shiftyjelly.pocketcasts.settings.status.StatusFragment import au.com.shiftyjelly.pocketcasts.settings.viewmodel.HelpViewModel @@ -33,6 +38,7 @@ import au.com.shiftyjelly.pocketcasts.views.helper.NavigationIcon.BackArrow import au.com.shiftyjelly.pocketcasts.views.helper.UiUtil import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch +import kotlinx.coroutines.rx2.await import timber.log.Timber import java.util.Locale import javax.inject.Inject @@ -42,9 +48,11 @@ import au.com.shiftyjelly.pocketcasts.views.R as VR @AndroidEntryPoint class HelpFragment : Fragment(), HasBackstack, Toolbar.OnMenuItemClickListener { + @Inject lateinit var analyticsTracker: AnalyticsTrackerWrapper @Inject lateinit var settings: Settings - @Inject lateinit var theme: Theme + @Inject lateinit var subscriptionManager: SubscriptionManager @Inject lateinit var support: Support + @Inject lateinit var theme: Theme val viewModel by viewModels() @@ -98,7 +106,9 @@ class HelpFragment : Fragment(), HasBackstack, Toolbar.OnMenuItemClickListener { loadingView = view.findViewById(VR.id.progress_circle) layoutError = view.findViewById(VR.id.layoutLoadingError) - view.findViewById