[Android] move Equalizer to ActionBar menu

Sébastien Toque git at videolan.org
Wed Sep 11 19:47:41 CEST 2013


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Wed Sep 11 19:45:49 2013 +0200| [c8807e48ad0debc4419942ba970e30312cea9507] | committer: Sébastien Toque

move Equalizer to ActionBar menu

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

 vlc-android/res/menu/media_library.xml                   |    3 +++
 vlc-android/res/values/strings.xml                       |    1 +
 vlc-android/src/org/videolan/vlc/gui/MainActivity.java   |    8 ++++++++
 vlc-android/src/org/videolan/vlc/gui/SidebarAdapter.java |    4 ----
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/vlc-android/res/menu/media_library.xml b/vlc-android/res/menu/media_library.xml
index 44ebb83..a8d9e1f 100644
--- a/vlc-android/res/menu/media_library.xml
+++ b/vlc-android/res/menu/media_library.xml
@@ -34,6 +34,9 @@
         android:title="@string/refresh"
         android:showAsAction="ifRoom" />
     <item
+        android:id="@+id/ml_menu_equalizer"
+        android:title="@string/equalizer" />
+    <item
         android:id="@+id/ml_menu_preferences"
         android:icon="@android:drawable/ic_menu_preferences"
         android:title="@string/preferences" />
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index dd9851c..a706adc 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -67,6 +67,7 @@
     <string name="audio">Audio</string>
     <string name="video">Video</string>
     <string name="bookmarks">Bookmarks</string>
+    <string name="equalizer">Equalizer</string>
     <string name="all_albums">All albums</string>
     <string name="genres">Genres</string>
     <string name="playlists">Playlists</string>
diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 0bc69ba..aa4488a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -32,6 +32,7 @@ import org.videolan.vlc.VLCCallbackTask;
 import org.videolan.vlc.WeakHandler;
 import org.videolan.vlc.gui.SidebarAdapter.SidebarEntry;
 import org.videolan.vlc.gui.audio.AudioPlayerFragment;
+import org.videolan.vlc.gui.audio.EqualizerFragment;
 import org.videolan.vlc.gui.video.VideoListAdapter;
 import org.videolan.vlc.interfaces.ISortable;
 import org.videolan.vlc.widget.AudioMiniPlayer;
@@ -477,6 +478,13 @@ public class MainActivity extends SherlockFragmentActivity {
                 intent = new Intent(this, PreferencesActivity.class);
                 startActivityForResult(intent, ACTIVITY_RESULT_PREFERENCES);
                 break;
+            case R.id.ml_menu_equalizer:
+                FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
+                ft.setCustomAnimations(R.anim.anim_enter_right, R.anim.anim_leave_left, R.anim.anim_enter_left, R.anim.anim_leave_right);
+                ft.replace(R.id.fragment_placeholder, new EqualizerFragment(), "equalizer");
+                ft.addToBackStack(null);
+                ft.commit();
+                break;
             // Refresh
             case R.id.ml_menu_refresh:
                 // TODO: factor this into each fragment
diff --git a/vlc-android/src/org/videolan/vlc/gui/SidebarAdapter.java b/vlc-android/src/org/videolan/vlc/gui/SidebarAdapter.java
index bd9d0cd..060d757 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SidebarAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SidebarAdapter.java
@@ -28,7 +28,6 @@ import org.videolan.vlc.R;
 import org.videolan.vlc.Util;
 import org.videolan.vlc.VLCApplication;
 import org.videolan.vlc.gui.audio.AudioBrowserFragment;
-import org.videolan.vlc.gui.audio.EqualizerFragment;
 import org.videolan.vlc.gui.video.VideoGridFragment;
 
 import android.graphics.drawable.Drawable;
@@ -71,7 +70,6 @@ public class SidebarAdapter extends BaseAdapter {
             new SidebarEntry( "audio", R.string.audio, R.drawable.header_icon_audio ),
             new SidebarEntry( "directories", R.string.directories, R.drawable.ic_folder ),
             new SidebarEntry( "history", R.string.history, android.R.drawable.ic_menu_recent_history ),
-            new SidebarEntry( "equalizer", "Equalizer", R.drawable.ic_bookmarks ),
             //new SidebarEntry( "bookmarks", R.string.bookmarks, R.drawable.ic_bookmarks ),
             //new SidebarEntry( "playlists", R.string.playlists, R.drawable.icon ),
         };
@@ -131,8 +129,6 @@ public class SidebarAdapter extends BaseAdapter {
             f = new DirectoryViewFragment();
         } else if(id.equals("history")) {
             f = new HistoryFragment();
-        } else if(id.equals("equalizer")) {
-            f = new EqualizerFragment();
         } else { /* TODO */
             f = new AboutLicenceFragment();
         }



More information about the Android mailing list