From bacaa78ce460c1730e73e683336d045859ecf8eb Mon Sep 17 00:00:00 2001 From: Adrien Maglo Date: Wed, 19 Feb 2014 18:27:36 +0100 Subject: [PATCH] Advanced options menu: use different styles for audio and video mode --- .../advanced_options_audio_background.xml | 11 ++ .../advanced_options_video_background.xml | 11 ++ vlc-android/res/layout/advanced_options.xml | 107 +++++++++--------- vlc-android/res/values/attrs.xml | 1 + vlc-android/res/values/colors.xml | 2 + vlc-android/res/values/styles.xml | 27 +++-- .../org/videolan/vlc/gui/CommonDialogs.java | 22 ++-- 7 files changed, 104 insertions(+), 77 deletions(-) create mode 100644 vlc-android/res/drawable/advanced_options_audio_background.xml create mode 100644 vlc-android/res/drawable/advanced_options_video_background.xml diff --git a/vlc-android/res/drawable/advanced_options_audio_background.xml b/vlc-android/res/drawable/advanced_options_audio_background.xml new file mode 100644 index 000000000..38cc46966 --- /dev/null +++ b/vlc-android/res/drawable/advanced_options_audio_background.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/vlc-android/res/drawable/advanced_options_video_background.xml b/vlc-android/res/drawable/advanced_options_video_background.xml new file mode 100644 index 000000000..b3dd93522 --- /dev/null +++ b/vlc-android/res/drawable/advanced_options_video_background.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/vlc-android/res/layout/advanced_options.xml b/vlc-android/res/layout/advanced_options.xml index 62d4be9d1..ed2a1d7fa 100644 --- a/vlc-android/res/layout/advanced_options.xml +++ b/vlc-android/res/layout/advanced_options.xml @@ -1,62 +1,57 @@ - + android:layout_height="wrap_content" + android:orientation="vertical" > - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - \ 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" /> + + + + \ No newline at end of file diff --git a/vlc-android/res/values/attrs.xml b/vlc-android/res/values/attrs.xml index abe912df7..5b74050ff 100644 --- a/vlc-android/res/values/attrs.xml +++ b/vlc-android/res/values/attrs.xml @@ -16,6 +16,7 @@ + diff --git a/vlc-android/res/values/colors.xml b/vlc-android/res/values/colors.xml index 6ded0c38f..5ed926356 100644 --- a/vlc-android/res/values/colors.xml +++ b/vlc-android/res/values/colors.xml @@ -17,7 +17,9 @@ #ff8800 #ff7200 #000001 + #FFFFFF #8000 #FFFFFF + #ffa0a0a0 \ No newline at end of file diff --git a/vlc-android/res/values/styles.xml b/vlc-android/res/values/styles.xml index c1346426b..0f31a1397 100644 --- a/vlc-android/res/values/styles.xml +++ b/vlc-android/res/values/styles.xml @@ -85,13 +85,24 @@ @color/action_bar_title - + + + + diff --git a/vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java b/vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java index 59a41ff1c..662fbd635 100644 --- a/vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java +++ b/vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java @@ -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 -- GitLab