[Android] [PATCH] Fix remote control layouts

Geoffrey Métais geoffrey.metais at gmail.com
Wed Dec 17 11:27:05 CET 2014


---
 .../res/layout-land/player_remote_control.xml      | 115 ++++++++-------------
 vlc-android/res/layout/player_remote_control.xml   |  35 +++----
 2 files changed, 62 insertions(+), 88 deletions(-)

diff --git a/vlc-android/res/layout-land/player_remote_control.xml b/vlc-android/res/layout-land/player_remote_control.xml
index 7d28ec7..8769fd0 100644
--- a/vlc-android/res/layout-land/player_remote_control.xml
+++ b/vlc-android/res/layout-land/player_remote_control.xml
@@ -42,8 +42,7 @@
         <ImageView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_alignParentBottom="true"
-            android:layout_alignParentLeft="true"
+            android:layout_centerInParent="true"
             android:src="@drawable/background_cone" />
 
         <ImageView
@@ -79,19 +78,20 @@
             android:layout_above="@+id/progress_overlay"
             android:layout_alignParentRight="true"
             android:gravity="center_horizontal"
-            android:orientation="vertical" >
+            android:orientation="vertical"
+            android:id="@+id/linearLayout">
 
-            <ImageButton
-                android:id="@+id/player_overlay_play"
+            <ImageView
+                android:id="@+id/player_overlay_size"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:background="@drawable/ic_pause_circle_big_o" />
+                android:src="@drawable/ic_crop_circle_o" />
 
-            <ImageButton
-                android:id="@+id/player_overlay_size"
+            <ImageView
+                android:id="@+id/player_overlay_play"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:background="@drawable/ic_crop_circle_o" />
+                android:src="@drawable/ic_pause_circle_big_o" />
         </LinearLayout>
 
         <RelativeLayout
@@ -101,53 +101,31 @@
             android:layout_alignParentBottom="true"
             android:paddingBottom="5dp"
             android:paddingLeft="5dp"
-            android:paddingRight="5dp" >
+            android:paddingRight="5dp"
+            android:layout_below="@+id/player_overlay_info">
 
-            <ImageButton
-                android:id="@+id/lock_overlay_button"
-                android:layout_width="40dip"
-                android:layout_height="40dip"
-                android:layout_alignParentLeft="true"
-                android:layout_centerVertical="true"
-                android:layout_marginRight="5dp"
-                android:background="@drawable/ic_lock"
-                android:visibility="gone" />
-
-            <LinearLayout
-                android:id="@+id/player_overlay_timebackward"
+            <TextView
+                android:id="@+id/player_overlay_time"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
+                android:layout_marginRight="10dp"
                 android:layout_alignParentLeft="true"
-                android:gravity="center_vertical"
-                android:orientation="horizontal" >
-
-                <ImageButton
-                    android:id="@+id/player_overlay_backward"
-                    android:layout_width="40dip"
-                    android:layout_height="40dip"
-                    android:layout_marginRight="5dp"
-                    android:background="@drawable/ic_backward_w" />
-
-                <TextView
-                    android:id="@+id/player_overlay_time"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginRight="10dp"
-                    android:clickable="true"
-                    android:text="@string/time_0"
-                    android:textColor="#ffffff"
-                    android:textSize="20sp"
-                    android:textStyle="bold" />
-            </LinearLayout>
+                android:layout_alignParentBottom="true"
+                android:clickable="true"
+                android:text="@string/time_0"
+                android:textColor="#ffffff"
+                android:textSize="20sp"
+                android:textStyle="bold"
+                android:layout_alignTop="@+id/player_overlay_seekbar" />
 
             <SeekBar
                 android:id="@+id/player_overlay_seekbar"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_centerInParent="true"
-                android:layout_centerVertical="true"
-                android:layout_toLeftOf="@+id/player_overlay_lengthforward"
-                android:layout_toRightOf="@+id/player_overlay_timebackward"
+                android:layout_centerHorizontal="true"
+                android:layout_alignParentBottom="true"
+                android:layout_toLeftOf="@+id/player_overlay_length"
+                android:layout_toRightOf="@+id/player_overlay_time"
                 android:maxHeight="10dp"
                 android:minHeight="10dp"
                 android:paddingLeft="12dp"
@@ -155,33 +133,30 @@
                 android:progressDrawable="@drawable/po_seekbar"
                 android:thumb="@drawable/seekbar_thumb" />
 
-            <LinearLayout
-                android:id="@+id/player_overlay_lengthforward"
+            <TextView
+                android:id="@+id/player_overlay_length"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
+                android:clickable="true"
+                android:text="@string/time_0"
+                android:textColor="#ffffff"
+                android:textSize="20sp"
+                android:textStyle="bold"
+                android:layout_alignParentBottom="true"
                 android:layout_alignParentRight="true"
