Bug 1198084 - Set appropriate content description on tabs playing audio. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 02 Sep 2015 18:34:25 -0700
changeset 293363 7dcf817255d29820ce68d8e4cf60469b51be08a4
parent 293362 a965f4b9c20238a988c8eb824f22261b529335aa
child 293364 518ebf581a90fb932279d574d5e4239aee25a182
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh
bugs1198084
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1198084 - Set appropriate content description on tabs playing audio. r=mhaigh Tested using TalkBack on N4 Android 5.1.
mobile/android/base/tabs/TabsLayoutItemView.java
--- a/mobile/android/base/tabs/TabsLayoutItemView.java
+++ b/mobile/android/base/tabs/TabsLayoutItemView.java
@@ -136,24 +136,29 @@ public class TabsLayoutItemView extends 
         Drawable thumbnailImage = tab.getThumbnail();
         mThumbnail.setImageDrawable(thumbnailImage);
 
         mThumbnail.setPrivateMode(tab.isPrivate());
 
         if (mThumbnailWrapper != null) {
             mThumbnailWrapper.setRecording(tab.isRecording());
         }
-        mTitle.setText(tab.getDisplayTitle());
+
+        final String tabTitle = tab.getDisplayTitle();
+        mTitle.setText(tabTitle);
         mCloseButton.setTag(this);
 
-        // TODO: Set content description to indicate audio is playing.
         if (tab.isAudioPlaying()) {
             mTitle.setCompoundDrawablesWithIntrinsicBounds(R.drawable.tab_audio_playing, 0, 0, 0);
+            final String tabTitleWithAudio =
+                    getResources().getString(R.string.tab_title_prefix_is_playing_audio, tabTitle);
+            mTitle.setContentDescription(tabTitleWithAudio);
         } else {
             mTitle.setCompoundDrawables(null, null, null, null);
+            mTitle.setContentDescription(tabTitle);
         }
     }
 
     public int getTabId() {
         return mTabId;
     }
 
     public void setThumbnail(Drawable thumbnail) {