am 026e204e: Fixes velocity tracking bug in SwipeDismissLayout.

* commit '026e204ee461e101fe251742f6ffb09b1747c804':
  Fixes velocity tracking bug in SwipeDismissLayout.
This commit is contained in:
Gus Prevas
2015-04-30 15:42:03 +00:00
committed by Android Git Automerger

View File

@ -216,6 +216,8 @@ public class SwipeDismissLayout extends FrameLayout {
if (mVelocityTracker == null) { if (mVelocityTracker == null) {
return super.onTouchEvent(ev); return super.onTouchEvent(ev);
} }
// offset because the view is translated during swipe
ev.offsetLocation(mTranslationX, 0);
switch (ev.getActionMasked()) { switch (ev.getActionMasked()) {
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
updateDismiss(ev); updateDismiss(ev);