[Android] Hide menu when clicking on already shown fragment

Jean-Baptiste Kempf git at videolan.org
Fri Sep 28 20:38:25 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Sep 28 20:36:45 2012 +0200| [06851a14895254278d557c22c49321c2f0b87a85] | committer: Jean-Baptiste Kempf

Hide menu when clicking on already shown fragment

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index d652f38..7add3c9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -195,9 +195,11 @@ public class MainActivity extends SherlockFragmentActivity {
                     int position, long id) {
                 SidebarAdapter.SidebarEntry entry = (SidebarEntry) listView.getItemAtPosition(position);
                 Fragment current = getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder);
-             
-                if(current == null || current.getTag() == entry.id) /* Already selected */
+
+                if(current == null || current.getTag() == entry.id) { /* Already selected */
+                    mMenu.showAbove();
                     return;
+                }
 
                 /* Clear any backstack before switching tabs.
                  * This way it's more consistent for the user, who might have



More information about the Android mailing list