[Android] UI : Adjust the position and pimp some player objects

Alexandre Perraud git at videolan.org
Mon Jun 15 17:31:46 CEST 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Mon Jun 15 17:25:53 2015 +0200| [ef17970ea610c97f42681faf9e521f4b4f4b58e4] | committer: Alexandre Perraud

UI : Adjust the position and pimp some player objects

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

 vlc-android/res/layout/player.xml                  |   76 ++++++++++----------
 vlc-android/res/layout/player_remote_control.xml   |    2 +-
 .../vlc/gui/video/VideoPlayerActivity.java         |   10 +--
 3 files changed, 45 insertions(+), 43 deletions(-)

diff --git a/vlc-android/res/layout/player.xml b/vlc-android/res/layout/player.xml
index 6e469c5..4c355c1 100644
--- a/vlc-android/res/layout/player.xml
+++ b/vlc-android/res/layout/player.xml
@@ -53,7 +53,7 @@
             android:layout_width="80dp"
             android:layout_height="80dp"
             android:layout_centerHorizontal="true"
-            android:layout_above="@+id/player_overlay_loading_text"
+            android:layout_centerInParent="true"
             android:src="@drawable/ic_cone_o" />
 
         <TextView
@@ -64,61 +64,61 @@
             android:layout_centerHorizontal="true"
             android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Title" />
 
-        <TextView
+        <LinearLayout
             android:id="@+id/player_overlay_info"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:orientation="horizontal"
             android:layout_above="@+id/progress_overlay"
             android:layout_centerHorizontal="true"
-            android:layout_gravity="center"
-            android:background="@drawable/video_list_length_bg"
-            android:padding="5dp"
-            android:gravity="center_horizontal"
-            android:textColor="#ffffff"
-            android:textSize="36sp"
-            android:visibility="invisible" />
-
-        <FrameLayout android:id="@+id/verticalbar"
-            android:layout_width="28dp"
-            android:layout_height="100dp"
-            android:layout_above="@+id/progress_overlay"
-            android:layout_toLeftOf="@+id/player_overlay_info"
-            android:layout_marginRight="8dp"
-            android:layout_marginBottom="-16dp"
-            android:background="@drawable/video_list_length_bg"
-            android:visibility="invisible">
-
-            <LinearLayout android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_margin="7dp"
-                android:background="@drawable/verticalbar_border"
-                android:orientation="vertical"
-                android:weightSum="100"
-                android:gravity="bottom">
-
-                <View android:id="@+id/verticalbar_progress"
-                    android:layout_width="match_parent"
-                    android:layout_height="0dp"
-                    android:layout_margin="2dp"
-                    android:background="@color/orange500transparent" />
-            </LinearLayout>
-        </FrameLayout>
+            android:layout_marginBottom="@dimen/default_margin">
+            <FrameLayout android:id="@+id/verticalbar"
+                android:layout_width="24dp"
+                android:layout_height="100dp"
+                android:background="@drawable/video_list_length_bg"
+                android:visibility="gone">
+
+                <LinearLayout android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_margin="6dp"
+                    android:orientation="vertical"
+                    android:weightSum="100"
+                    android:gravity="bottom">
+
+                    <View android:id="@+id/verticalbar_progress"
+                        android:layout_width="match_parent"
+                        android:layout_height="0dp"
+                        android:background="@color/orange500transparent" />
+                </LinearLayout>
+            </FrameLayout>
+            <TextView
+                android:id="@+id/player_overlay_textinfo"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center"
+                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:textColor="@color/white"
+                android:textSize="36sp"
+                android:visibility="gone" />
+        </LinearLayout>
 
         <ImageView
             android:id="@+id/player_delay_minus"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginRight="5dp"
             android:layout_above="@+id/progress_overlay"
             android:layout_alignParentRight="true"
+            android:layout_margin="@dimen/default_margin"
             android:src="@drawable/ic_minus_circle"
             android:visibility="invisible"/>
         <ImageView
             android:id="@+id/player_delay_plus"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginBottom="10dp"
-            android:layout_marginRight="5dp"
+            android:layout_marginRight="@dimen/default_margin"
             android:layout_above="@+id/player_delay_minus"
             android:layout_alignParentRight="true"
             android:src="@drawable/ic_plus_circle"
diff --git a/vlc-android/res/layout/player_remote_control.xml b/vlc-android/res/layout/player_remote_control.xml
index 3300cb7..d51e02b 100644
--- a/vlc-android/res/layout/player_remote_control.xml
+++ b/vlc-android/res/layout/player_remote_control.xml
@@ -40,7 +40,7 @@
         android:fitsSystemWindows="true" >
 
         <TextView
-            android:id="@+id/player_overlay_info"
+            android:id="@+id/player_overlay_textinfo"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentTop="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 91d12c1..9e1ef1d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -424,7 +424,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
         mLength = (TextView) findViewById(R.id.player_overlay_length);
 
         // the info textView is not on the overlay
-        mInfo = (TextView) findViewById(R.id.player_overlay_info);
+        mInfo = (TextView) findViewById(R.id.player_overlay_textinfo);
         mVerticalBar = findViewById(R.id.verticalbar);
         mVerticalBarProgress = findViewById(R.id.verticalbar_progress);
 
@@ -1123,6 +1123,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
     }
 
     private void initDelayInfo() {
+        if (mPresentation == null)
+            mVerticalBar.setVisibility(View.GONE);
         mInfo.setVisibility(View.VISIBLE);
         String text = "";
         if (mDelay == DelayState.AUDIO) {
@@ -1300,7 +1302,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
      */
     private void showInfo(String text, int duration) {
         if (mPresentation == null)
-            mVerticalBar.setVisibility(View.INVISIBLE);
+            mVerticalBar.setVisibility(View.GONE);
         mInfo.setVisibility(View.VISIBLE);
         mInfo.setText(text);
         mHandler.removeMessages(FADE_OUT_INFO);
@@ -1309,7 +1311,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
 
     private void showInfo(int textid, int duration) {
         if (mPresentation == null)
-            mVerticalBar.setVisibility(View.INVISIBLE);
+            mVerticalBar.setVisibility(View.GONE);
         mInfo.setVisibility(View.VISIBLE);
         mInfo.setText(textid);
         mHandler.removeMessages(FADE_OUT_INFO);
@@ -1322,7 +1324,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
      */
     private void showInfo(String text) {
         if (mPresentation == null)
-            mVerticalBar.setVisibility(View.INVISIBLE);
+            mVerticalBar.setVisibility(View.GONE);
         mHandler.removeMessages(FADE_OUT_INFO);
         mInfo.setVisibility(View.VISIBLE);
         mInfo.setText(text);



More information about the Android mailing list