[Android] Improve the bookmark buttons margins and add talkback support

Nicolas Pomepuy git at videolan.org
Fri Feb 28 12:32:39 UTC 2025


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Feb 26 07:50:17 2025 +0100| [6bddf71231249639afce0802b5bb1757cf7e8879] | committer: Duncan McNamara

Improve the bookmark buttons margins and add talkback support

> https://code.videolan.org/videolan/vlc-android/commit/6bddf71231249639afce0802b5bb1757cf7e8879
---

 application/resources/src/main/res/values/strings.xml    | 2 ++
 application/vlc-android/res/layout-land/audio_player.xml | 6 ------
 application/vlc-android/res/layout/audio_player.xml      | 7 ++-----
 application/vlc-android/res/layout/bookmarks.xml         | 9 ++++-----
 4 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/application/resources/src/main/res/values/strings.xml b/application/resources/src/main/res/values/strings.xml
index aec3044cb2..8fb154fb98 100644
--- a/application/resources/src/main/res/values/strings.xml
+++ b/application/resources/src/main/res/values/strings.xml
@@ -1106,6 +1106,8 @@
     <string name="bookmark_name">Bookmark %s</string>
     <string name="add_bookmark">Add bookmark</string>
     <string name="bookmark_added">Bookmark added</string>
+    <string name="previous_bookmark">Previous bookmark</string>
+    <string name="next_bookmark">Next bookmark</string>
     <string name="show">Show</string>
     <string name="optional_features">Optional features</string>
     <string name="optional_features_summary">Beta features that are currently being tested and may not be stable</string>
diff --git a/application/vlc-android/res/layout-land/audio_player.xml b/application/vlc-android/res/layout-land/audio_player.xml
index 3cf1ea535f..4f8640a0f9 100644
--- a/application/vlc-android/res/layout-land/audio_player.xml
+++ b/application/vlc-android/res/layout-land/audio_player.xml
@@ -552,7 +552,6 @@
                     android:id="@+id/audio_rewind_bookmark"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginEnd="8dp"
                     android:background="?attr/actionBarItemBackground"
                     android:clickable="true"
                     android:focusable="true"
@@ -571,8 +570,6 @@
                     android:id="@+id/audio_rewind_10"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginStart="8dp"
-                    android:layout_marginEnd="8dp"
                     android:background="?attr/actionBarItemBackground"
                     android:clickable="true"
                     android:focusable="true"
@@ -605,8 +602,6 @@
                     android:id="@+id/audio_forward_10"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginStart="8dp"
-                    android:layout_marginEnd="8dp"
                     android:background="?attr/actionBarItemBackground"
                     android:clickable="true"
                     android:focusable="true"
@@ -638,7 +633,6 @@
                     android:id="@+id/audio_forward_bookmark"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginStart="8dp"
                     android:background="?attr/actionBarItemBackground"
                     android:clickable="true"
                     android:focusable="true"
diff --git a/application/vlc-android/res/layout/audio_player.xml b/application/vlc-android/res/layout/audio_player.xml
index 9b6f37cd40..3d994725ff 100644
--- a/application/vlc-android/res/layout/audio_player.xml
+++ b/application/vlc-android/res/layout/audio_player.xml
@@ -479,12 +479,12 @@
                 android:id="@+id/audio_rewind_bookmark"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginEnd="8dp"
                 android:layout_marginBottom="24dp"
                 android:background="?attr/actionBarItemBackground"
                 android:clickable="true"
                 android:focusable="true"
                 android:onClick="@{fragment::onPreviousBookmark}"
+                android:contentDescription="@string/previous_bookmark"
                 android:padding="8dp"
                 android:visibility="gone"
                 app:layout_constraintBottom_toTopOf="@+id/audio_play_progress"
@@ -500,8 +500,6 @@
                 android:id="@+id/audio_rewind_10"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginStart="8dp"
-                android:layout_marginEnd="8dp"
                 android:layout_marginBottom="24dp"
                 android:background="?attr/actionBarItemBackground"
                 android:clickable="true"
@@ -537,7 +535,6 @@
                 android:id="@+id/audio_forward_10"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginStart="8dp"
                 android:background="?attr/actionBarItemBackground"
                 android:clickable="true"
                 android:focusable="true"
@@ -558,8 +555,8 @@
                 android:id="@+id/audio_forward_bookmark"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginStart="8dp"
                 android:background="?attr/actionBarItemBackground"
+                android:contentDescription="@string/next_bookmark"
                 android:clickable="true"
                 android:focusable="true"
                 android:longClickable="true"
diff --git a/application/vlc-android/res/layout/bookmarks.xml b/application/vlc-android/res/layout/bookmarks.xml
index f515ec0404..2f6923cf2d 100644
--- a/application/vlc-android/res/layout/bookmarks.xml
+++ b/application/vlc-android/res/layout/bookmarks.xml
@@ -122,10 +122,10 @@
             android:id="@+id/previous_bookmark"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginEnd="8dp"
             android:layout_marginBottom="8dp"
             android:background="?attr/actionBarItemBackground"
             android:nextFocusRight="@+id/bookmark_rewind_10"
+            android:contentDescription="@string/previous_bookmark"
             android:padding="8dp"
             app:layout_constraintBottom_toTopOf="@+id/progressbar_guideline"
             app:layout_constraintEnd_toStartOf="@+id/bookmark_rewind_10"
@@ -171,13 +171,12 @@
             android:id="@+id/bookmark_forward_10"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginStart="8dp"
             android:background="?attr/actionBarItemBackground"
             android:clickable="true"
             android:focusable="true"
-            android:nextFocusRight="@id/next_bookmark"
-            android:nextFocusLeft="@id/bookmark_rewind_10"
             android:longClickable="true"
+            android:nextFocusLeft="@id/bookmark_rewind_10"
+            android:nextFocusRight="@id/next_bookmark"
             android:padding="8dp"
             app:layout_constraintBottom_toBottomOf="@+id/previous_bookmark"
             app:layout_constraintEnd_toStartOf="@+id/next_bookmark"
@@ -204,9 +203,9 @@
             android:id="@+id/next_bookmark"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginStart="8dp"
             android:background="?attr/actionBarItemBackground"
             android:nextFocusLeft="@+id/bookmark_forward_10"
+            android:contentDescription="@string/next_bookmark"
             android:padding="8dp"
             app:layout_constraintBottom_toBottomOf="@+id/previous_bookmark"
             app:layout_constraintEnd_toEndOf="parent"



More information about the Android mailing list