[Android] Accessibility: improve talkback for the video aspect ratio
Nicolas Pomepuy
git at videolan.org
Fri Jun 3 11:30:21 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue May 24 10:58:06 2022 +0200| [c6b0e34c4a2bc5b547d5537919c24fe6aa747dba] | committer: Nicolas Pomepuy
Accessibility: improve talkback for the video aspect ratio
> https://code.videolan.org/videolan/vlc-android/commit/c6b0e34c4a2bc5b547d5537919c24fe6aa747dba
---
application/vlc-android/res/layout/dialog_time_picker.xml | 1 +
application/vlc-android/res/layout/player_resize.xml | 13 +++++++++++--
.../videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt | 1 +
.../org/videolan/vlc/gui/video/VideoPlayerResizeDelegate.kt | 4 ++++
4 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/application/vlc-android/res/layout/dialog_time_picker.xml b/application/vlc-android/res/layout/dialog_time_picker.xml
index d42caf236..01f1a4886 100644
--- a/application/vlc-android/res/layout/dialog_time_picker.xml
+++ b/application/vlc-android/res/layout/dialog_time_picker.xml
@@ -44,6 +44,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:background="@color/transparent"
+ android:contentDescription="@string/clear"
app:layout_constraintBottom_toBottomOf="@+id/tim_pic_timetojump"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tim_pic_timetojump"
diff --git a/application/vlc-android/res/layout/player_resize.xml b/application/vlc-android/res/layout/player_resize.xml
index 57bf15107..c55ac0fbb 100644
--- a/application/vlc-android/res/layout/player_resize.xml
+++ b/application/vlc-android/res/layout/player_resize.xml
@@ -23,19 +23,28 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
+ <ImageView
+ android:id="@+id/close"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/close"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:srcCompat="@drawable/ic_popup_close_w" />
+
<TextView
android:id="@+id/foldable_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
- android:layout_marginTop="24dp"
+ android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:fontFamily="sans-serif-medium"
android:text="@string/foldable"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
+ app:layout_constraintTop_toBottomOf="@+id/close" />
<CheckBox
android:id="@+id/foldable"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
index 32b54be9a..abb3fca6c 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
@@ -289,6 +289,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
} else subinfo.setGone()
player.handler.removeMessages(VideoPlayerActivity.FADE_OUT_INFO)
player.handler.sendEmptyMessageDelayed(VideoPlayerActivity.FADE_OUT_INFO, duration.toLong())
+ player.rootView?.announceForAccessibility("$text.$subText")
}
fun fadeOutInfo(view:View?) {
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerResizeDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerResizeDelegate.kt
index 6e3ecda1c..011f615d6 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerResizeDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerResizeDelegate.kt
@@ -80,6 +80,10 @@ class VideoPlayerResizeDelegate(private val player: VideoPlayerActivity) {
foldCheckbox = resizeMainView.findViewById(R.id.foldable)
val foldTitle = resizeMainView.findViewById<View>(R.id.foldable_title)
+ resizeMainView.findViewById<View>(R.id.close).setOnClickListener {
+ hideResizeOverlay()
+ }
+
sizeList.layoutManager = LinearLayoutManager(player)
sizeAdapter = SizeAdapter()
sizeAdapter.setOnSizeSelectedListener { scale ->
More information about the Android
mailing list