Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 026e204e authored by Gus Prevas's avatar Gus Prevas
Browse files

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
parent a03e2658
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);