[Android] Fix RTL for the player volume/brightness views

Nicolas Pomepuy git at videolan.org
Fri Nov 22 13:53:25 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Nov 14 07:30:08 2024 +0100| [148fcd709739d0836b406a25e9a79da8a1d6bb1f] | committer: Nicolas Pomepuy

Fix RTL for the player volume/brightness views

> https://code.videolan.org/videolan/vlc-android/commit/148fcd709739d0836b406a25e9a79da8a1d6bb1f
---

 application/vlc-android/res/layout/player.xml          | 10 ++++++----
 .../res/layout/player_overlay_brightness.xml           | 18 ++++++++++--------
 .../vlc-android/res/layout/player_overlay_volume.xml   | 14 ++++++++------
 3 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/application/vlc-android/res/layout/player.xml b/application/vlc-android/res/layout/player.xml
index 41711f659e..a42a0b8ba6 100644
--- a/application/vlc-android/res/layout/player.xml
+++ b/application/vlc-android/res/layout/player.xml
@@ -32,19 +32,21 @@
             android:id="@+id/player_brightness_stub"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_gravity="center_vertical|end"
+            android:layout_gravity="center_vertical|right"
             android:layout_marginBottom="@dimen/default_margin"
             android:layout_marginRight="@dimen/tv_overscan_horizontal"
-            android:layout="@layout/player_overlay_brightness" />
+            android:layout="@layout/player_overlay_brightness"
+            tools:ignore="RtlHardcoded" />
 
     <androidx.appcompat.widget.ViewStubCompat
             android:id="@+id/player_volume_stub"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_gravity="center_vertical"
+            android:layout_gravity="center_vertical|left"
             android:layout_marginLeft="@dimen/tv_overscan_horizontal"
             android:layout_marginBottom="@dimen/default_margin"
-            android:layout="@layout/player_overlay_volume" />
+            android:layout="@layout/player_overlay_volume"
+            tools:ignore="RtlHardcoded" />
 
     <View
             android:layout_width="match_parent"
diff --git a/application/vlc-android/res/layout/player_overlay_brightness.xml b/application/vlc-android/res/layout/player_overlay_brightness.xml
index 77b1f1bd9c..0c99db82a5 100644
--- a/application/vlc-android/res/layout/player_overlay_brightness.xml
+++ b/application/vlc-android/res/layout/player_overlay_brightness.xml
@@ -29,14 +29,15 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:orientation="horizontal"
-        android:visibility="invisible">
+        android:visibility="invisible"
+        tools:visibility="visible">
 
     <TextView
             android:id="@+id/brightness_value_text"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:padding="8dp"
             android:layout_marginBottom="16dp"
+            android:padding="8dp"
             android:textAppearance="@style/VLC.Player.TimeText"
             android:textSize="16sp"
             app:layout_constraintBottom_toTopOf="@+id/playerBrightnessProgress"
@@ -49,10 +50,11 @@
             android:id="@+id/playerBrightnessProgress"
             android:layout_width="16dp"
             android:layout_height="120dp"
-            android:layout_marginEnd="24dp"
+            android:layout_marginRight="24dp"
             app:layout_constraintBottom_toTopOf="@+id/progress_icon"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/brightness_value_text" />
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/brightness_value_text"
+            tools:ignore="RtlHardcoded" />
 
     <ImageView
             android:id="@+id/progress_icon"
@@ -70,14 +72,14 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginStart="16dp"
-            android:padding="8dp"
             android:layout_marginEnd="24dp"
+            android:padding="8dp"
             android:text="@string/brightness"
             android:textAppearance="@style/VLC.Player.TimeText"
             android:textSize="16sp"
             app:layout_constraintBottom_toBottomOf="@+id/playerBrightnessProgress"
-            app:layout_constraintEnd_toStartOf="@+id/playerBrightnessProgress"
-            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintRight_toLeftOf="@+id/playerBrightnessProgress"
+            app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintTop_toTopOf="@+id/playerBrightnessProgress" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/application/vlc-android/res/layout/player_overlay_volume.xml b/application/vlc-android/res/layout/player_overlay_volume.xml
index 57ad0c1ea8..48a248b880 100644
--- a/application/vlc-android/res/layout/player_overlay_volume.xml
+++ b/application/vlc-android/res/layout/player_overlay_volume.xml
@@ -29,7 +29,8 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:orientation="horizontal"
-        android:visibility="invisible">
+        android:visibility="invisible"
+        tools:visibility="visible">
 
     <TextView
             android:id="@+id/volume_value_text"
@@ -49,10 +50,11 @@
             android:id="@+id/playerVolumeProgress"
             android:layout_width="16dp"
             android:layout_height="120dp"
-            android:layout_marginStart="24dp"
+            android:layout_marginLeft="24dp"
             app:layout_constraintBottom_toTopOf="@+id/progress_icon"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/volume_value_text" />
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/volume_value_text"
+            tools:ignore="RtlHardcoded" />
 
     <ImageView
             android:id="@+id/progress_icon"
@@ -76,8 +78,8 @@
             android:textAppearance="@style/VLC.Player.TimeText"
             android:textSize="16sp"
             app:layout_constraintBottom_toBottomOf="@+id/playerVolumeProgress"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toEndOf="@+id/playerVolumeProgress"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintLeft_toRightOf="@+id/playerVolumeProgress"
             app:layout_constraintTop_toTopOf="@+id/playerVolumeProgress" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file



More information about the Android mailing list