Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements: the QuickStartFocus Point in more menu #19282

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
79748d6
- Removes: QuickStartExistingUsersV2FeatureConfig.kt
AjeshRPai Sep 29, 2023
8b17f18
- Removes: QuickStartExistingUsersV2FeatureConfig from tests
AjeshRPai Sep 29, 2023
190caf9
- Removes: MySiteDashboardTabsFeatureConfig.kt from tests and gradle
AjeshRPai Sep 29, 2023
929b7e4
+ Adds: logic to set the quick start item in quick link items
AjeshRPai Sep 29, 2023
5c21129
+ Adds: the list item action as an identifier for quick start check
AjeshRPai Sep 29, 2023
55d4c12
+ Adds: the logic to show quick start focus point in quick links
AjeshRPai Sep 29, 2023
b3cce70
- Removes: MySiteTabsFeatureFlag from build wrappper
AjeshRPai Sep 29, 2023
de0b66d
↑ Updates: the padding and spacing in Quick links
AjeshRPai Sep 29, 2023
2e7427d
+ Adds: disable tint attribute
AjeshRPai Sep 29, 2023
92d167e
* Fixes: RTL for quick links
AjeshRPai Sep 29, 2023
dd2c347
+ Adds: Quick link build logic when there is a site change
AjeshRPai Sep 29, 2023
593ecb1
+ Adds: Quick link build logic when there is a site change
AjeshRPai Sep 29, 2023
2d13876
+ Adds: the logic for OnResume refresh of MySiteViewModel
AjeshRPai Sep 29, 2023
08a7986
↑ Updates: the naming of quick link ribbon to item
AjeshRPai Sep 29, 2023
4919f98
* Fixes: Lint error
AjeshRPai Sep 29, 2023
fbe587a
* Fixes: the logic of showing more quick start focus point
AjeshRPai Sep 29, 2023
53a7d25
* Fixes: the logic of fetching the quick links for empty site
AjeshRPai Sep 29, 2023
c853016
* Fixes: the failing unit tests
AjeshRPai Sep 29, 2023
15634ea
* Fixes: quick start check for get to know old quick start task - stats
AjeshRPai Sep 29, 2023
beb7199
[WIP] Temporarily turn off LoginTest so progress can continue
zwarm Sep 29, 2023
278d711
[WIP] Temporarily turn off SingupTest so progress can continue
zwarm Sep 29, 2023
369e309
Refactor: Adjust uiModel state to build if cards is null
zwarm Sep 29, 2023
96fbfa6
Re-enable tests
zwarm Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,13 @@ android {
buildConfigField "boolean", "GLOBAL_STYLE_SUPPORT", "true"
buildConfigField "boolean", "QUICK_START_DYNAMIC_CARDS", "false"
buildConfigField "boolean", "RECOMMEND_THE_APP", "false"
buildConfigField "boolean", "MY_SITE_DASHBOARD_TABS", "false"
buildConfigField "boolean", "UNIFIED_COMMENTS_DETAILS", "false"
buildConfigField "boolean", "COMMENTS_SNIPPET", "false"
buildConfigField "boolean", "READER_COMMENTS_MODERATION", "false"
buildConfigField "boolean", "SITE_INTENT_QUESTION", "true"
buildConfigField "boolean", "SITE_NAME", "false"
buildConfigField "boolean", "LANDING_SCREEN_REVAMP", "true"
buildConfigField "boolean", "LAND_ON_THE_EDITOR", "false"
buildConfigField "boolean", "QUICK_START_EXISTING_USERS_V2", "false"
buildConfigField "boolean", "QRCODE_AUTH_FLOW", "false"
buildConfigField "boolean", "BETA_SITE_DESIGNS", "false"
buildConfigField "boolean", "JETPACK_POWERED", "true"
Expand Down Expand Up @@ -154,7 +152,6 @@ android {
buildConfigField "boolean", "ENABLE_CREATE_FAB", "true"
buildConfigField "boolean", "ENABLE_FOLLOWED_SITES_SETTINGS", "true"
buildConfigField "boolean", "ENABLE_WHATS_NEW_FEATURE", "true"
buildConfigField "boolean", "ENABLE_MY_SITE_DASHBOARD_TABS", "true"
buildConfigField "boolean", "ENABLE_QRCODE_AUTH_FLOW", "true"
buildConfigField "boolean", "ENABLE_OPEN_WEB_LINKS_WITH_JP_FLOW", "true"
buildConfigField "boolean", "BLAZE_MANAGE_CAMPAIGNS", "false"
Expand Down Expand Up @@ -201,7 +198,6 @@ android {
buildConfigField "boolean", "ENABLE_CREATE_FAB", "true"
buildConfigField "boolean", "ENABLE_FOLLOWED_SITES_SETTINGS", "true"
buildConfigField "boolean", "ENABLE_WHATS_NEW_FEATURE", "true"
buildConfigField "boolean", "ENABLE_MY_SITE_DASHBOARD_TABS", "true"
buildConfigField "String", "TRACKS_EVENT_PREFIX", '"jpandroid_"'
buildConfigField "String", "PUSH_NOTIFICATIONS_APP_KEY", '"com.jetpack.android"'
buildConfigField "boolean", "ENABLE_QRCODE_AUTH_FLOW", "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import kotlinx.coroutines.launch
import org.wordpress.android.modules.BG_THREAD
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BloggingPromptCard
import org.wordpress.android.ui.mysite.cards.dashboard.bloggingprompts.BloggingPromptsCardAnalyticsTracker
import org.wordpress.android.ui.mysite.tabs.MySiteTabType
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference
import javax.inject.Inject
Expand Down Expand Up @@ -63,13 +62,8 @@ class BloggingPromptsCardTrackHelper @Inject constructor(
}
}

fun onResume(currentTab: MySiteTabType) {
if (currentTab == MySiteTabType.DASHBOARD) {
onDashboardRefreshed()
} else {
// moved away from dashboard, no longer waiting to track
waitingToTrack.set(false)
}
fun onResume() {
onDashboardRefreshed()
}

fun onSiteChanged(siteId: Int?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.ListAdapter
import org.wordpress.android.fluxc.store.AccountStore
import org.wordpress.android.ui.main.utils.MeGravatarLoader
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ActivityCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BlazeCard.BlazeCampaignsCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BlazeCard.PromoteWithBlazeCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BloggingPromptCard.BloggingPromptCardWithData
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DashboardPlansCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DomainRegistrationCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DomainTransferCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ErrorCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ErrorWithinCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.JetpackFeatureCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.JetpackInstallFullPluginCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.JetpackSwitchMenu
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickLinkRibbon
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickStartCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PagesCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PersonalizeCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PostCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickLinksItem
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickStartCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.TodaysStatsCard.TodaysStatsCardWithData
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.CategoryEmptyHeaderItem
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.CategoryHeaderItem
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.InfoItem
Expand All @@ -36,7 +47,7 @@ import org.wordpress.android.ui.mysite.cards.jetpackfeature.SwitchToJetpackMenuC
import org.wordpress.android.ui.mysite.cards.jpfullplugininstall.JetpackInstallFullPluginCardViewHolder
import org.wordpress.android.ui.mysite.cards.nocards.NoCardsMessageViewHolder
import org.wordpress.android.ui.mysite.cards.personalize.PersonalizeCardViewHolder
import org.wordpress.android.ui.mysite.cards.quicklinksribbon.QuickLinkRibbonViewHolder
import org.wordpress.android.ui.mysite.cards.quicklinksitem.QuickLinkRibbonViewHolder
import org.wordpress.android.ui.mysite.cards.quickstart.QuickStartCardViewHolder
import org.wordpress.android.ui.mysite.items.categoryheader.MySiteCategoryItemEmptyViewHolder
import org.wordpress.android.ui.mysite.items.categoryheader.MySiteCategoryItemViewHolder
Expand All @@ -47,17 +58,6 @@ import org.wordpress.android.ui.mysite.jetpackbadge.MySiteJetpackBadgeViewHolder
import org.wordpress.android.ui.utils.UiHelpers
import org.wordpress.android.util.HtmlCompatWrapper
import org.wordpress.android.util.image.ImageManager
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ActivityCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BlazeCard.BlazeCampaignsCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BlazeCard.PromoteWithBlazeCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BloggingPromptCard.BloggingPromptCardWithData
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DashboardPlansCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DomainTransferCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ErrorCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ErrorWithinCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PagesCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PostCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.TodaysStatsCard.TodaysStatsCardWithData

@Suppress("LongParameterList")
class MySiteAdapter(
Expand Down Expand Up @@ -127,7 +127,7 @@ class MySiteAdapter(
@Suppress("ComplexMethod")
override fun onBindViewHolder(holder: MySiteCardAndItemViewHolder<*>, position: Int) {
when (holder) {
is QuickLinkRibbonViewHolder -> holder.bind(getItem(position) as QuickLinkRibbon)
is QuickLinkRibbonViewHolder -> holder.bind(getItem(position) as QuickLinksItem)
is DomainRegistrationViewHolder -> holder.bind(getItem(position) as DomainRegistrationCard)
is QuickStartCardViewHolder -> holder.bind(getItem(position) as QuickStartCard)
is MySiteInfoItemViewHolder -> holder.bind(getItem(position) as InfoItem)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
package org.wordpress.android.ui.mysite

import androidx.recyclerview.widget.DiffUtil
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ActivityCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BlazeCard.BlazeCampaignsCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BlazeCard.PromoteWithBlazeCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BloggingPromptCard.BloggingPromptCardWithData
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DashboardPlansCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DomainRegistrationCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DomainTransferCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ErrorCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ErrorWithinCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.JetpackFeatureCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.JetpackInstallFullPluginCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickLinkRibbon
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickStartCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.JetpackSwitchMenu
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PagesCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PersonalizeCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.CategoryHeaderItem
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PostCard.PostCardWithPostItems
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickLinksItem
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickStartCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.TodaysStatsCard.TodaysStatsCardWithData
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.CategoryEmptyHeaderItem
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.CategoryHeaderItem
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.InfoItem
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.ListItem
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Item.SingleActionCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.JetpackBadge
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ActivityCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DomainTransferCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.DashboardPlansCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BlazeCard.PromoteWithBlazeCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BlazeCard.BlazeCampaignsCardModel
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BloggingPromptCard.BloggingPromptCardWithData
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ErrorCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.ErrorWithinCard
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PostCard.PostCardWithPostItems
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.TodaysStatsCard.TodaysStatsCardWithData
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.PagesCard

@Suppress("ComplexMethod")
object MySiteAdapterDiffCallback : DiffUtil.ItemCallback<MySiteCardAndItem>() {
override fun areItemsTheSame(oldItem: MySiteCardAndItem, updatedItem: MySiteCardAndItem): Boolean {
return oldItem.type == updatedItem.type && when {
oldItem is QuickLinkRibbon && updatedItem is QuickLinkRibbon -> true
oldItem is QuickLinksItem && updatedItem is QuickLinksItem -> true
oldItem is DomainRegistrationCard && updatedItem is DomainRegistrationCard -> true
oldItem is QuickStartCard && updatedItem is QuickStartCard -> true
oldItem is InfoItem && updatedItem is InfoItem -> oldItem.title == updatedItem.title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,17 @@ sealed class MySiteCardAndItem(open val type: Type, open val activeQuickStartIte
override val type: Type,
override val activeQuickStartItem: Boolean = false
) : MySiteCardAndItem(type, activeQuickStartItem) {
data class QuickLinkRibbon(
val quickLinkRibbonItems: List<QuickLinkRibbonItem>,
data class QuickLinksItem(
val quickLinkItems: List<QuickLinkItem>,
val showMoreFocusPoint : Boolean = false
) : Card(
QUICK_LINK_RIBBON,
activeQuickStartItem = showMoreFocusPoint
) {
data class QuickLinkRibbonItem(
data class QuickLinkItem(
val label: UiString.UiStringRes,
@DrawableRes val icon: Int,
val disableTint: Boolean = false,
val onClick: ListItemInteraction,
val showFocusPoint: Boolean = false
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ class MySiteFragment : Fragment(R.layout.my_site_fragment),
}
}

override fun onResume() {
super.onResume()
viewModel.onResume()
}

override fun onDestroyView() {
super.onDestroyView()
binding = null
Expand Down
Loading