diff options
author | Mark Renouf <mrenouf@google.com> | 2014-06-18 10:43:29 -0400 |
---|---|---|
committer | Mark Renouf <mrenouf@google.com> | 2014-06-18 16:08:06 +0000 |
commit | 6c5c48a8b05e7668de551c3bf37aa3f33c7f0920 (patch) | |
tree | 840faf477633c0060d5789e2388a4c23c5f52590 | |
parent | f546eeb1ede3c33ca3ec7fff6b8deb9d4e5cbc3e (diff) | |
download | frameworks_base-6c5c48a8b05e7668de551c3bf37aa3f33c7f0920.zip frameworks_base-6c5c48a8b05e7668de551c3bf37aa3f33c7f0920.tar.gz frameworks_base-6c5c48a8b05e7668de551c3bf37aa3f33c7f0920.tar.bz2 |
Limit swipe dismiss progress to positive values
BUG: 15716749
Change-Id: Ibd6daa1a515611e5c9b8a02c6df75130aa8c093b
-rw-r--r-- | core/java/com/android/internal/widget/SwipeDismissLayout.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/java/com/android/internal/widget/SwipeDismissLayout.java b/core/java/com/android/internal/widget/SwipeDismissLayout.java index 002573e..97b1634 100644 --- a/core/java/com/android/internal/widget/SwipeDismissLayout.java +++ b/core/java/com/android/internal/widget/SwipeDismissLayout.java @@ -45,10 +45,9 @@ public class SwipeDismissLayout extends FrameLayout { /** * Called when the layout has been swiped and the position of the window should change. * - * @param progress A number in [-1, 1] representing how far to the left - * or right the window has been swiped. Negative values are swipes - * left, and positives are right. - * @param translate A number in [-w, w], where w is the width of the + * @param progress A number in [0, 1] representing how far to the + * right the window has been swiped + * @param translate A number in [0, w], where w is the width of the * layout. This is equivalent to progress * layout.getWidth(). */ void onSwipeProgressChanged(SwipeDismissLayout layout, float progress, float translate); @@ -207,7 +206,7 @@ public class SwipeDismissLayout extends FrameLayout { private void setProgress(float deltaX) { mTranslationX = deltaX; - if (mProgressListener != null) { + if (mProgressListener != null && deltaX >= 0) { mProgressListener.onSwipeProgressChanged(this, deltaX / getWidth(), deltaX); } } |