[Android] Equalizer for audio advanced options

Geoffrey Métais git at videolan.org
Fri Apr 10 18:19:28 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Apr 10 17:49:13 2015 +0200| [f11d1ee5a9426fa9a04bb57ec149a249d84fcbec] | committer: Geoffrey Métais

Equalizer for audio advanced options

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

 vlc-android/res/layout/fragment_advanced_options.xml       |    9 +++++++++
 vlc-android/res/values/styles.xml                          |    3 +++
 .../src/org/videolan/vlc/gui/video/AdvOptionsDialog.java   |   12 ++++++++++++
 3 files changed, 24 insertions(+)

diff --git a/vlc-android/res/layout/fragment_advanced_options.xml b/vlc-android/res/layout/fragment_advanced_options.xml
index 20e1431..ccebb1e 100644
--- a/vlc-android/res/layout/fragment_advanced_options.xml
+++ b/vlc-android/res/layout/fragment_advanced_options.xml
@@ -218,4 +218,13 @@
             android:gravity="center_vertical"
             android:text="Subtitles delay" />
     </LinearLayout>
+
+    <TextView
+        android:id="@+id/opt_equalizer"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:gravity="center_vertical"
+        android:text="@string/equalizer"
+        android:drawableLeft="?attr/ic_equalizer_normal_style"/>
 </LinearLayout>
diff --git a/vlc-android/res/values/styles.xml b/vlc-android/res/values/styles.xml
index af60119..f26c683 100644
--- a/vlc-android/res/values/styles.xml
+++ b/vlc-android/res/values/styles.xml
@@ -72,6 +72,7 @@
         <item name="ic_speed_normal_style">@drawable/ic_speed_normal</item>
         <item name="ic_sleep_normal_style">@drawable/ic_sleep_normal</item>
         <item name="ic_jumpto_normal_style">@drawable/ic_jumpto_normal</item>
+        <item name="ic_equalizer_normal_style">@drawable/ic_equalizer_normal</item>
     </style>
 
     <style name="Theme.VLC.Black" parent="Theme.VLC.Black.7"/>
@@ -145,6 +146,7 @@
         <item name="ic_speed_normal_style">@drawable/ic_speed_normal_w</item>
         <item name="ic_sleep_normal_style">@drawable/ic_sleep_normal_w</item>
         <item name="ic_jumpto_normal_style">@drawable/ic_jumpto_normal_w</item>
+        <item name="ic_equalizer_normal_style">@drawable/ic_equalizer_normal_w</item>
     </style>
 
     <style name="Theme.VLC.List">
@@ -176,6 +178,7 @@
         <item name="ic_speed_normal_style">@drawable/ic_speed_normal_w</item>
         <item name="ic_sleep_normal_style">@drawable/ic_sleep_normal_w</item>
         <item name="ic_jumpto_normal_style">@drawable/ic_jumpto_normal_w</item>
+        <item name="ic_equalizer_normal_style">@drawable/ic_equalizer_normal_w</item>
     </style>
 
     <style name="ActionBar" parent="Widget.AppCompat.Light.ActionBar">
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 421ecbe..52570b3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/AdvOptionsDialog.java
@@ -48,6 +48,7 @@ import org.videolan.libvlc.LibVLC;
 import org.videolan.vlc.BuildConfig;
 import org.videolan.vlc.R;
 import org.videolan.vlc.VLCApplication;
+import org.videolan.vlc.gui.MainActivity;
 import org.videolan.vlc.gui.dialogs.AudioDelayDialog;
 import org.videolan.vlc.gui.dialogs.JumpToTimeDialog;
 import org.videolan.vlc.gui.dialogs.PickTimeFragment;
@@ -80,6 +81,7 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
 
     private int mMode = -1;
     private TextView mAudioMode;
+    private TextView mEqualizer;
 
     private TextView mSpeedTv;
     private SeekBar mSeek;
@@ -189,6 +191,12 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
 
         }
 
+        if (mMode == MODE_AUDIO){
+            mEqualizer = (TextView) root.findViewById(R.id.opt_equalizer);
+            mEqualizer.setOnClickListener(this);
+            mEqualizer.setOnFocusChangeListener(mFocusListener);
+        } else
+            root.findViewById(R.id.opt_equalizer).setVisibility(View.GONE);
         mHandler.sendEmptyMessage(TOGGLE_CANCEL);
         mTextColor = mSleepTitle.getCurrentTextColor();
 
@@ -390,6 +398,10 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
             case R.id.playback_switch_audio:
                 ((VideoPlayerActivity)getActivity()).switchToAudioMode();
                 break;
+            case R.id.opt_equalizer:
+                ((MainActivity)getActivity()).showSecondaryFragment("equalizer");
+                dismiss();
+                break;
         }
     }
 }



More information about the Android mailing list