-                android:gravity="center_vertical"
-                android:orientation="horizontal" >
-
-                <TextView
-                    android:id="@+id/player_overlay_length"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginLeft="10dp"
-                    android:clickable="true"
-                    android:text="@string/time_0"
-                    android:textColor="#ffffff"
-                    android:textSize="20sp"
-                    android:textStyle="bold" />
-
-                <ImageButton
-                    android:id="@+id/player_overlay_forward"
-                    android:layout_width="40dip"
-                    android:layout_height="40dip"
-                    android:layout_marginLeft="5dp"
-                    android:background="@drawable/ic_forward_w" />
-            </LinearLayout>
+                android:layout_alignParentEnd="true" />
         </RelativeLayout>
+
+        <ImageView
+            android:id="@+id/lock_overlay_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/ic_lock_circle"
+            android:layout_above="@+id/linearLayout"
+            android:layout_alignParentRight="true"
+            android:layout_alignParentEnd="true"
+            android:layout_marginRight="35dp"
+            android:layout_marginEnd="35dp" />
     </RelativeLayout>
 
 </RelativeLayout>
diff --git a/vlc-android/res/layout/player_remote_control.xml b/vlc-android/res/layout/player_remote_control.xml
index 06e9a98..43beb0b 100644
--- a/vlc-android/res/layout/player_remote_control.xml
+++ b/vlc-android/res/layout/player_remote_control.xml
@@ -65,24 +65,24 @@
             android:gravity="center_horizontal"
             android:orientation="vertical" >
 
-            <ImageButton
+            <ImageView
                 android:id="@+id/player_overlay_play"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:background="@drawable/ic_pause_circle_big_o" />
+                android:src="@drawable/ic_pause_circle_big_o" />
 
             <RelativeLayout
                 android:id="@+id/option_overlay"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content" >
 
-                <ImageButton
+                <ImageView
                     android:id="@+id/player_overlay_size"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
 	                android:layout_centerHorizontal="true"
 	                android:gravity="center_vertical"
-                    android:background="@drawable/ic_crop_circle_o" />
+                    android:src="@drawable/ic_crop_circle_o" />
             </RelativeLayout>
         </LinearLayout>
 
@@ -95,30 +95,30 @@
             android:paddingLeft="5dp"
             android:paddingRight="5dp" >
 
-            <ImageButton
+            <ImageView
                 android:id="@+id/lock_overlay_button"
-                android:layout_width="40dip"
-                android:layout_height="40dip"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
                 android:layout_alignParentLeft="true"
-                android:layout_centerVertical="true"
+                android:layout_above="@+id/player_overlay_timebackward"
                 android:layout_marginRight="5dp"
-                android:background="@drawable/ic_lock"
-                android:visibility="gone" />
+                android:src="@drawable/ic_lock_circle"/>
 
             <LinearLayout
                 android:id="@+id/player_overlay_timebackward"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentLeft="true"
+                android:layout_alignParentBottom="true"
                 android:gravity="center_vertical"
                 android:orientation="horizontal" >
 
-                <ImageButton
+                <ImageView
                     android:id="@+id/player_overlay_backward"
                     android:layout_width="40dip"
                     android:layout_height="40dip"
                     android:layout_marginRight="5dp"
-                    android:background="@drawable/ic_backward_w" />
+                    android:src="@drawable/ic_backward_w" />
 
                 <TextView
                     android:id="@+id/player_overlay_time"
@@ -136,8 +136,7 @@
                 android:id="@+id/player_overlay_seekbar"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_centerInParent="true"
-                android:layout_centerVertical="true"
+                android:layout_alignParentBottom="true"
                 android:layout_toLeftOf="@+id/player_overlay_lengthforward"
                 android:layout_toRightOf="@+id/player_overlay_timebackward"
                 android:maxHeight="10dp"
@@ -152,6 +151,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
+                android:layout_alignParentBottom="true"
                 android:gravity="center_vertical"
                 android:orientation="horizontal" >
 
@@ -166,12 +166,12 @@
                     android:textSize="20sp"
                     android:textStyle="bold" />
 
-                <ImageButton
+                <ImageView
                     android:id="@+id/player_overlay_forward"
                     android:layout_width="40dip"
                     android:layout_height="40dip"
                     android:layout_marginLeft="5dp"
-                    android:background="@drawable/ic_forward_w" />
+                    android:src="@drawable/ic_forward_w" />
             </LinearLayout>
         </RelativeLayout>
 
@@ -179,8 +179,7 @@
             android:id="@+id/player_overlay_loading"
             android:layout_width="80dp"
             android:layout_height="80dp"
-            android:layout_alignParentRight="true"
-            android:layout_below="@+id/player_overlay_header"
+            android:layout_centerInParent="true"
             android:src="@drawable/ic_cone_o" />
 
         <TextView
-- 
1.9.1



More information about the Android mailing list