The PR caused some dependency changes (expand to see details)
+
```diff
{{{violation.message}}}
```
+
+
+
*Please review and act accordingly*
"""
violations = [
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java b/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java
index e3827621c198..c747aa323831 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/ActivityLauncher.java
@@ -116,12 +116,12 @@
import org.wordpress.android.ui.stats.StatsTimeframe;
import org.wordpress.android.ui.stats.StatsViewType;
import org.wordpress.android.ui.stats.refresh.StatsActivity;
-import org.wordpress.android.ui.stats.refresh.StatsActivity.StatsLaunchedFrom;
import org.wordpress.android.ui.stats.refresh.StatsViewAllActivity;
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection;
import org.wordpress.android.ui.stats.refresh.lists.detail.StatsDetailActivity;
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDateProvider.SelectedDate;
import org.wordpress.android.ui.stats.refresh.lists.sections.insights.management.InsightsManagementActivity;
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom;
import org.wordpress.android.ui.stockmedia.StockMediaPickerActivity;
import org.wordpress.android.ui.stories.StoryComposerActivity;
import org.wordpress.android.ui.suggestion.SuggestionActivity;
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/JetpackConnectionResultActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/JetpackConnectionResultActivity.java
index 85b6abe0cde0..7bc61f8a5342 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/JetpackConnectionResultActivity.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/JetpackConnectionResultActivity.java
@@ -20,7 +20,7 @@
import org.wordpress.android.fluxc.store.SiteStore;
import org.wordpress.android.login.LoginMode;
import org.wordpress.android.ui.accounts.LoginActivity;
-import org.wordpress.android.ui.stats.refresh.StatsActivity.StatsLaunchedFrom;
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom;
import org.wordpress.android.util.AppLog;
import org.wordpress.android.util.SiteUtils;
import org.wordpress.android.util.ToastUtils;
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/ShortcutsNavigator.java b/WordPress/src/main/java/org/wordpress/android/ui/ShortcutsNavigator.java
index 59f1d5a96a01..f0f1a1efb166 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/ShortcutsNavigator.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/ShortcutsNavigator.java
@@ -5,7 +5,7 @@
import org.wordpress.android.analytics.AnalyticsTracker;
import org.wordpress.android.fluxc.model.SiteModel;
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalPhaseHelper;
-import org.wordpress.android.ui.stats.refresh.StatsActivity.StatsLaunchedFrom;
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom;
import org.wordpress.android.util.AppLog;
import javax.inject.Inject;
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/DeepLinkNavigator.kt b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/DeepLinkNavigator.kt
index 748e26a9baec..93b81619cefd 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/DeepLinkNavigator.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/DeepLinkNavigator.kt
@@ -29,7 +29,7 @@ import org.wordpress.android.ui.deeplinks.DeepLinkNavigator.NavigateAction.ViewP
import org.wordpress.android.ui.sitecreation.misc.SiteCreationSource.DEEP_LINK
import org.wordpress.android.ui.sitemonitor.SiteMonitorType
import org.wordpress.android.ui.stats.StatsTimeframe
-import org.wordpress.android.ui.stats.refresh.StatsActivity
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom
import org.wordpress.android.util.UriWrapper
import javax.inject.Inject
@@ -66,14 +66,14 @@ class DeepLinkNavigator
is OpenStatsForSite -> ActivityLauncher.viewStatsInNewStack(
activity,
navigateAction.site,
- StatsActivity.StatsLaunchedFrom.LINK
+ StatsLaunchedFrom.LINK
)
is OpenStatsForSiteAndTimeframe -> ActivityLauncher.viewStatsInNewStack(
activity,
navigateAction.site,
navigateAction.statsTimeframe,
- StatsActivity.StatsLaunchedFrom.LINK
+ StatsLaunchedFrom.LINK
)
OpenReader -> ActivityLauncher.viewReaderInNewStack(activity)
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java
index 27cc8feae2a3..b2a55812a397 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java
@@ -134,7 +134,7 @@
import org.wordpress.android.ui.review.ReviewViewModel;
import org.wordpress.android.ui.sitecreation.misc.SiteCreationSource;
import org.wordpress.android.ui.stats.StatsTimeframe;
-import org.wordpress.android.ui.stats.refresh.StatsActivity.StatsLaunchedFrom;
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom;
import org.wordpress.android.ui.stories.intro.StoriesIntroDialogFragment;
import org.wordpress.android.ui.uploads.UploadActionUseCase;
import org.wordpress.android.ui.uploads.UploadUtils;
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt
index fecc440b3294..d6f4d88ee399 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/MySiteFragment.kt
@@ -59,7 +59,7 @@ import org.wordpress.android.ui.quickstart.QuickStartTracker
import org.wordpress.android.ui.reader.ReaderActivityLauncher
import org.wordpress.android.ui.reader.tracker.ReaderTracker
import org.wordpress.android.ui.stats.StatsTimeframe
-import org.wordpress.android.ui.stats.refresh.StatsActivity
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom
import org.wordpress.android.ui.uploads.UploadService
import org.wordpress.android.ui.uploads.UploadUtilsWrapper
import org.wordpress.android.ui.utils.TitleSubtitleSnackbarSpannable
@@ -611,7 +611,7 @@ class MySiteFragment : Fragment(R.layout.my_site_fragment),
is SiteNavigationAction.OpenStats -> ActivityLauncher.viewBlogStats(
activity,
action.site,
- StatsActivity.StatsLaunchedFrom.QUICK_ACTIONS
+ StatsLaunchedFrom.QUICK_ACTIONS
)
is SiteNavigationAction.ConnectJetpackForStats ->
@@ -678,7 +678,7 @@ class MySiteFragment : Fragment(R.layout.my_site_fragment),
requireActivity(),
action.site,
StatsTimeframe.INSIGHTS,
- StatsActivity.StatsLaunchedFrom.TODAY_STATS_CARD
+ StatsLaunchedFrom.TODAY_STATS_CARD
)
is SiteNavigationAction.OpenExternalUrl ->
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/menu/MenuActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/menu/MenuActivity.kt
index 33f583b28840..77ac0aa5d5c1 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/menu/MenuActivity.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/menu/MenuActivity.kt
@@ -64,7 +64,7 @@ import org.wordpress.android.ui.mysite.items.listitem.ListItemAction
import org.wordpress.android.ui.pages.SnackbarMessageHolder
import org.wordpress.android.ui.prefs.SiteSettingsFragment
import org.wordpress.android.ui.quickstart.QuickStartMySitePrompts
-import org.wordpress.android.ui.stats.refresh.StatsActivity
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom
import org.wordpress.android.ui.utils.ListItemInteraction
import org.wordpress.android.ui.utils.UiString
import org.wordpress.android.util.LocaleManager
@@ -147,7 +147,7 @@ class MenuActivity : AppCompatActivity() {
is SiteNavigationAction.OpenStats -> ActivityLauncher.viewBlogStats(
this,
action.site,
- StatsActivity.StatsLaunchedFrom.ROW
+ StatsLaunchedFrom.ROW
)
is SiteNavigationAction.OpenDomains -> ActivityLauncher.viewDomainsDashboardActivity(
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailActivity.java
index 4dc25520a642..750629d332f5 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailActivity.java
+++ b/WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailActivity.java
@@ -54,7 +54,7 @@
import org.wordpress.android.ui.reader.comments.ThreadedCommentsActionSource;
import org.wordpress.android.ui.reader.tracker.ReaderTracker;
import org.wordpress.android.ui.stats.StatsViewType;
-import org.wordpress.android.ui.stats.refresh.StatsActivity.StatsLaunchedFrom;
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom;
import org.wordpress.android.util.AppLog;
import org.wordpress.android.util.StringUtils;
import org.wordpress.android.util.ToastUtils;
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/notifications/utils/FormattableContentClickHandler.kt b/WordPress/src/main/java/org/wordpress/android/ui/notifications/utils/FormattableContentClickHandler.kt
index f42672dc941e..46d85fabbbc4 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/notifications/utils/FormattableContentClickHandler.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/notifications/utils/FormattableContentClickHandler.kt
@@ -16,7 +16,7 @@ import org.wordpress.android.ui.reader.comments.ThreadedCommentsActionSource.ACT
import org.wordpress.android.ui.reader.tracker.ReaderTracker
import org.wordpress.android.ui.reader.utils.ReaderUtils
import org.wordpress.android.ui.stats.StatsViewType.FOLLOWERS
-import org.wordpress.android.ui.stats.refresh.StatsActivity
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom
import org.wordpress.android.util.AppLog
import org.wordpress.android.util.AppLog.T.API
import org.wordpress.android.util.ToastUtils
@@ -118,7 +118,7 @@ class FormattableContentClickHandler @Inject constructor(
if (rangeType == FormattableRangeType.FOLLOW) {
ActivityLauncher.viewAllTabbedInsightsStats(activity, FOLLOWERS, 0, site.id)
} else {
- ActivityLauncher.viewBlogStats(activity, site, StatsActivity.StatsLaunchedFrom.ACTIVITY_LOG)
+ ActivityLauncher.viewBlogStats(activity, site, StatsLaunchedFrom.ACTIVITY_LOG)
}
}
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsActivity.kt
index 0366e091f397..9ee8db7113e6 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsActivity.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsActivity.kt
@@ -15,6 +15,7 @@ import org.wordpress.android.ui.ActivityLauncher
import org.wordpress.android.ui.LocaleAwareActivity
import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalPhaseHelper
import org.wordpress.android.ui.stats.StatsTimeframe
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom
import org.wordpress.android.ui.stats.refresh.utils.StatsSiteProvider
import org.wordpress.android.util.JetpackBrandingUtils
import javax.inject.Inject
@@ -90,16 +91,4 @@ class StatsActivity : LocaleAwareActivity() {
notificationType?.let { putExtra(ARG_NOTIFICATION_TYPE, it) }
}
}
-
- enum class StatsLaunchedFrom(val value: String) {
- QUICK_ACTIONS("quick_actions"),
- TODAY_STATS_CARD("today_stats_card"),
- ROW("row"),
- WIDGET("widget"),
- NOTIFICATION("notification"),
- LINK("link"),
- SHORTCUT("shortcut"),
- ACTIVITY_LOG("activity_log"),
- JETPACK_CONNECTION("jetpack_connection")
- }
}
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt
index cc1ae6094087..4c4fa6cfd0b3 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt
@@ -37,7 +37,6 @@ import org.wordpress.android.ui.stats.StatsTimeframe.DAY
import org.wordpress.android.ui.stats.StatsTimeframe.MONTH
import org.wordpress.android.ui.stats.StatsTimeframe.WEEK
import org.wordpress.android.ui.stats.StatsTimeframe.YEAR
-import org.wordpress.android.ui.stats.refresh.StatsActivity.StatsLaunchedFrom
import org.wordpress.android.ui.stats.refresh.StatsModuleActivateRequestState.Failure.NetworkUnavailable
import org.wordpress.android.ui.stats.refresh.StatsModuleActivateRequestState.Failure.RemoteRequestFailure
import org.wordpress.android.ui.stats.refresh.StatsModuleActivateRequestState.Success
@@ -47,6 +46,7 @@ import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDa
import org.wordpress.android.ui.stats.refresh.utils.NewsCardHandler
import org.wordpress.android.ui.stats.refresh.utils.SelectedSectionManager
import org.wordpress.android.ui.stats.refresh.utils.SelectedTrafficGranularityManager
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom
import org.wordpress.android.ui.stats.refresh.utils.StatsSiteProvider
import org.wordpress.android.ui.stats.refresh.utils.toStatsGranularity
import org.wordpress.android.ui.stats.refresh.utils.trackStatsAccessed
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/StatsDetailActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/StatsDetailActivity.kt
index 725e9ded2d76..a78ff06f39f4 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/StatsDetailActivity.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/StatsDetailActivity.kt
@@ -9,7 +9,6 @@ import androidx.fragment.app.commit
import dagger.hilt.android.AndroidEntryPoint
import org.wordpress.android.R
import org.wordpress.android.WordPress
-import org.wordpress.android.analytics.AnalyticsTracker.Stat
import org.wordpress.android.databinding.StatsDetailActivityBinding
import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.fluxc.network.utils.StatsGranularity
@@ -19,7 +18,6 @@ import org.wordpress.android.ui.stats.refresh.StatsViewAllFragment
import org.wordpress.android.ui.stats.refresh.lists.StatsListFragment
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection
import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDateProvider.SelectedDate
-import org.wordpress.android.util.analytics.AnalyticsUtils
import org.wordpress.android.util.extensions.getSerializableCompat
import java.io.Serializable
import android.R as AndroidR
@@ -79,10 +77,6 @@ class StatsDetailActivity : LocaleAwareActivity() {
if (postUrl != null) {
statsPostViewIntent.putExtra(POST_URL, postUrl)
}
- AnalyticsUtils.trackWithSiteId(
- Stat.STATS_SINGLE_POST_ACCESSED,
- site.siteId
- )
context.startActivity(statsPostViewIntent)
}
diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/StatsDetailViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/StatsDetailViewModel.kt
index fbf2dd1203ec..553705b62d29 100644
--- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/StatsDetailViewModel.kt
+++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/detail/StatsDetailViewModel.kt
@@ -11,10 +11,13 @@ import org.wordpress.android.ui.jetpackoverlay.JetpackOverlayConnectedFeature
import org.wordpress.android.ui.pages.SnackbarMessageHolder
import org.wordpress.android.ui.stats.refresh.BLOCK_DETAIL_USE_CASE
import org.wordpress.android.ui.stats.refresh.lists.BaseListUseCase
+import org.wordpress.android.ui.stats.refresh.utils.StatsLaunchedFrom
import org.wordpress.android.ui.stats.refresh.utils.StatsPostProvider
import org.wordpress.android.ui.stats.refresh.utils.StatsSiteProvider
+import org.wordpress.android.ui.stats.refresh.utils.trackStatsAccessed
import org.wordpress.android.ui.utils.UiString.UiStringRes
import org.wordpress.android.util.NetworkUtilsWrapper
+import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import org.wordpress.android.util.mergeNotNull
import org.wordpress.android.viewmodel.Event
import org.wordpress.android.viewmodel.ScopedViewModel
@@ -28,6 +31,7 @@ class StatsDetailViewModel
private val statsSiteProvider: StatsSiteProvider,
private val statsPostProvider: StatsPostProvider,
private val networkUtilsWrapper: NetworkUtilsWrapper,
+ private val analyticsTrackerWrapper: AnalyticsTrackerWrapper,
private val jetpackFeatureRemovalOverlayUtil: JetpackFeatureRemovalOverlayUtil
) : ScopedViewModel(mainDispatcher) {
private val _isRefreshing = MutableLiveData