diff options
| author | 2015-04-30 11:14:14 -0400 | |
|---|---|---|
| committer | 2015-04-30 11:14:14 -0400 | |
| commit | 026e204ee461e101fe251742f6ffb09b1747c804 (patch) | |
| tree | f586d1b2b04f6ebbb2a99fc3e44b07404e3539dd | |
| parent | a03e2658af7a3d223655e77725e2be6d0863455b (diff) | |
Fixes velocity tracking bug in SwipeDismissLayout.
This is the framework version of ag/682710.
Original change description:
This change adds a missing call to offsetLocation() when tracking
swipe velocities on a SwipeDismissLayout. This bug was causing
incorrect velocities to be measured which often resulted in an
incorrectly interpreted leftward swipe cancelling the dismiss
gesture.
Bug: 20350515
Change-Id: I4f3e3668a1f9aab963fdfa9095a43f4c5344703f
| -rw-r--r-- | core/java/com/android/internal/widget/SwipeDismissLayout.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/com/android/internal/widget/SwipeDismissLayout.java b/core/java/com/android/internal/widget/SwipeDismissLayout.java index 191662c1e621..6d4e0583b4e1 100644 --- a/core/java/com/android/internal/widget/SwipeDismissLayout.java +++ b/core/java/com/android/internal/widget/SwipeDismissLayout.java @@ -216,6 +216,8 @@ public class SwipeDismissLayout extends FrameLayout { if (mVelocityTracker == null) { return super.onTouchEvent(ev); } + // offset because the view is translated during swipe + ev.offsetLocation(mTranslationX, 0); switch (ev.getActionMasked()) { case MotionEvent.ACTION_UP: updateDismiss(ev); |