[Android] Video Player : Fix UI for small screens

Alexandre Perraud git at videolan.org
Wed Jul 8 17:01:16 CEST 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Wed Jul  8 16:50:42 2015 +0200| [179a5efce4e46c0864d44c9c8606581c95af3da4] | committer: Alexandre Perraud

Video Player : Fix UI for small screens

Fix #14958

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=179a5efce4e46c0864d44c9c8606581c95af3da4
---

 vlc-android/res/layout/player.xml                  |   22 ++++++++++----------
 vlc-android/res/layout/player_hud.xml              |    4 ++--
 .../vlc/gui/video/VideoPlayerActivity.java         |    6 +++---
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/vlc-android/res/layout/player.xml b/vlc-android/res/layout/player.xml
index e7fa406..1446670 100644
--- a/vlc-android/res/layout/player.xml
+++ b/vlc-android/res/layout/player.xml
@@ -59,20 +59,22 @@
         <LinearLayout
             android:id="@+id/player_overlay_info"
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_height="100dp"
             android:orientation="horizontal"
             android:layout_above="@+id/progress_overlay"
             android:layout_centerHorizontal="true"
             android:layout_marginBottom="@dimen/default_margin">
-            <FrameLayout android:id="@+id/verticalbar"
-                android:layout_width="24dp"
-                android:layout_height="100dp"
+            <FrameLayout
+                android:id="@+id/verticalbar"
+                android:layout_width="20dp"
+                android:layout_height="match_parent"
                 android:background="@drawable/video_list_length_bg"
                 android:visibility="gone">
 
-                <LinearLayout android:layout_width="match_parent"
+                <LinearLayout
+                    android:layout_width="match_parent"
                     android:layout_height="match_parent"
-                    android:layout_margin="6dp"
+                    android:padding="4dp"
                     android:orientation="vertical"
                     android:weightSum="100"
                     android:gravity="bottom">
@@ -86,12 +88,10 @@
             <TextView
                 android:id="@+id/player_overlay_textinfo"
                 android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center"
+                android:layout_height="match_parent"
                 android:background="@drawable/video_list_length_bg"
-                android:padding="@dimen/half_default_margin"
-                android:layout_margin="@dimen/half_default_margin"
-                android:gravity="center_horizontal"
+                android:layout_marginLeft="@dimen/half_default_margin"
+                android:gravity="center"
                 android:textColor="@color/white"
                 android:textSize="36sp"
                 android:visibility="gone" />
diff --git a/vlc-android/res/layout/player_hud.xml b/vlc-android/res/layout/player_hud.xml
index aedbdf5..62ca0e4 100644
--- a/vlc-android/res/layout/player_hud.xml
+++ b/vlc-android/res/layout/player_hud.xml
@@ -29,7 +29,7 @@
 
     <TextView
         android:id="@+id/player_overlay_time"
-        android:layout_width="64dp"
+        android:layout_width="66dp"
         android:layout_height="wrap_content"
         android:layout_below="@id/player_overlay_seekbar"
         android:layout_alignLeft="@+id/player_overlay_seekbar"
@@ -43,7 +43,7 @@
 
     <TextView
         android:id="@+id/player_overlay_length"
-        android:layout_width="64dp"
+        android:layout_width="66dp"
         android:layout_height="wrap_content"
         android:layout_below="@id/player_overlay_seekbar"
         android:layout_alignParentRight="true"
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 5530609..f362e40 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1800,7 +1800,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
         mTouchAction = TOUCH_VOLUME;
         vol = vol * 100 / mAudioMax;
-        showInfoWithVerticalBar(getString(R.string.volume) + '\u00A0' + Integer.toString(vol) + '%', 1000, vol);
+        showInfoWithVerticalBar(getString(R.string.volume) + "\n" + Integer.toString(vol) + '%', 1000, vol);
     }
 
     private void mute(boolean mute) {
@@ -1859,7 +1859,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         // Set Brightness
         getWindow().setAttributes(lp);
         int brightness = Math.round(lp.screenBrightness * 100);
-        showInfoWithVerticalBar(getString(R.string.brightness) + '\u00A0' + brightness + '%', 1000, brightness);
+        showInfoWithVerticalBar(getString(R.string.brightness) + "\n" + brightness + '%', 1000, brightness);
     }
 
     /**
@@ -2306,7 +2306,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             mSysTime.setText(DateFormat.getTimeFormat(this).format(new Date(System.currentTimeMillis())));
         if (time >= 0) mTime.setText(Strings.millisToString(time));
         if (length >= 0) mLength.setText(mDisplayRemainingTime && length > 0
-                ? "- " + Strings.millisToString(length - time)
+                ? "-" + '\u00A0' + Strings.millisToString(length - time)
                 : Strings.millisToString(length));
 
         return time;



More information about the Android mailing list