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

Commit b61d00b7 authored by Annie Chin's avatar Annie Chin
Browse files

Cancel drag in DragLayout if pointer is invalid.

Test: Verify that regular drags/flings still work.
Fixes: 34822153

Change-Id: I61c4ee3904793a8253406a18c06d314dedf29b63
parent 7b5ff1f8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -164,7 +164,17 @@ public class DragLayout extends ViewGroup {

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        // Workaround: do not process the error case where multi-touch would cause a crash.
        if (event.getActionMasked() == MotionEvent.ACTION_MOVE
                && mDragHelper.getViewDragState() == ViewDragHelper.STATE_DRAGGING
                && mDragHelper.getActivePointerId() != ViewDragHelper.INVALID_POINTER
                && event.findPointerIndex(mDragHelper.getActivePointerId()) == -1) {
            mDragHelper.cancel();
            return false;
        }

        saveLastMotion(event);

        mDragHelper.processTouchEvent(event);
        return true;
    }
+1 −1

File changed.

Contains only whitespace changes.