[Android] [PATCH] UI : add menu dvd icon to player and remote views

Alexandre Perraud 4leyx4ndre at gmail.com
Thu May 15 17:54:38 CEST 2014


    with visibility gone until it's used
---
 vlc-android/res/drawable/ic_dvdmenu_circle.xml     |  7 +++
 vlc-android/res/drawable/ic_dvdmenu_circle_o.xml   |  7 +++
 .../res/layout-land/player_remote_control.xml      | 62 ++++++++++++--------
 vlc-android/res/layout/player.xml                  | 12 +++-
 vlc-android/res/layout/player_remote_control.xml   | 67 +++++++++++++---------
 5 files changed, 104 insertions(+), 51 deletions(-)
 create mode 100644 vlc-android/res/drawable/ic_dvdmenu_circle.xml
 create mode 100644 vlc-android/res/drawable/ic_dvdmenu_circle_o.xml

diff --git a/vlc-android/res/drawable/ic_dvdmenu_circle.xml b/vlc-android/res/drawable/ic_dvdmenu_circle.xml
new file mode 100644
index 0000000..ec85b0a
--- /dev/null
+++ b/vlc-android/res/drawable/ic_dvdmenu_circle.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/ic_dvdmenu_circle_normal" android:state_focused="true" android:state_pressed="false"/>
+    <item android:drawable="@drawable/ic_dvdmenu_circle_pressed" android:state_focused="true" android:state_pressed="true"/>
+    <item android:drawable="@drawable/ic_dvdmenu_circle_pressed" android:state_focused="false" android:state_pressed="true"/>
+    <item android:drawable="@drawable/ic_dvdmenu_circle_normal"/>
+</selector>
\ No newline at end of file
diff --git a/vlc-android/res/drawable/ic_dvdmenu_circle_o.xml b/vlc-android/res/drawable/ic_dvdmenu_circle_o.xml
new file mode 100644
index 0000000..acda2b9
--- /dev/null
+++ b/vlc-android/res/drawable/ic_dvdmenu_circle_o.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/ic_dvdmenu_circle_normal_o" android:state_focused="true" android:state_pressed="false"/>
+    <item android:drawable="@drawable/ic_dvdmenu_circle_pressed_o" android:state_focused="true" android:state_pressed="true"/>
+    <item android:drawable="@drawable/ic_dvdmenu_circle_pressed_o" android:state_focused="false" android:state_pressed="true"/>
+    <item android:drawable="@drawable/ic_dvdmenu_circle_normal_o"/>
+</selector>
\ No newline at end of file
diff --git a/vlc-android/res/layout-land/player_remote_control.xml b/vlc-android/res/layout-land/player_remote_control.xml
index d254c74..ffefb46 100644
--- a/vlc-android/res/layout-land/player_remote_control.xml
+++ b/vlc-android/res/layout-land/player_remote_control.xml
@@ -130,38 +130,54 @@
                 android:layout_height="wrap_content"
                 android:background="@drawable/ic_pause_circle_big_o" />
 
-            <LinearLayout
+            <RelativeLayout
                 android:id="@+id/option_overlay"
                 android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:gravity="center_vertical"
-                android:orientation="horizontal" >
-
-                <ImageButton
-                    android:id="@+id/player_overlay_subtitle"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:background="@drawable/ic_subtitle_circle_o" />
+                android:layout_height="wrap_content" >
 
-                <ImageButton
-                    android:id="@+id/player_overlay_audio"
+                <LinearLayout
+                    android:id="@+id/option_nodvd_overlay"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:background="@drawable/ic_audio_circle_o" />
+                    android:layout_centerHorizontal="true"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal" >
+
+                    <ImageButton
+                        android:id="@+id/player_overlay_subtitle"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/ic_subtitle_circle_o" />
+
+                    <ImageButton
+                        android:id="@+id/player_overlay_audio"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/ic_audio_circle_o" />
+
+                    <ImageButton
+                        android:id="@+id/player_overlay_size"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/ic_crop_circle_o" />
+
+                    <ImageButton
+                        android:id="@+id/player_overlay_adv_function"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/ic_dots_circle_o"
+                        android:onClick="showAdvancedOptions" />
+                </LinearLayout>
 
                 <ImageButton
