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

Commit 040023a4 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

A tap on the insertion handle is only handled if it has not been moved

Without this test, an arbitrary drag of the handle that happens to end next to
where it started triggers the replace/paste action popup window, which is very
confusing.

Change-Id: Ib1f848147a1c12c231a28f2e730eccaf5321f85c
parent ff7fffab
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -9667,6 +9667,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            }
        }

        public boolean offsetHasBeenChanged() {
            return mNumberPreviousOffsets > 1;
        }

        @Override
        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
            setMeasuredDimension(mDrawable.getIntrinsicWidth(), mDrawable.getIntrinsicHeight());
@@ -9975,6 +9979,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    break;

                case MotionEvent.ACTION_UP:
                    if (!offsetHasBeenChanged()) {
                        final float deltaX = mDownPositionX - ev.getRawX();
                        final float deltaY = mDownPositionY - ev.getRawY();
                        final float distanceSquared = deltaX * deltaX + deltaY * deltaY;
@@ -9986,6 +9991,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                                show(0);
                            }
                        }
                    }
                    hideAfterDelay();
                    break;