[Android] Invert time and length TextViews in RTL mode

Geoffrey Métais git at videolan.org
Fri Jun 2 15:32:02 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jun  2 15:31:24 2017 +0200| [36668cc2d77887d46358d90d0fa2ee96f8ad9f37] | committer: Geoffrey Métais

Invert time and length TextViews in RTL mode

> https://code.videolan.org/videolan/vlc-android/commit/36668cc2d77887d46358d90d0fa2ee96f8ad9f37
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 56f7cb1f1..305deb04c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2817,8 +2817,9 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             mOverlayBackground = findViewById(R.id.player_overlay_background);
             mOverlayButtons =  findViewById(R.id.player_overlay_buttons);
             // Position and remaining time
-            mTime = (TextView) findViewById(R.id.player_overlay_time);
-            mLength = (TextView) findViewById(R.id.player_overlay_length);
+            final boolean rtl = AndroidUtil.isJellyBeanMR1OrLater && TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL;
+            mTime = (TextView) findViewById(rtl ? R.id.player_overlay_length : R.id.player_overlay_time);
+            mLength = (TextView) findViewById(rtl ? R.id.player_overlay_time : R.id.player_overlay_length);
             mPlayPause = (ImageView) findViewById(R.id.player_overlay_play);
             mTracks = (ImageView) findViewById(R.id.player_overlay_tracks);
             mTracks.setOnClickListener(this);



More information about the Android mailing list