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

Commit d9821c99 authored by Steve Kondik's avatar Steve Kondik
Browse files

Revert "TextView: don't show context menu for double-tap"

This reverts commit 5e6a0a63.
parent fcf6a684
Loading
Loading
Loading
Loading
+13 −22
Original line number Diff line number Diff line
@@ -8187,7 +8187,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                        mMinTouchOffset = mMaxTouchOffset = getOffset(x, y);

                        // Double tap detection
                        if (mPreviousTapUpTime != 0) {
                        long duration = SystemClock.uptimeMillis() - mPreviousTapUpTime;
                        if (duration <= ViewConfiguration.getDoubleTapTimeout()) {
                            final int deltaX = x - mPreviousTapPositionX;
@@ -8198,12 +8197,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                            if (distanceSquared < slopSquared) {
                                startTextSelectionMode();
                                // Hacky: onTapUpEvent will open a context menu with cut/copy
                                    // Prevent this by eating the event.
                                    mEatTouchRelease = true;
                                }
                                // Prevent this by hiding handles which will be revived instead.
                                hide();
                            }
                        }

                        mPreviousTapPositionX = x;
                        mPreviousTapPositionY = y;

@@ -8220,13 +8217,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                        break;

                    case MotionEvent.ACTION_UP:
                        // If this was a double-tap event, don't consider
                        // the next touch event to be a double-tap.
                        if (mEatTouchRelease) {
                            mPreviousTapUpTime = 0;
                        } else {
                        mPreviousTapUpTime = SystemClock.uptimeMillis();
                        }
                        break;
                }
            }