From f7fd9d75caa863167d753066baaac93613b69ce1 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Fri, 13 May 2022 06:02:02 +0530 Subject: [PATCH 01/11] Point to FluxC PR --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7dd8fcd3cc58..6fc9a9e957e3 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ ext { coroutinesVersion = '1.5.2' androidxWorkVersion = "2.7.0" - fluxCVersion = '2387-488b43a4d46df9f28ee5fdcc113aeaf7e48e5863' + fluxCVersion = '2395-2eaefd61cfb035c63fea13ec87cc6525abe22aa2' appCompatVersion = '1.0.2' coreVersion = '1.3.2' From d7e1cedcf7ac72154940a575adf7fa6cfd801f2c Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 12 May 2022 18:31:37 +0530 Subject: [PATCH 02/11] Add notifications bottom tab id for quick start --- .../java/org/wordpress/android/ui/main/WPMainNavigationView.kt | 3 +++ WordPress/src/main/res/values/ids.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainNavigationView.kt b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainNavigationView.kt index 3da67ea16e1e..7205bb9ca576 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainNavigationView.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainNavigationView.kt @@ -95,6 +95,9 @@ class WPMainNavigationView @JvmOverloads constructor( if (i == getPosition(READER)) { customView.id = R.id.bottom_nav_reader_button // identify view for QuickStart } + if (i == getPosition(NOTIFS)) { + customView.id = R.id.bottom_nav_notifications_button // identify view for QuickStart + } itemView.addView(customView) } diff --git a/WordPress/src/main/res/values/ids.xml b/WordPress/src/main/res/values/ids.xml index e9f9dbdb413c..f3535f0e5f30 100644 --- a/WordPress/src/main/res/values/ids.xml +++ b/WordPress/src/main/res/values/ids.xml @@ -14,6 +14,7 @@ + From e8e5eab8d4e9472504debd85c80da719739a7ce3 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 12 May 2022 18:30:51 +0530 Subject: [PATCH 03/11] Add message, icon resources for qs notifications task Also fixes R imports --- .../ui/quickstart/QuickStartMySitePrompts.kt | 7 ++ .../ui/quickstart/QuickStartNoticeDetails.kt | 47 ++++++------ .../ui/quickstart/QuickStartTaskDetails.kt | 75 ++++++++++--------- WordPress/src/main/res/values/strings.xml | 5 ++ 4 files changed, 78 insertions(+), 56 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartMySitePrompts.kt b/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartMySitePrompts.kt index eaba078ad016..6a173615d629 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartMySitePrompts.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartMySitePrompts.kt @@ -86,6 +86,13 @@ enum class QuickStartMySitePrompts constructor( R.id.quick_action_pages_button, R.string.quick_start_dialog_edit_homepage_message_short, R.drawable.ic_pages_white_24dp + ), + CHECK_NOTIFICATIONS( + QuickStartStore.QUICK_START_CHECK_NOTIFIATIONS_LABEL, + R.id.root_view_main, + R.id.bottom_nav_notifications_button, + R.string.quick_start_dialog_check_notifications_message_short, + R.drawable.ic_bell_white_24dp ); companion object { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartNoticeDetails.kt b/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartNoticeDetails.kt index 60f5ba6e726b..734218c3d05d 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartNoticeDetails.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartNoticeDetails.kt @@ -1,7 +1,7 @@ package org.wordpress.android.ui.quickstart import androidx.annotation.StringRes -import org.wordpress.android.R.string +import org.wordpress.android.R import org.wordpress.android.fluxc.store.QuickStartStore import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartTask @@ -15,53 +15,58 @@ enum class QuickStartNoticeDetails( ) { UPDATE_SITE_TITLE( QuickStartStore.QUICK_START_UPDATE_SITE_TITLE_LABEL, - string.quick_start_list_update_site_title_title, - string.quick_start_list_update_site_title_subtitle + R.string.quick_start_list_update_site_title_title, + R.string.quick_start_list_update_site_title_subtitle ), VIEW_SITE_TUTORIAL( QuickStartStore.QUICK_START_VIEW_SITE_LABEL, - string.quick_start_dialog_view_site_title, - string.quick_start_dialog_view_site_message + R.string.quick_start_dialog_view_site_title, + R.string.quick_start_dialog_view_site_message ), SHARE_SITE_TUTORIAL( QuickStartStore.QUICK_START_ENABLE_POST_SHARING_LABEL, - string.quick_start_dialog_share_site_title, - string.quick_start_dialog_share_site_message + R.string.quick_start_dialog_share_site_title, + R.string.quick_start_dialog_share_site_message ), PUBLISH_POST_TUTORIAL( QuickStartStore.QUICK_START_PUBLISH_POST_LABEL, - string.quick_start_dialog_publish_post_title, - string.quick_start_dialog_publish_post_message + R.string.quick_start_dialog_publish_post_title, + R.string.quick_start_dialog_publish_post_message ), FOLLOW_SITES_TUTORIAL( QuickStartStore.QUICK_START_FOLLOW_SITE_LABEL, - string.quick_start_dialog_follow_sites_title, - string.quick_start_dialog_follow_sites_message + R.string.quick_start_dialog_follow_sites_title, + R.string.quick_start_dialog_follow_sites_message ), UPLOAD_SITE_ICON( QuickStartStore.QUICK_START_UPLOAD_SITE_ICON_LABEL, - string.quick_start_dialog_upload_icon_title, - string.quick_start_dialog_upload_icon_message + R.string.quick_start_dialog_upload_icon_title, + R.string.quick_start_dialog_upload_icon_message ), CHECK_STATS( QuickStartStore.QUICK_START_CHECK_STATS_LABEL, - string.quick_start_dialog_check_stats_title, - string.quick_start_dialog_check_stats_message + R.string.quick_start_dialog_check_stats_title, + R.string.quick_start_dialog_check_stats_message ), EXPLORE_PLANS( QuickStartStore.QUICK_START_EXPLORE_PLANS_LABEL, - string.quick_start_dialog_explore_plans_title, - string.quick_start_dialog_explore_plans_message + R.string.quick_start_dialog_explore_plans_title, + R.string.quick_start_dialog_explore_plans_message ), EDIT_HOMEPAGE( QuickStartStore.QUICK_START_EDIT_HOMEPAGE_LABEL, - string.quick_start_dialog_edit_homepage_title, - string.quick_start_dialog_edit_homepage_message + R.string.quick_start_dialog_edit_homepage_title, + R.string.quick_start_dialog_edit_homepage_message ), REVIEW_PAGES( QuickStartStore.QUICK_START_REVIEW_PAGES_LABEL, - string.quick_start_dialog_review_pages_title, - string.quick_start_dialog_review_pages_message + R.string.quick_start_dialog_review_pages_title, + R.string.quick_start_dialog_review_pages_message + ), + CHECK_NOTIFICATIONS( + QuickStartStore.QUICK_START_CHECK_NOTIFIATIONS_LABEL, + R.string.quick_start_dialog_check_notifications_title, + R.string.quick_start_dialog_check_notifications_message ); companion object { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartTaskDetails.kt b/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartTaskDetails.kt index 2299f217879f..229b765525c6 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartTaskDetails.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/quickstart/QuickStartTaskDetails.kt @@ -2,8 +2,7 @@ package org.wordpress.android.ui.quickstart import androidx.annotation.DrawableRes import androidx.annotation.StringRes -import org.wordpress.android.R.drawable -import org.wordpress.android.R.string +import org.wordpress.android.R import org.wordpress.android.fluxc.store.QuickStartStore import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartTask @@ -18,69 +17,75 @@ enum class QuickStartTaskDetails( ) { CREATE_SITE_TUTORIAL( QuickStartStore.QUICK_START_CREATE_SITE_LABEL, - string.quick_start_list_create_site_title, - string.quick_start_list_create_site_subtitle, - drawable.ic_gridicons_site_white_24dp + R.string.quick_start_list_create_site_title, + R.string.quick_start_list_create_site_subtitle, + R.drawable.ic_gridicons_site_white_24dp ), UPDATE_SITE_TITLE( QuickStartStore.QUICK_START_UPDATE_SITE_TITLE_LABEL, - string.quick_start_list_update_site_title_title, - string.quick_start_list_update_site_title_subtitle, - drawable.ic_pencil_white_24dp + R.string.quick_start_list_update_site_title_title, + R.string.quick_start_list_update_site_title_subtitle, + R.drawable.ic_pencil_white_24dp ), VIEW_SITE_TUTORIAL( QuickStartStore.QUICK_START_VIEW_SITE_LABEL, - string.quick_start_list_view_site_title, - string.quick_start_list_view_site_subtitle, - drawable.ic_external_white_24dp + R.string.quick_start_list_view_site_title, + R.string.quick_start_list_view_site_subtitle, + R.drawable.ic_external_white_24dp ), SHARE_SITE_TUTORIAL( QuickStartStore.QUICK_START_ENABLE_POST_SHARING_LABEL, - string.quick_start_list_enable_sharing_title, - string.quick_start_list_enable_sharing_subtitle, - drawable.ic_share_white_24dp + R.string.quick_start_list_enable_sharing_title, + R.string.quick_start_list_enable_sharing_subtitle, + R.drawable.ic_share_white_24dp ), PUBLISH_POST_TUTORIAL( QuickStartStore.QUICK_START_PUBLISH_POST_LABEL, - string.quick_start_list_publish_post_title, - string.quick_start_list_publish_post_subtitle, - drawable.ic_posts_white_24dp + R.string.quick_start_list_publish_post_title, + R.string.quick_start_list_publish_post_subtitle, + R.drawable.ic_posts_white_24dp ), FOLLOW_SITES_TUTORIAL( QuickStartStore.QUICK_START_FOLLOW_SITE_LABEL, - string.quick_start_list_follow_site_title, - string.quick_start_list_follow_site_subtitle, - drawable.ic_reader_white_24dp + R.string.quick_start_list_follow_site_title, + R.string.quick_start_list_follow_site_subtitle, + R.drawable.ic_reader_white_24dp ), UPLOAD_SITE_ICON( QuickStartStore.QUICK_START_UPLOAD_SITE_ICON_LABEL, - string.quick_start_list_upload_icon_title, - string.quick_start_list_upload_icon_subtitle, - drawable.ic_globe_white_24dp + R.string.quick_start_list_upload_icon_title, + R.string.quick_start_list_upload_icon_subtitle, + R.drawable.ic_globe_white_24dp ), CHECK_STATS( QuickStartStore.QUICK_START_CHECK_STATS_LABEL, - string.quick_start_list_check_stats_title, - string.quick_start_list_check_stats_subtitle, - drawable.ic_stats_alt_white_24dp + R.string.quick_start_list_check_stats_title, + R.string.quick_start_list_check_stats_subtitle, + R.drawable.ic_stats_alt_white_24dp ), EXPLORE_PLANS( QuickStartStore.QUICK_START_EXPLORE_PLANS_LABEL, - string.quick_start_list_explore_plans_title, - string.quick_start_list_explore_plans_subtitle, - drawable.ic_plans_white_24dp + R.string.quick_start_list_explore_plans_title, + R.string.quick_start_list_explore_plans_subtitle, + R.drawable.ic_plans_white_24dp ), EDIT_HOMEPAGE( QuickStartStore.QUICK_START_EDIT_HOMEPAGE_LABEL, - string.quick_start_list_edit_homepage_title, - string.quick_start_list_edit_homepage_subtitle, - drawable.ic_homepage_16dp + R.string.quick_start_list_edit_homepage_title, + R.string.quick_start_list_edit_homepage_subtitle, + R.drawable.ic_homepage_16dp ), REVIEW_PAGES( QuickStartStore.QUICK_START_REVIEW_PAGES_LABEL, - string.quick_start_list_review_pages_title, - string.quick_start_list_review_pages_subtitle, - drawable.ic_pages_white_24dp + R.string.quick_start_list_review_pages_title, + R.string.quick_start_list_review_pages_subtitle, + R.drawable.ic_pages_white_24dp + ), + CHECK_NOTIFICATIONS( + QuickStartStore.QUICK_START_CHECK_NOTIFIATIONS_LABEL, + R.string.quick_start_list_check_notification_title, + R.string.quick_start_list_check_notification_subtitle, + R.drawable.ic_bell_white_24dp ); companion object { diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index c01c632cf9a6..497bdad22ed8 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -3094,8 +3094,11 @@ Edit your homepage Change, add, or remove content from your site\'s homepage. Select %1$s Pages %2$s to see your page list. + Select the %1$s Notifications tab %2$s to get updates on the go. Select %1$s Homepage %2$s to edit your Homepage. Review site pages + Check your notifications + Get real time updates from your pocket. Change, add, or remove your site\'s pages. Select %1$s Pages %2$s to see your page list. Complete (%d) @@ -3122,6 +3125,8 @@ @string/quick_start_dialog_edit_homepage_title Check your pages and make changes, or add or remove pages. @string/quick_start_dialog_review_pages_title + Get real time updates from your pocket + @string/quick_start_dialog_check_notifications_title Next Steps Customize your site Grow your audience From f162b132c58841f0d67b91fafc7c1d53759c4ca5 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 12 May 2022 18:59:30 +0530 Subject: [PATCH 04/11] Add tracking and placeholder illustration for as notifications task --- .../dynamiccards/quickstart/QuickStartItemBuilder.kt | 2 ++ .../java/org/wordpress/android/util/QuickStartUtils.kt | 4 ++++ .../org/wordpress/android/analytics/AnalyticsTracker.java | 3 +++ .../android/analytics/AnalyticsTrackerNosara.java | 8 ++++++++ 4 files changed, 17 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/dynamiccards/quickstart/QuickStartItemBuilder.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/dynamiccards/quickstart/QuickStartItemBuilder.kt index 552b4e80f382..0e4372ec49cd 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/dynamiccards/quickstart/QuickStartItemBuilder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/dynamiccards/quickstart/QuickStartItemBuilder.kt @@ -126,6 +126,8 @@ class QuickStartItemBuilder QuickStartStore.QUICK_START_EXPLORE_PLANS_LABEL -> R.drawable.img_illustration_quick_start_task_explore_plans QuickStartStore.QUICK_START_CREATE_SITE_LABEL -> R.drawable.img_illustration_quick_start_task_create_site + QuickStartStore.QUICK_START_CHECK_NOTIFIATIONS_LABEL -> + R.drawable.img_illustration_quick_start_task_placeholder else -> R.drawable.img_illustration_quick_start_task_placeholder } } diff --git a/WordPress/src/main/java/org/wordpress/android/util/QuickStartUtils.kt b/WordPress/src/main/java/org/wordpress/android/util/QuickStartUtils.kt index e1b18d1d395a..810ca67e56b0 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/QuickStartUtils.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/QuickStartUtils.kt @@ -200,6 +200,7 @@ object QuickStartUtils { QuickStartStore.QUICK_START_EXPLORE_PLANS_LABEL -> Stat.QUICK_START_LIST_EXPLORE_PLANS_TAPPED QuickStartStore.QUICK_START_EDIT_HOMEPAGE_LABEL -> Stat.QUICK_START_LIST_EDIT_HOMEPAGE_TAPPED QuickStartStore.QUICK_START_REVIEW_PAGES_LABEL -> Stat.QUICK_START_LIST_REVIEW_PAGES_TAPPED + QuickStartStore.QUICK_START_CHECK_NOTIFIATIONS_LABEL -> Stat.QUICK_START_LIST_CHECK_NOTIFICATIONS_TAPPED else -> throw IllegalStateException("The task '$task' is not valid") } } @@ -221,6 +222,7 @@ object QuickStartUtils { QuickStartStore.QUICK_START_EXPLORE_PLANS_LABEL -> Stat.QUICK_START_LIST_EXPLORE_PLANS_SKIPPED QuickStartStore.QUICK_START_EDIT_HOMEPAGE_LABEL -> Stat.QUICK_START_LIST_EDIT_HOMEPAGE_SKIPPED QuickStartStore.QUICK_START_REVIEW_PAGES_LABEL -> Stat.QUICK_START_LIST_REVIEW_PAGES_SKIPPED + QuickStartStore.QUICK_START_CHECK_NOTIFIATIONS_LABEL -> Stat.QUICK_START_LIST_CHECK_NOTIFICATIONS_SKIPPED else -> throw IllegalStateException("The task '$task' is not valid") } } @@ -238,6 +240,8 @@ object QuickStartUtils { QuickStartStore.QUICK_START_EXPLORE_PLANS_LABEL -> Stat.QUICK_START_EXPLORE_PLANS_COMPLETED QuickStartStore.QUICK_START_EDIT_HOMEPAGE_LABEL -> Stat.QUICK_START_EDIT_HOMEPAGE_TASK_COMPLETED QuickStartStore.QUICK_START_REVIEW_PAGES_LABEL -> Stat.QUICK_START_REVIEW_PAGES_TASK_COMPLETED + QuickStartStore.QUICK_START_CHECK_NOTIFIATIONS_LABEL -> + Stat.QUICK_START_CHECK_NOTIFICATIONS_TASK_COMPLETED else -> throw IllegalStateException("The task '$task' is not valid") } } diff --git a/libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java b/libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java index dcf7589bc47b..271a239e9fcf 100644 --- a/libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java +++ b/libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java @@ -649,6 +649,7 @@ public enum Stat { QUICK_START_LIST_EXPLORE_PLANS_SKIPPED, QUICK_START_LIST_EDIT_HOMEPAGE_SKIPPED, QUICK_START_LIST_REVIEW_PAGES_SKIPPED, + QUICK_START_LIST_CHECK_NOTIFICATIONS_SKIPPED, QUICK_START_LIST_CREATE_SITE_TAPPED, QUICK_START_LIST_UPDATE_SITE_TITLE_TAPPED, QUICK_START_LIST_VIEW_SITE_TAPPED, @@ -660,6 +661,7 @@ public enum Stat { QUICK_START_LIST_EXPLORE_PLANS_TAPPED, QUICK_START_LIST_EDIT_HOMEPAGE_TAPPED, QUICK_START_LIST_REVIEW_PAGES_TAPPED, + QUICK_START_LIST_CHECK_NOTIFICATIONS_TAPPED, QUICK_START_CREATE_SITE_TASK_COMPLETED, QUICK_START_UPDATE_SITE_TITLE_COMPLETED, QUICK_START_VIEW_SITE_TASK_COMPLETED, @@ -671,6 +673,7 @@ public enum Stat { QUICK_START_EXPLORE_PLANS_COMPLETED, QUICK_START_EDIT_HOMEPAGE_TASK_COMPLETED, QUICK_START_REVIEW_PAGES_TASK_COMPLETED, + QUICK_START_CHECK_NOTIFICATIONS_TASK_COMPLETED, QUICK_START_ALL_TASKS_COMPLETED, QUICK_START_REQUEST_VIEWED, QUICK_START_REQUEST_DIALOG_NEGATIVE_TAPPED, diff --git a/libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java b/libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java index b8dff7dc56b9..2ba1b66341a1 100644 --- a/libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java +++ b/libs/analytics/WordPressAnalytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java @@ -411,6 +411,11 @@ public void track(AnalyticsTracker.Stat stat, Map properties) { case QUICK_START_REVIEW_PAGES_TASK_COMPLETED: predefinedEventProperties.put("task_name", "review_pages"); break; + case QUICK_START_LIST_CHECK_NOTIFICATIONS_SKIPPED: + case QUICK_START_LIST_CHECK_NOTIFICATIONS_TAPPED: + case QUICK_START_CHECK_NOTIFICATIONS_TASK_COMPLETED: + predefinedEventProperties.put("task_name", "check_notifications"); + break; case QUICK_START_REQUEST_DIALOG_NEGATIVE_TAPPED: predefinedEventProperties.put("type", "negative"); break; @@ -1832,6 +1837,7 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) { case QUICK_START_LIST_EXPLORE_PLANS_SKIPPED: case QUICK_START_LIST_EDIT_HOMEPAGE_SKIPPED: case QUICK_START_LIST_REVIEW_PAGES_SKIPPED: + case QUICK_START_LIST_CHECK_NOTIFICATIONS_SKIPPED: return "quick_start_list_item_skipped"; case QUICK_START_LIST_CREATE_SITE_TAPPED: case QUICK_START_LIST_UPDATE_SITE_TITLE_TAPPED: @@ -1844,6 +1850,7 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) { case QUICK_START_LIST_EXPLORE_PLANS_TAPPED: case QUICK_START_LIST_EDIT_HOMEPAGE_TAPPED: case QUICK_START_LIST_REVIEW_PAGES_TAPPED: + case QUICK_START_LIST_CHECK_NOTIFICATIONS_TAPPED: return "quick_start_list_item_tapped"; case QUICK_START_CREATE_SITE_TASK_COMPLETED: case QUICK_START_UPDATE_SITE_TITLE_COMPLETED: @@ -1856,6 +1863,7 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) { case QUICK_START_EXPLORE_PLANS_COMPLETED: case QUICK_START_EDIT_HOMEPAGE_TASK_COMPLETED: case QUICK_START_REVIEW_PAGES_TASK_COMPLETED: + case QUICK_START_CHECK_NOTIFICATIONS_TASK_COMPLETED: return "quick_start_task_completed"; case QUICK_START_ALL_TASKS_COMPLETED: return "quick_start_all_tasks_completed"; From ab995145bbb001d5af9ac22d0fb1f324c2301613 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 12 May 2022 19:16:25 +0530 Subject: [PATCH 05/11] Add external point info for qs notifications task --- .../android/viewmodel/main/WPMainActivityViewModel.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt index 0b16b7e67354..5f3a928b72ea 100644 --- a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt @@ -10,6 +10,7 @@ import org.wordpress.android.analytics.AnalyticsTracker.Stat import org.wordpress.android.fluxc.model.SiteModel import org.wordpress.android.fluxc.store.AccountStore import org.wordpress.android.fluxc.store.QuickStartStore +import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartExistingSiteTask import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartNewSiteTask.PUBLISH_POST import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartTask import org.wordpress.android.fluxc.store.SiteStore @@ -364,7 +365,11 @@ class WPMainActivityViewModel @Inject constructor( val followSiteTask = quickStartRepository.quickStartType .getTaskFromString(QuickStartStore.QUICK_START_FOLLOW_SITE_LABEL) val followSitesTaskFocusPointInfo = FocusPointInfo(followSiteTask, task == followSiteTask) - return listOf(followSitesTaskFocusPointInfo) + val checkNotifsTaskFocusPointInfo = FocusPointInfo( + QuickStartExistingSiteTask.CHECK_NOTIFICATIONS, + task == QuickStartExistingSiteTask.CHECK_NOTIFICATIONS + ) + return listOf(followSitesTaskFocusPointInfo, checkNotifsTaskFocusPointInfo) } fun handleSiteRemoved() { From 65bd266d8cd85a17441a6a83b1b7128eec4230d6 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Thu, 12 May 2022 19:30:06 +0530 Subject: [PATCH 06/11] Complete qs notifications task on tab click --- .../java/org/wordpress/android/ui/main/WPMainActivity.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 4d2e34792018..41cc9fa043dd 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 @@ -51,6 +51,7 @@ import org.wordpress.android.fluxc.store.PostStore; import org.wordpress.android.fluxc.store.PostStore.OnPostUploaded; import org.wordpress.android.fluxc.store.QuickStartStore; +import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartExistingSiteTask; import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartNewSiteTask; import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartTask; import org.wordpress.android.fluxc.store.SiteStore; @@ -966,6 +967,12 @@ public void onPageChanged(int position) { mQuickStartRepository.requestNextStepOfTask(followSiteTask); } + if (pageType == PageType.NOTIFS) { + // MySite fragment might not be attached to activity, so we need to remove focus point from here + QuickStartUtils.removeQuickStartFocusPoint(findViewById(R.id.root_view_main)); + mQuickStartRepository.completeTask(QuickStartExistingSiteTask.CHECK_NOTIFICATIONS); + } + mViewModel.onPageChanged( mSiteStore.hasSite() && pageType == PageType.MY_SITE, getSelectedSite() From 570d590f632ec3394b7c018779cff11600267858 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Fri, 13 May 2022 07:19:48 +0530 Subject: [PATCH 07/11] Tests: Fix existing tests --- .../main/WPMainActivityViewModelTest.kt | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt index 76a2af812d1e..13c46477cc00 100644 --- a/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt @@ -24,6 +24,7 @@ import org.wordpress.android.analytics.AnalyticsTracker.Stat.FEATURE_ANNOUNCEMEN import org.wordpress.android.fluxc.model.SiteModel import org.wordpress.android.fluxc.store.AccountStore import org.wordpress.android.fluxc.store.QuickStartStore +import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartExistingSiteTask.CHECK_NOTIFICATIONS import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartNewSiteTask.FOLLOW_SITE import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartNewSiteTask.PUBLISH_POST import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartNewSiteTask.UPDATE_SITE_TITLE @@ -675,21 +676,27 @@ class WPMainActivityViewModelTest : BaseUnitTest() { fun `when the active task needs to show an focus point, emit visible focus point info`() { activeTask.value = FOLLOW_SITE - assertThat(externalFocusPointEvents).containsExactly(listOf(visibleFollowSiteFocusPointInfo)) + assertThat(externalFocusPointEvents).containsExactly( + listOf(visibleFollowSiteFocusPointInfo, invisibleCheckNotificationsFocusPointInfo) + ) } @Test fun `when the active task doesn't need to show an external focus point, emit invisible focus point info`() { activeTask.value = VIEW_SITE - assertThat(externalFocusPointEvents).containsExactly(listOf(invisibleFollowSiteFocusPointInfo)) + assertThat(externalFocusPointEvents).containsExactly( + listOf(invisibleFollowSiteFocusPointInfo, invisibleCheckNotificationsFocusPointInfo) + ) } @Test fun `when the active task is null, emit invisible focus point info`() { activeTask.value = null - assertThat(externalFocusPointEvents).containsExactly(listOf(invisibleFollowSiteFocusPointInfo)) + assertThat(externalFocusPointEvents).containsExactly( + listOf(invisibleFollowSiteFocusPointInfo, invisibleCheckNotificationsFocusPointInfo) + ) } @Test @@ -701,9 +708,9 @@ class WPMainActivityViewModelTest : BaseUnitTest() { activeTask.value = FOLLOW_SITE assertThat(externalFocusPointEvents).containsExactly( - listOf(visibleFollowSiteFocusPointInfo), - listOf(invisibleFollowSiteFocusPointInfo), - listOf(visibleFollowSiteFocusPointInfo) + listOf(visibleFollowSiteFocusPointInfo, invisibleCheckNotificationsFocusPointInfo), + listOf(invisibleFollowSiteFocusPointInfo, invisibleCheckNotificationsFocusPointInfo), + listOf(visibleFollowSiteFocusPointInfo, invisibleCheckNotificationsFocusPointInfo) ) } @@ -803,5 +810,7 @@ class WPMainActivityViewModelTest : BaseUnitTest() { companion object { val visibleFollowSiteFocusPointInfo = FocusPointInfo(FOLLOW_SITE, true) val invisibleFollowSiteFocusPointInfo = FocusPointInfo(FOLLOW_SITE, false) + + val invisibleCheckNotificationsFocusPointInfo = FocusPointInfo(CHECK_NOTIFICATIONS, false) } } From 42f67b897088c14a84527462f172179518cc5db3 Mon Sep 17 00:00:00 2001 From: ashiagr Date: Fri, 13 May 2022 07:48:53 +0530 Subject: [PATCH 08/11] Tests: Add test for check notifications focus point --- .../viewmodel/main/WPMainActivityViewModelTest.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt index 13c46477cc00..ff4d4cd11870 100644 --- a/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModelTest.kt @@ -673,7 +673,7 @@ class WPMainActivityViewModelTest : BaseUnitTest() { } @Test - fun `when the active task needs to show an focus point, emit visible focus point info`() { + fun `when follow site is active task, then only follow site visible focus point shown`() { activeTask.value = FOLLOW_SITE assertThat(externalFocusPointEvents).containsExactly( @@ -681,6 +681,15 @@ class WPMainActivityViewModelTest : BaseUnitTest() { ) } + @Test + fun `when check notifications is active task, then only check notifications visible focus point shown`() { + activeTask.value = CHECK_NOTIFICATIONS + + assertThat(externalFocusPointEvents).containsExactly( + listOf(invisibleFollowSiteFocusPointInfo, visibleCheckNotificationsFocusPointInfo) + ) + } + @Test fun `when the active task doesn't need to show an external focus point, emit invisible focus point info`() { activeTask.value = VIEW_SITE @@ -811,6 +820,7 @@ class WPMainActivityViewModelTest : BaseUnitTest() { val visibleFollowSiteFocusPointInfo = FocusPointInfo(FOLLOW_SITE, true) val invisibleFollowSiteFocusPointInfo = FocusPointInfo(FOLLOW_SITE, false) + val visibleCheckNotificationsFocusPointInfo = FocusPointInfo(CHECK_NOTIFICATIONS, true) val invisibleCheckNotificationsFocusPointInfo = FocusPointInfo(CHECK_NOTIFICATIONS, false) } } From 3896eb1a722e599e8b39fb547078734eb7de7fcc Mon Sep 17 00:00:00 2001 From: ashiagr Date: Fri, 13 May 2022 12:10:30 +0530 Subject: [PATCH 09/11] Suppress unrelated detekt max line issue Suppressed at file level as unable to suppress it at function level possibly due to detekt issue #1667 --- .../wordpress/android/viewmodel/main/WPMainActivityViewModel.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt index 5f3a928b72ea..13b36d9e4071 100644 --- a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt @@ -1,3 +1,4 @@ +@file:Suppress("MaximumLineLength") package org.wordpress.android.viewmodel.main import androidx.lifecycle.LiveData From 49d11a1464616a858bee0030a6cdd1debc23cd2a Mon Sep 17 00:00:00 2001 From: ashiagr Date: Fri, 13 May 2022 15:28:13 +0530 Subject: [PATCH 10/11] Remove comment which is not relevant now --- .../wordpress/android/viewmodel/main/WPMainActivityViewModel.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt index 13b36d9e4071..4818a504074d 100644 --- a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt @@ -362,7 +362,6 @@ class WPMainActivityViewModel @Inject constructor( } private fun getExternalFocusPointInfo(task: QuickStartTask?): List { - // For now, we only do this for the FOLLOW_SITE task. val followSiteTask = quickStartRepository.quickStartType .getTaskFromString(QuickStartStore.QUICK_START_FOLLOW_SITE_LABEL) val followSitesTaskFocusPointInfo = FocusPointInfo(followSiteTask, task == followSiteTask) From da89b844d49622930cca0c9e78fa7fc34941d08a Mon Sep 17 00:00:00 2001 From: ashiagr Date: Fri, 13 May 2022 15:30:54 +0530 Subject: [PATCH 11/11] Update FluxC version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2d951493e432..baa1e41934e6 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ ext { coroutinesVersion = '1.5.2' androidxWorkVersion = "2.7.0" - fluxCVersion = '2395-2eaefd61cfb035c63fea13ec87cc6525abe22aa2' + fluxCVersion = 'trunk-b1d4cb198c9c57cd80594171227dae5c96e58d56' appCompatVersion = '1.0.2' coreVersion = '1.3.2'