Skip to content

Commit

Permalink
Merge pull request #21474 from wordpress-mobile/issue/21409-mysite-me…
Browse files Browse the repository at this point in the history
…nu-accessibility

My site more menu button accessibility
  • Loading branch information
nbradbury authored Nov 21, 2024
2 parents f5fb546 + 035230f commit 47c0df2
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class ActivityCardViewHolder(
private fun MySiteCardToolbarBinding.update(card: ActivityCard.ActivityCardWithItems) {
uiHelpers.setTextOrHide(mySiteCardToolbarTitle, card.title)
mySiteCardToolbarMore.visibility = View.VISIBLE
mySiteCardToolbarMore.contentDescription =
itemView.context.getString(R.string.more_content_description_recent_activity)
mySiteCardToolbarMore.setOnClickListener {
showMoreMenu(
card.onHideMenuItemClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class PagesCardViewHolder(
private fun MySiteCardToolbarBinding.update(card: PagesCardWithData) {
uiHelpers.setTextOrHide(mySiteCardToolbarTitle, card.title)
mySiteCardToolbarMore.visibility = View.VISIBLE
mySiteCardToolbarMore.contentDescription = itemView.context.getString(R.string.more_content_description_pages)
mySiteCardToolbarMore.setOnClickListener {
showMoreMenu(
card.moreMenuOptionsLink.onMoreClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class PlansCardViewHolder(
fun bind(card: DashboardPlansCard) = with(binding) {
uiHelpers.setTextOrHide(dashboardCardPlansTitle, card.title)
dashboardCardPlansCta.setOnClickListener { card.onClick.click() }
dashboardPlansCardMore.contentDescription = itemView.context.getString(R.string.more_content_description_plans)
dashboardPlansCardMore.setOnClickListener {
showMoreMenu(
card.onHideMenuItemClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ sealed class PostCardViewHolder<T : ViewBinding>(
private fun MySiteCardToolbarBinding.update(card: PostCardWithPostItems) {
uiHelpers.setTextOrHide(mySiteCardToolbarTitle, card.title)
mySiteCardToolbarMore.visibility = View.VISIBLE
mySiteCardToolbarMore.contentDescription =
itemView.context.getString(R.string.more_content_description_posts)
mySiteCardToolbarMore.setOnClickListener {
showMoreMenu(card)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class TodaysStatsCardViewHolder(
private fun MySiteCardToolbarBinding.update(card: TodaysStatsCardWithData) {
uiHelpers.setTextOrHide(mySiteCardToolbarTitle, card.title)
mySiteCardToolbarMore.visibility = View.VISIBLE
mySiteCardToolbarMore.contentDescription =
mySiteCardToolbarTitle.context.getString(R.string.more_content_description_today_stats)
mySiteCardToolbarMore.setOnClickListener {
showMoreMenu(
card.moreMenuOptions.onMoreMenuClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class QuickStartCardViewHolder(
mySiteCardToolbar.visibility = View.VISIBLE
mySiteCardToolbarTitle.text = uiHelpers.getTextOfUiString(itemView.context, card.title)
mySiteCardToolbarMore.visibility = View.VISIBLE
mySiteCardToolbarMore.contentDescription =
itemView.context.getString(R.string.more_content_description_quick_start)
mySiteCardToolbarMore.setOnClickListener {
showQuickStartCardMenu(
card.moreMenuOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/content_description_more"
android:contentDescription="@string/more_content_description_blogging_prompts"
android:focusable="true"
android:src="@drawable/ic_more_vert_white_24dp"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/main/res/layout/promote_with_blaze_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/content_description_more"
android:contentDescription="@string/more_content_description_promote_blaze"
android:focusable="true"
android:src="@drawable/ic_more_vert_white_24dp"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
10 changes: 10 additions & 0 deletions WordPress/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2495,6 +2495,16 @@

<string name="jetpack_feature_card_more_menu_item_hide_this" translatable="false">@string/my_site_dashboard_card_more_menu_hide_card</string>

<!-- My Site - More menu button content descriptions -->
<string name="more_content_description_promote_blaze">Blaze more</string>
<string name="more_content_description_blogging_prompts">Prompts more</string>
<string name="more_content_description_today_stats">Today\'s stats more</string>
<string name="more_content_description_quick_start">Quick start more</string>
<string name="more_content_description_posts">Posts more</string>
<string name="more_content_description_pages">Pages more</string>
<string name="more_content_description_recent_activity">Recent activity more</string>
<string name="more_content_description_plans">Plans more</string>

<!-- My Site - Dashboard -->
<string name="my_site_dashboard_card_more_menu_hide_card">Hide this</string>

Expand Down

0 comments on commit 47c0df2

Please sign in to comment.