[Android] Sliding pane: do not open partially the pane if it is already fully open
Adrien Maglo
git at videolan.org
Thu Jan 9 17:53:14 CET 2014
vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Thu Jan 9 17:53:06 2014 +0100| [699f3d82de2dc69db91a2254f8a21dea546ac586] | committer: Adrien Maglo
Sliding pane: do not open partially the pane if it is already fully open
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=699f3d82de2dc69db91a2254f8a21dea546ac586
---
vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java b/vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java
index 8c15c5f..286e69e 100644
--- a/vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java
+++ b/vlc-android/src/org/videolan/vlc/widget/SlidingPaneLayout.java
@@ -503,6 +503,8 @@ public class SlidingPaneLayout extends ViewGroup {
}
private boolean openPane(View pane, int initialVelocity) {
+ if (isOpen()) // Do not open the pane if it is already open.
+ return false;
if (mFirstLayout || smoothSlideTo(1 - (float)mOverhangSize / mSlideRange, initialVelocity))
return true;
return false;
@@ -539,13 +541,13 @@ public class SlidingPaneLayout extends ViewGroup {
}
/**
- * Check if the layout is completely open. It can be open either because the slider
+ * Check if the layout is open. It can be open either because the slider
* itself is open revealing the left pane, or if all content fits without sliding.
*
* @return true if sliding panels are completely open
*/
public boolean isOpen() {
- return !mCanSlide || mSlideOffset == 1;
+ return !mCanSlide || mSlideOffset < 1;
}
/**
More information about the Android
mailing list