[Android] Set video player accessibility descriptions

Geoffrey Métais git at videolan.org
Thu Jun 14 14:49:44 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jun 14 14:19:58 2018 +0200| [5e67c4e94e02ae3c2d5f2195b0be7c7a89635e3e] | committer: Geoffrey Métais

Set video player accessibility descriptions

> https://code.videolan.org/videolan/vlc-android/commit/5e67c4e94e02ae3c2d5f2195b0be7c7a89635e3e
---

 vlc-android/res/layout/audio_player.xml |  9 +++++----
 vlc-android/res/layout/player_hud.xml   | 11 ++++++++++-
 vlc-android/res/values/strings.xml      |  2 ++
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/vlc-android/res/layout/audio_player.xml b/vlc-android/res/layout/audio_player.xml
index 24ae29c68..aeae87259 100644
--- a/vlc-android/res/layout/audio_player.xml
+++ b/vlc-android/res/layout/audio_player.xml
@@ -156,7 +156,7 @@
                 android:layout_gravity="center"
                 android:layout_marginRight="@dimen/default_margin"
                 android:layout_marginEnd="@dimen/default_margin"
-                android:contentDescription="@string/pause"
+                android:contentDescription="@string/play"
                 android:focusable="true"
                 android:scaleType="fitXY"
                 android:onClick="@{fragment::onPlayPauseClick}"
@@ -253,6 +253,7 @@
             android:layout_marginRight="@dimen/default_margin"
             android:layout_marginEnd="@dimen/default_margin"
             android:text="@string/time_0"
+            android:contentDescription="@string/length"
             android:textSize="12sp" />
 
         <ImageView
@@ -264,7 +265,7 @@
             app:layout_constraintTop_toTopOf="@+id/play_pause"
             android:layout_marginLeft="@dimen/default_margin"
             android:layout_marginStart="@dimen/default_margin"
-            android:contentDescription="@string/shuffle"
+            android:contentDescription="@string/shuffle_title"
             android:focusable="true"
             android:scaleType="fitXY"
             android:src="?attr/ic_shuffle"
@@ -279,7 +280,7 @@
             app:layout_constraintTop_toTopOf="@+id/play_pause"
             android:layout_marginRight="@dimen/default_margin"
             android:layout_marginEnd="@dimen/default_margin"
-            android:contentDescription="@string/repeat"
+            android:contentDescription="@string/repeat_title"
             android:focusable="true"
             android:onClick="@{fragment::onRepeatClick}"
             android:scaleType="fitXY"
@@ -292,7 +293,7 @@
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintLeft_toRightOf="@+id/previous"
             app:layout_constraintRight_toLeftOf="@+id/next"
-            android:contentDescription="@string/pause"
+            android:contentDescription="@string/play"
             android:focusable="true"
             android:scaleType="fitXY"
             android:onClick="@{fragment::onPlayPauseClick}"
diff --git a/vlc-android/res/layout/player_hud.xml b/vlc-android/res/layout/player_hud.xml
index 1e1663eee..d295da6ed 100644
--- a/vlc-android/res/layout/player_hud.xml
+++ b/vlc-android/res/layout/player_hud.xml
@@ -92,6 +92,7 @@
             android:src="@drawable/ic_lock_circle"
             android:scaleType="center"
             android:onClick="@{(v) -> player.toggleLock()}"
+            android:contentDescription="@string/lock"
             android:focusable="true"/>
 
         <ImageView
@@ -103,6 +104,7 @@
             android:src="@drawable/ic_audiosub_circle"
             android:scaleType="center"
             android:onClick="@{player::onAudioSubClick}"
+            android:contentDescription="@string/tracks"
             android:focusable="true"/>
 
         <ImageView
@@ -116,6 +118,7 @@
             android:scaleType="center"
             android:onClick="@{(v) -> player.previous()}"
             android:src="@drawable/ic_playlist_previous_circle"
+            android:contentDescription="@string/previous"
             android:visibility="gone" />
 
         <ImageView
@@ -128,6 +131,7 @@
             android:longClickable="true"
             android:scaleType="center"
             android:src="@drawable/ic_rewind_circle"
+            android:contentDescription="@string/playback_rewind"
             android:visibility="gone" />
 
         <ImageView
@@ -140,7 +144,8 @@
             android:scaleType="fitCenter"
             android:focusable="true"
             android:onClick="@{(v) -> player.doPlayPause()}"
-            android:onLongClick="@{player::toggleLoop}"/>
+            android:onLongClick="@{player::toggleLoop}"
+            android:contentDescription="@string/play"/>
 
         <ImageView
             android:id="@+id/player_overlay_forward"
@@ -152,6 +157,7 @@
             android:src="@drawable/ic_forward_circle"
             android:scaleType="center"
             android:focusable="true"
+            android:contentDescription="@string/playback_forward"
             android:visibility="gone" />
 
         <ImageView
@@ -165,6 +171,7 @@
             android:scaleType="center"
             android:focusable="true"
             android:onClick="@{(v) -> player.next()}"
+            android:contentDescription="@string/next"
             android:visibility="gone" />
 
         <ImageView
@@ -176,6 +183,7 @@
             android:src="@drawable/ic_more_circle"
             android:scaleType="center"
             android:onClick="@{(v) -> player.showAdvancedOptions()}"
+            android:contentDescription="@string/advanced"
             android:focusable="true"/>
 
         <ImageView
@@ -186,6 +194,7 @@
             android:src="@drawable/ic_crop_circle_o"
             android:scaleType="center"
             android:onClick="@{(v) -> player.resizeVideo()}"
+            android:contentDescription="@string/resize"
             android:focusable="true" />
     </LinearLayout>
 </RelativeLayout>
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 55b1e5b6a..cd2e6b910 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -603,4 +603,6 @@
     <string name="audio_digital_output_disabled">Audio Digital Output disabled</string>
     <string name="audio_digital_title">Digital audio output (passthrough)</string>
     <string name="audio_task_removed_title">Stop playback when application is dismissed</string>
+    <string name="playback_rewind">Rewind</string>
+    <string name="playback_forward">Fast forward</string>
 </resources>



More information about the Android mailing list