Commit bacaa78c authored by Adrien Maglo's avatar Adrien Maglo

Advanced options menu: use different styles for audio and video mode

parent 4d49b64f
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@color/background_player" />
<stroke
android:width="1dp"
android:color="@color/darkgrey" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@color/black" />
<stroke
android:width="1dp"
android:color="@color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/advanced_layout"
android:layout_width="300dp"
android:layout_height="wrap_content" >
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/advanced_layout"
<org.videolan.vlc.gui.expandable.SpeedSelector
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/advanced_options_divider"
tools:ignore="PxUsage" />
<org.videolan.vlc.gui.expandable.TimeSleep
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/advanced_options_divider"
tools:ignore="PxUsage" />
<org.videolan.vlc.gui.expandable.JumpToTime
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/advanced_options_divider"
tools:ignore="PxUsage" />
<TextView
android:id="@+id/add_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<org.videolan.vlc.gui.expandable.SpeedSelector
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#8FFF"
tools:ignore="PxUsage" />
<org.videolan.vlc.gui.expandable.TimeSleep
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#8FFF"
tools:ignore="PxUsage" />
<org.videolan.vlc.gui.expandable.JumpToTime
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#8FFF"
tools:ignore="PxUsage" />
<TextView
android:id="@+id/add_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/background_item"
android:text="@string/subtitle_label"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/equalizer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/background_item"
android:text="@string/equalizer"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</ScrollView>
\ No newline at end of file
android:layout_margin="10dp"
android:background="@drawable/background_item"
android:text="@string/subtitle_label"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/equalizer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/background_item"
android:text="@string/equalizer"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
\ No newline at end of file
......@@ -16,6 +16,7 @@
<attr name="darkorange" format="reference|color" />
<attr name="darkerorange" format="reference|color" />
<attr name="transparent_gray" format="reference|color" />
<attr name="advanced_options_divider" format="reference|color" />
<declare-styleable name="SlidingPaneLayout">
<attr name="overhangSize" format="dimension" />
......
......@@ -17,7 +17,9 @@
<color name="darkorange">#ff8800</color>
<color name="darkerorange">#ff7200</color>
<color name="black">#000001</color>
<color name="white">#FFFFFF</color>
<color name="transparent_gray">#8000</color>
<color name="action_bar_title">#FFFFFF</color>
<color name="darkgrey">#ffa0a0a0</color>
</resources>
\ No newline at end of file
......@@ -85,13 +85,24 @@
<item name="android:textColor">@color/action_bar_title</item>
</style>
<style name="Theme.VLC.AlertMenu" parent="android:Theme.Dialog">
<item name="android:windowBackground">@null</item>
<item name="android:windowFrame">@null</item>
<item name="windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@null</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<!-- Advanced options menu styles -->
<style name="Theme.VLC.AdvancedOptions" parent="@android:style/Theme.Dialog">
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowIsTranslucent">false</item>
<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>
<item name="android:textColor">@color/black</item>
<item name="advanced_options_divider">@color/darkgrey</item>
</style>
<style name="Theme.VLC.AdvancedOptionsVideo" parent="Theme.VLC.AdvancedOptions">
<item name="android:windowBackground">@drawable/advanced_options_video_background</item>
<item name="android:textColor">@color/white</item>
<item name="advanced_options_divider">@color/white</item>
</style>
</resources>
......@@ -25,14 +25,13 @@ import java.net.URI;
import java.net.URISyntaxException;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.VlcRunnable;
import org.videolan.vlc.interfaces.OnExpandableListener;
import org.videolan.vlc.widget.ExpandableLayout;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
......@@ -40,9 +39,7 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.util.Log;
import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager.LayoutParams;
import android.widget.LinearLayout;
......@@ -87,17 +84,16 @@ public class CommonDialogs {
}
public static void advancedOptions(final Context context, View v, MenuType t) {
LayoutInflater inflater = LayoutInflater.from(VLCApplication.getAppContext());
View view = inflater.inflate(R.layout.advanced_options, null);
// build dialog
Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(context, R.style.Theme_VLC_AlertMenu))
.setView(view);
final AlertDialog dialog = builder.create();
int style = t == MenuType.Video ?
R.style.Theme_VLC_AdvancedOptionsVideo : R.style.Theme_VLC_AdvancedOptionsAudio;
final Dialog dialog = new Dialog(context, style);
dialog.setContentView(R.layout.advanced_options);
dialog.setCanceledOnTouchOutside(true);
// register listener on each ExpandableLayout in advanced_layout
LinearLayout advanced_layout = (LinearLayout) view.findViewById(R.id.advanced_layout);
LinearLayout advanced_layout = (LinearLayout) dialog.findViewById(R.id.advanced_layout);
OnExpandableListener mExpandableListener = new OnExpandableListener() {
@Override
public void onDismiss() {
......@@ -112,8 +108,8 @@ public class CommonDialogs {
}
}
TextView add_subtitle = (TextView)view.findViewById(R.id.add_subtitle);
TextView equalizer = (TextView)view.findViewById(R.id.equalizer);
TextView add_subtitle = (TextView)dialog.findViewById(R.id.add_subtitle);
TextView equalizer = (TextView)dialog.findViewById(R.id.equalizer);
if(t == MenuType.Video) {
add_subtitle.setOnClickListener(new View.OnClickListener() {
@Override
......
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