-                    android:id="@+id/player_overlay_size"
+                    android:id="@+id/player_overlay_dvdmenu"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:background="@drawable/ic_crop_circle_o" />
-
-                <ImageButton
-                    android:id="@+id/player_overlay_adv_function"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:background="@drawable/ic_dots_circle_o"
-                    android:onClick="showAdvancedOptions" />
-            </LinearLayout>
+                    android:layout_below="@+id/option_nodvd_overlay"
+                    android:layout_centerHorizontal="true"
+                    android:background="@drawable/ic_dvdmenu_circle_o"
+                    android:visibility="gone" />
+            </RelativeLayout>
         </LinearLayout>
 
         <RelativeLayout
diff --git a/vlc-android/res/layout/player.xml b/vlc-android/res/layout/player.xml
index 95f53c4..9b3d9ec 100644
--- a/vlc-android/res/layout/player.xml
+++ b/vlc-android/res/layout/player.xml
@@ -24,6 +24,7 @@
                 android:id="@+id/player_surface"
                 android:layout_width="1dp"
                 android:layout_height="1dp" />
+
             <SurfaceView
                 android:id="@+id/subtitles_surface"
                 android:layout_width="1dp"
@@ -58,8 +59,8 @@
             android:layout_height="wrap_content"
             android:layout_below="@+id/player_overlay_loading"
             android:layout_centerHorizontal="true"
-            android:textSize="20sp"
-            android:text="@string/please_wait" />
+            android:text="@string/please_wait"
+            android:textSize="20sp" />
 
         <TextView
             android:id="@+id/player_overlay_info"
@@ -134,6 +135,13 @@
                 android:background="@drawable/ic_audio_circle" />
 
             <ImageButton
+                android:id="@+id/player_overlay_dvdmenu"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@drawable/ic_dvdmenu_circle"
+                android:visibility="gone" />
+
+            <ImageButton
                 android:id="@+id/player_overlay_size"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
diff --git a/vlc-android/res/layout/player_remote_control.xml b/vlc-android/res/layout/player_remote_control.xml
index 413a141..a461917 100644
--- a/vlc-android/res/layout/player_remote_control.xml
+++ b/vlc-android/res/layout/player_remote_control.xml
@@ -101,7 +101,7 @@
             android:src="@drawable/background_cone" />
 
         <LinearLayout
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_below="@+id/player_overlay_info"
             android:layout_centerHorizontal="true"
@@ -114,38 +114,54 @@
                 android:layout_height="wrap_content"
                 android:background="@drawable/ic_pause_circle_big_o" />
 
-            <LinearLayout
+            <RelativeLayout
                 android:id="@+id/option_overlay"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:gravity="center_vertical"
-                android:orientation="horizontal" >
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content" >
 
-                <ImageButton
-                    android:id="@+id/player_overlay_subtitle"
+                <LinearLayout
+                    android:id="@+id/option_nodvd_overlay"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:background="@drawable/ic_subtitle_circle_o" />
+                    android:layout_centerHorizontal="true"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal" >
+
+                    <ImageButton
+                        android:id="@+id/player_overlay_subtitle"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/ic_subtitle_circle_o" />
+
+                    <ImageButton
+                        android:id="@+id/player_overlay_audio"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/ic_audio_circle_o" />
+
+                    <ImageButton
+                        android:id="@+id/player_overlay_size"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/ic_crop_circle_o" />
+
+                    <ImageButton
+                        android:id="@+id/player_overlay_adv_function"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/ic_dots_circle_o"
+                        android:onClick="showAdvancedOptions" />
+                </LinearLayout>
 
                 <ImageButton
-                    android:id="@+id/player_overlay_audio"
+                    android:id="@+id/player_overlay_dvdmenu"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:background="@drawable/ic_audio_circle_o" />
-
-                <ImageButton
-                    android:id="@+id/player_overlay_size"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:background="@drawable/ic_crop_circle_o" />
-
-                <ImageButton
-                    android:id="@+id/player_overlay_adv_function"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:background="@drawable/ic_dots_circle_o"
-                    android:onClick="showAdvancedOptions" />
-            </LinearLayout>
+                    android:layout_alignLeft="@+id/option_nodvd_overlay"
+                    android:layout_below="@+id/option_nodvd_overlay"
+                    android:background="@drawable/ic_dvdmenu_circle_o"
+                    android:visibility="gone" />
+            </RelativeLayout>
         </LinearLayout>
 
         <RelativeLayout
@@ -253,7 +269,6 @@
             android:layout_below="@+id/player_overlay_loading"
             android:text="@string/please_wait"
             android:textSize="20sp" />
-
     </RelativeLayout>
 
 </RelativeLayout>
\ No newline at end of file
-- 
1.9.1



More information about the Android mailing list