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

Commit 83830727 authored by Andrei Stingaceanu's avatar Andrei Stingaceanu
Browse files

Floating toolbar shown after rotation in extract mode

Do not start the floating toolbar action mode and
do not show the handles if after a rotation when the
extract mode will be started. This fixes an issue where
onTouch after rotate duplicates the handles in extracted
mode.

Note: if NO_EXTRACT_UI flag is set then the toolbar,
selection and handles preserve their state.

Bug: 21960251
Change-Id: I1c7881bf2f40d8877fa0ce26e27a29398edc1296
parent 2c3c66a2
Loading
Loading
Loading
Loading
+29 −24
Original line number Diff line number Diff line
@@ -4517,7 +4517,10 @@ public class Editor {
            final float eventY = event.getY();
            switch (event.getActionMasked()) {
                case MotionEvent.ACTION_DOWN:

                    if (extractedTextModeWillBeStarted()) {
                        // Prevent duplicating the selection handles until the mode starts.
                        hide();
                    } else {
                        // Remember finger down position, to be able to start selection from there.
                        mMinTouchOffset = mMaxTouchOffset = mTextView.getOffsetForPosition(
                                eventX, eventY);
@@ -4532,7 +4535,8 @@ public class Editor {
                                ViewConfiguration viewConfiguration = ViewConfiguration.get(
                                        mTextView.getContext());
                                int doubleTapSlop = viewConfiguration.getScaledDoubleTapSlop();
                            boolean stayedInArea = distanceSquared < doubleTapSlop * doubleTapSlop;
                                boolean stayedInArea =
                                        distanceSquared < doubleTapSlop * doubleTapSlop;

                                if (stayedInArea && isPositionOnText(eventX, eventY)) {
                                    selectCurrentWordAndStartDrag();
@@ -4545,6 +4549,7 @@ public class Editor {
                        mDownPositionY = eventY;
                        mGestureStayedInTapRegion = true;
                        mHaventMovedEnoughToStartDrag = true;
                    }
                    break;

                case MotionEvent.ACTION_POINTER_DOWN: