[Android] Accessibility: use the accessible seekbar for the video player

Nicolas Pomepuy git at videolan.org
Fri Jun 3 11:30:22 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Jun  1 09:38:59 2022 +0200| [67ed997d0a83c2f6ebb4b3c62ae4426ae5396498] | committer: Nicolas Pomepuy

Accessibility: use the accessible seekbar for the video player

> https://code.videolan.org/videolan/vlc-android/commit/67ed997d0a83c2f6ebb4b3c62ae4426ae5396498
---

 application/vlc-android/res/layout/player_hud.xml                      | 3 +--
 .../vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt  | 1 +
 .../vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/application/vlc-android/res/layout/player_hud.xml b/application/vlc-android/res/layout/player_hud.xml
index fb5935f69..8f47e31ca 100644
--- a/application/vlc-android/res/layout/player_hud.xml
+++ b/application/vlc-android/res/layout/player_hud.xml
@@ -221,7 +221,7 @@
                 vlc:time="@{progress.time}" />
 
 <!--           ⚠️ margin are set in code!!!-->
-        <SeekBar
+        <org.videolan.vlc.gui.view.AccessibleSeekBar
                 android:id="@+id/player_overlay_seekbar"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
@@ -231,7 +231,6 @@
                 android:minHeight="@dimen/seekbar_height"
                 android:paddingStart="0dp"
                 android:paddingEnd="0dp"
-                    android:importantForAccessibility="no"
                 android:progress="@{player.service.getTime(progress.time)}"
                 android:progressDrawable="@drawable/po_seekbar_video"
                 android:splitTrack="false"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index b59dc1794..c5cfe94ce 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -283,6 +283,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
             }
             if (fromUser) {
                 overlayDelegate.showOverlay(true)
+                overlayDelegate.hudBinding.playerOverlaySeekbar.forceAccessibilityUpdate()
             }
         }
     }
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt b/application/vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt
index 7f963ba6a..288f1e4f4 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/view/AccessibleSeekBar.kt
@@ -31,7 +31,7 @@ class AccessibleSeekBar : AppCompatSeekBar {
          */
         override fun sendAccessibilityEventUnchecked(host: View?, event: AccessibilityEvent) {
             if (BuildConfig.DEBUG) Log.d(this::class.java.simpleName, "sendAccessibilityEventUnchecked: ${event.eventType}")
-            this at AccessibleSeekBar.contentDescription = context.getString(R.string.talkback_out_of, TalkbackUtil.millisToString(context, progress.toLong()), TalkbackUtil.millisToString(context, max.toLong()) )
+            contentDescription = context.getString(R.string.talkback_out_of, TalkbackUtil.millisToString(context, progress.toLong()), TalkbackUtil.millisToString(context, max.toLong()) )
             if (event.eventType != AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED
                     && event.eventType != AccessibilityEvent.TYPE_VIEW_SELECTED) {
                 super.sendAccessibilityEventUnchecked(host, event)



More information about the Android mailing list