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

Commit 58b971d7 authored by Eric Fischer's avatar Eric Fischer
Browse files

Always clear the TextView drag state whenever a touch begins.

Apparently it can sometimes miss a touch release, which would prevent
the longpress menu from appearing if the location of the new touch was
too far from the location of the previous touch.

Bug 1673223
parent 1dac277f
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -81,6 +81,12 @@ public class Touch {


        switch (event.getAction()) {
        switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
        case MotionEvent.ACTION_DOWN:
            ds = buffer.getSpans(0, buffer.length(), DragState.class);

            for (int i = 0; i < ds.length; i++) {
                buffer.removeSpan(ds[i]);
            }

            buffer.setSpan(new DragState(event.getX(), event.getY(),
            buffer.setSpan(new DragState(event.getX(), event.getY(),
                            widget.getScrollX(), widget.getScrollY()),
                            widget.getScrollX(), widget.getScrollY()),
                    0, 0, Spannable.SPAN_MARK_MARK);
                    0, 0, Spannable.SPAN_MARK_MARK);