summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mark Renouf <mrenouf@google.com> 2014-06-18 21:09:39 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2014-06-18 21:09:39 +0000
commitd1e01b7631665b9e41b13968dac1e2fa5964bb00 (patch)
treec3aa7ce0ac391964be41c4f0ff7f34642cd8c3c9
parent538df1927b878974bf40bd4bb515a7b9b30a0874 (diff)
parent7deaf7c5304aed9ca2ed6dc0e6c5e853127e6020 (diff)
am 7deaf7c5: am f2dcb390: Merge "Limit swipe dismiss progress to positive values" into klp-modular-dev
* commit '7deaf7c5304aed9ca2ed6dc0e6c5e853127e6020': Limit swipe dismiss progress to positive values
-rw-r--r--core/java/com/android/internal/widget/SwipeDismissLayout.java9
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 002573ebb068..97b1634f99cc 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);
}
}