Bug 1399294: Add contentDescription for pinned top sites. r=liuche draft
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 21 Sep 2017 13:37:14 -0700 (2017-09-21)
changeset 668563 89099114cd844de88047dc3ac5f5ecb375270597
parent 668548 ca7d18dbacbf103d74a3213d8d08a7c3e4def9a2
child 732738 058d6a6504c43cad1a8e3fe1be9690b52b461bc5
push id81082
push usermichael.l.comella@gmail.com
push dateThu, 21 Sep 2017 20:37:24 +0000 (2017-09-21)
reviewersliuche
bugs1399294, 1402115
milestone58.0a1
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
mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
--- 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"