[Android] Transparent dialogs for advanced video options

Geoffrey Métais git at videolan.org
Fri Jan 23 17:10:41 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jan 23 13:56:20 2015 +0100| [f35f22f79921bc4a7ada90a9dc14a17541a75de4] | committer: Geoffrey Métais

Transparent dialogs for advanced video options

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

 vlc-android/res/layout/fragment_advanced_options.xml          |    9 ++++++---
 vlc-android/res/values/styles.xml                             |    8 ++++++++
 vlc-android/src/org/videolan/vlc/gui/PickTimeFragment.java    |    1 +
 .../src/org/videolan/vlc/gui/video/AdvOptionsDialog.java      |    2 +-
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/vlc-android/res/layout/fragment_advanced_options.xml b/vlc-android/res/layout/fragment_advanced_options.xml
index 406d42c..eaedfc2 100644
--- a/vlc-android/res/layout/fragment_advanced_options.xml
+++ b/vlc-android/res/layout/fragment_advanced_options.xml
@@ -7,9 +7,6 @@
     android:padding="20dp"
     tools:context="org.videolan.vlc.gui.video.AdvOptionsDialog">
 
-    <!-- TODO: Update blank fragment layout -->
-
-
     <!-- Playback speed -->
 
     <LinearLayout
@@ -175,7 +172,13 @@
             android:focusable="true"
             android:gravity="center_vertical"
             android:text="@string/jump_to_time" />
+    </LinearLayout>
 
+    <!-- Tracks delay -->
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" >
         <TextView
             android:id="@+id/audio_delay"
             android:layout_width="wrap_content"
diff --git a/vlc-android/res/values/styles.xml b/vlc-android/res/values/styles.xml
index 17b2f9e..c9c6ab9 100644
--- a/vlc-android/res/values/styles.xml
+++ b/vlc-android/res/values/styles.xml
@@ -191,6 +191,14 @@
 
     <!-- Advanced options menu styles -->
 
+    <style name="Theme.VLC.TransparentDialog" parent="@style/Theme.AppCompat.Dialog">
+      <item name="android:windowIsFloating">true</item>
+      <item name="android:backgroundDimEnabled">true</item>
+      <item name="android:windowIsTranslucent">true</item>
+      <item name="android:windowNoTitle">true</item>
+      <item name="android:windowBackground">@drawable/rounded_corners</item>
+    </style>
+
     <style name="Theme.VLC.AdvancedOptions" parent="@android:style/Theme.Dialog">
       <item name="android:windowIsFloating">true</item>
       <item name="android:backgroundDimEnabled">false</item>
diff --git a/vlc-android/src/org/videolan/vlc/gui/PickTimeFragment.java b/vlc-android/src/org/videolan/vlc/gui/PickTimeFragment.java
index 4a4f559..53a2c92 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PickTimeFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PickTimeFragment.java
@@ -109,6 +109,7 @@ public class PickTimeFragment extends DialogFragment implements DialogInterface.
         getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
         getDialog().setOnKeyListener(this);
         getDialog().getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        getDialog().getWindow().setBackgroundDrawableResource(R.drawable.rounded_corners);
         return view;
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
index 7771fc9..2caece7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
@@ -83,7 +83,7 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         sInstance = this;
-        setStyle(STYLE_NO_FRAME, R.style.Base_Theme_AppCompat_Dialog);
+        setStyle(STYLE_NO_FRAME, R.style.Theme_VLC_TransparentDialog);
         if (VLCApplication.sPlayerSleepTime != null && VLCApplication.sPlayerSleepTime.before(Calendar.getInstance()))
             VLCApplication.sPlayerSleepTime = null;
     }



More information about the Android mailing list