Commit 619562a3 authored by Adrien Maglo's avatar Adrien Maglo

Advanced options: use the right styles for the black and light themes

parent d422b453
......@@ -46,6 +46,8 @@
<attr name="header_fadein_overlay" format="reference" />
<attr name="header_fadeout_overlay" format="reference" />
<attr name="advanced_options_style" format="reference" />
<declare-styleable name="SlidingPaneLayout">
<attr name="overhangSize" format="dimension" />
</declare-styleable>
......
......@@ -57,6 +57,8 @@
<item name="ic_pause">@drawable/ic_pause</item>
<item name="ic_previous">@drawable/ic_previous</item>
<item name="ic_next">@drawable/ic_next</item>
<item name="advanced_options_style">@style/Theme.VLC.AdvancedOptionsLight</item>
</style>
<style name="Theme.VLC.Black" parent="Theme.Sherlock">
......@@ -108,6 +110,8 @@
<item name="ic_pause">@drawable/ic_pause_w</item>
<item name="ic_previous">@drawable/ic_previous_w</item>
<item name="ic_next">@drawable/ic_next_w</item>
<item name="advanced_options_style">@style/Theme.VLC.AdvancedOptionsBlack</item>
</style>
<style name="Theme.VLC.List">
......@@ -129,6 +133,8 @@
<style name="Theme.VLC.Fullscreen" parent="android:Theme.NoTitleBar.Fullscreen">
<item name="android:windowBackground">@color/black</item>
<item name="video_player_overlay">@color/transparent_gray</item>
<item name="advanced_options_style">@style/Theme.VLC.AdvancedOptionsBlack</item>
</style>
<style name="ActionBar" parent="Widget.Sherlock.Light.ActionBar">
......@@ -155,8 +161,8 @@
<item name="android:windowNoTitle">true</item>
</style>
<style name="Theme.VLC.AdvancedOptionsAudio" parent="Theme.VLC.AdvancedOptions">
<item name="android:windowBackground">@drawable/advanced_options_audio_background</item>
<style name="Theme.VLC.AdvancedOptionsLight" parent="Theme.VLC.AdvancedOptions">
<item name="android:windowBackground">@drawable/abs__menu_dropdown_panel_holo_light</item>
<item name="android:textColor">@color/black</item>
<item name="advanced_options_divider">@color/darkgrey</item>
<item name="ic_speed_normal_style">@drawable/ic_speed_normal</item>
......@@ -168,8 +174,8 @@
</style>
<style name="Theme.VLC.AdvancedOptionsVideo" parent="Theme.VLC.AdvancedOptions">
<item name="android:windowBackground">@drawable/advanced_options_video_background</item>
<style name="Theme.VLC.AdvancedOptionsBlack" parent="Theme.VLC.AdvancedOptions">
<item name="android:windowBackground">@drawable/abs__menu_dropdown_panel_holo_dark</item>
<item name="android:textColor">@color/white</item>
<item name="advanced_options_divider">@color/white</item>
<item name="ic_speed_normal_style">@drawable/ic_speed_normal_w</item>
......
......@@ -25,6 +25,7 @@ import java.net.URI;
import java.net.URISyntaxException;
import org.videolan.vlc.R;
import org.videolan.vlc.Util;
import org.videolan.vlc.VlcRunnable;
import org.videolan.vlc.interfaces.OnExpandableListener;
import org.videolan.vlc.widget.ExpandableLayout;
......@@ -85,8 +86,7 @@ public class CommonDialogs {
public static void advancedOptions(final Context context, View v, MenuType t) {
int style = t == MenuType.Video ?
R.style.Theme_VLC_AdvancedOptionsVideo : R.style.Theme_VLC_AdvancedOptionsAudio;
int style = Util.getResourceFromAttribute(context, R.attr.advanced_options_style);
final Dialog dialog = new Dialog(context, style);
dialog.setContentView(R.layout.advanced_options);
......@@ -162,12 +162,9 @@ public class CommonDialogs {
// show dialog
dialog.show();
// force size
// force location
float density = context.getResources().getDisplayMetrics().density;
LayoutParams lp = dialog.getWindow().getAttributes();
lp.width = (int) (density * 300 + 0.5f); // 300dp
// force location
if (v != null) {
lp.gravity = Gravity.TOP | Gravity.LEFT;
int[] location = new int[2];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment