Bug 1399294: Add contentDescription for pinned top sites. r=liuche
Since this is intended to be uplifted, I was unable to add a String - I filed
bug 1402115 to correct this.
This String is used for non-visual users as a hint when focusing a top sites
tile that the top sites they focused is pinned. In english, this would be:
"Pinned site, <top-site-tile-name>"
For non-pinned sites, it will be just the top site tile name.
I chose this existing String because it was originally used in the following
context (according to the l10n note): "This is a snackbar label displayed after
a site is pinned or unpinned." Roughly, I take this to be "The site you have
chosen has be pinned." This somewhat makes sense in the top sites tiles, where
the user has previously pinned this site and we're now notifying them of that.
MozReview-Commit-ID: FUn8Si5LURy
--- a/mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
+++ b/mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
@@ -8,26 +8,29 @@
<org.mozilla.gecko.widget.FaviconView
android:id="@+id/favicon"
style="@style/ActivityStreamFaviconView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:background="@drawable/favicon_globe"/>
- <!-- Visibility is dynamically set based on pinned state. -->
+ <!-- Visibility is dynamically set based on pinned state.
+
+ N.B. a11y: we uplifted the change that added the contentDescription so we were unable to add
+ a string. The contentDescription string was reused and may be imperfect: bug 1402115. -->
<ImageView
android:id="@+id/pin_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|start"
android:layout_margin="3dp"
android:src="@drawable/as_pin_with_background"
- android:visibility="gone"
- android:importantForAccessibility="no"/>
+ android:contentDescription="@string/home_pinned_site"
+ android:visibility="gone"/>
<!-- scrollHorizontally=false allows drags on the TextView to scroll the ViewPager.
See https://stackoverflow.com/a/18171834/2219998 -->
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#66000000"