[Android] Audio GUI: slide down the player to show the equalizer

Adrien Maglo git at videolan.org
Tue Jan 28 16:15:45 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Tue Jan 28 16:15:37 2014 +0100| [17e8d8a197b88c26a9e3784757354ba454e173be] | committer: Adrien Maglo

Audio GUI: slide down the player to show the equalizer

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

 .../src/org/videolan/vlc/gui/MainActivity.java     |   25 +++++++++++++++-----
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 034b503..1d7f117 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -219,9 +219,8 @@ public class MainActivity extends SherlockFragmentActivity {
                  */
                 getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
 
-                /* Hide the mini player */
-                if(mSlidingPane.getState() == mSlidingPane.STATE_CLOSED)
-                    mSlidingPane.openPane();
+                /* Slide down the mini player */
+                slideDownMiniPlayer();
 
                 /* Switch the fragment */
                 FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
@@ -412,10 +411,8 @@ public class MainActivity extends SherlockFragmentActivity {
         }
 
         // Slide down the mini player if it is shown entirely.
-        if (mSlidingPane.getState() == mSlidingPane.STATE_CLOSED) {
-            mSlidingPane.openPane();
+        if (slideDownMiniPlayer())
             return;
-        }
 
         // If it's the directory view, a "backpressed" action shows a parent.
         if (mCurrentFragment.equals("directories")) {
@@ -449,6 +446,10 @@ public class MainActivity extends SherlockFragmentActivity {
         } catch (IllegalAccessException e) {
             Log.e(TAG, "Failed to instantiate "+fragmentClass.getName()+", ShowFragment("+tag+") aborted.");
         }
+
+        // Slide down the mini player if needed.
+        slideDownMiniPlayer();
+
         ShowFragment(this, tag, fragment);
     }
 
@@ -792,6 +793,18 @@ public class MainActivity extends SherlockFragmentActivity {
     }
 
     /**
+     * Slide down the mini player.
+     * @return true on success else false.
+     */
+    public boolean slideDownMiniPlayer() {
+        if (mSlidingPane.getState() == mSlidingPane.STATE_CLOSED) {
+            mSlidingPane.openPane();
+            return true;
+        }
+        return false;
+    }
+
+    /**
      * Hide the mini player.
      */
     public void hideMiniPlayer() {



More information about the Android mailing list