[Android] Accessibility : add audio missing content description

Alexandre Perraud git at videolan.org
Tue Apr 14 16:59:20 CEST 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Tue Apr 14 16:58:45 2015 +0200| [684b9c8710e20b712ccaf28f53c48c7c15886fcc] | committer: Alexandre Perraud

Accessibility : add audio missing content description

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=684b9c8710e20b712ccaf28f53c48c7c15886fcc
---

 vlc-android/res/layout/audio_browser_item.xml               |    1 +
 vlc-android/res/layout/audio_player.xml                     |    2 ++
 vlc-android/res/layout/audio_playlist_item.xml              |    1 +
 vlc-android/res/values/strings.xml                          |   11 +++++++++--
 vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java |    5 +++++
 5 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/layout/audio_browser_item.xml b/vlc-android/res/layout/audio_browser_item.xml
index ad854fe..82106ba 100644
--- a/vlc-android/res/layout/audio_browser_item.xml
+++ b/vlc-android/res/layout/audio_browser_item.xml
@@ -57,6 +57,7 @@
             android:layout_centerVertical="true"
             android:layout_alignParentRight="true"
             android:background="@drawable/ic_more"
+            android:contentDescription="@string/more_actions"
             android:clickable="true" />
     </RelativeLayout>
 
diff --git a/vlc-android/res/layout/audio_player.xml b/vlc-android/res/layout/audio_player.xml
index ecca207..df7c459 100644
--- a/vlc-android/res/layout/audio_player.xml
+++ b/vlc-android/res/layout/audio_player.xml
@@ -55,6 +55,7 @@
             android:background="#00000000"
             android:focusable="true"
             android:scaleType="fitXY"
+            android:contentDescription="@string/show_playlist"
             android:src="?attr/ic_playlist_on" />
 
         <ImageButton
@@ -65,6 +66,7 @@
             android:layout_weight="0"
             android:background="#00000000"
             android:focusable="true"
+            android:contentDescription="@string/advanced"
             android:src="?attr/ic_audio_player_more" />
 
         <TextView
diff --git a/vlc-android/res/layout/audio_playlist_item.xml b/vlc-android/res/layout/audio_playlist_item.xml
index 55f9123..f946389 100644
--- a/vlc-android/res/layout/audio_playlist_item.xml
+++ b/vlc-android/res/layout/audio_playlist_item.xml
@@ -101,6 +101,7 @@
                     android:layout_marginRight="5dp"
                     android:background="#00000000"
                     android:scaleType="fitXY"
+                    android:contentDescription="@string/move"
                     android:src="?attr/ic_move_media" />
             </LinearLayout>
         </LinearLayout>
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 70749a2..a9113e5 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -97,8 +97,11 @@
     <string name="validation">Are you sure?</string>
 
     <string name="cover_art">Cover art</string>
-    <string name="shuffle">Shuffle</string>
-    <string name="repeat">Repeat none/single/all</string>
+    <string name="shuffle">Shuffle Off</string>
+    <string name="shuffle_on">Shuffle On</string>
+    <string name="repeat">Repeat none</string>
+    <string name="repeat_single">Repeat single</string>
+    <string name="repeat_all">Repeat all</string>
     <string name="previous">Previous</string>
     <string name="stop">Stop</string>
     <string name="next">Next</string>
@@ -336,6 +339,10 @@
     <string name="confirm_resume_title">Ask confirmation to resume</string>
     <string name="confirm_resume_summary">if activated you will be asked to confirm when a video can be resumed from last position</string>
 
+    <!--Accessibility-->
+    <string name="more_actions">More Actions</string>
+    <string name="move">Move</string>
+
     <string-array name="hardware_acceleration_list">
         <item>@string/automatic</item>
         <item>@string/hardware_acceleration_disabled</item>
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index 136eaf6..4399759 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -347,19 +347,24 @@ public class AudioPlayer extends Fragment implements IAudioPlayer, View.OnClickL
         }
         if (mAudioController.isShuffling()) {
             mShuffle.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_shuffle_on));
+            mShuffle.setContentDescription(getResources().getString(R.string.shuffle_on));
         } else {
             mShuffle.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_shuffle));
+            mShuffle.setContentDescription(getResources().getString(R.string.shuffle));
         }
         switch(mAudioController.getRepeatType()) {
         case None:
             mRepeat.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_repeat));
+            mRepeat.setContentDescription(getResources().getString(R.string.repeat));
             break;
         case Once:
             mRepeat.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_repeat_one));
+            mRepeat.setContentDescription(getResources().getString(R.string.repeat_single));
             break;
         default:
         case All:
             mRepeat.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_repeat_on));
+            mRepeat.setContentDescription(getResources().getString(R.string.repeat_all));
             break;
         }
 



More information about the Android mailing list