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

Commit a0b77dd5 authored by Clara Bayarri's avatar Clara Bayarri Committed by Android (Google) Code Review
Browse files

Merge "Fix TextView ActionMode overflow finishes the ActionMode" into mnc-dev

parents d63a1776 a447937d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -390,6 +390,7 @@ public class Editor {

        mPreserveDetachedSelection = true;
        hideControllers();
        stopSelectionActionMode();
        mPreserveDetachedSelection = false;
        mTemporaryDetach = false;
    }
@@ -624,7 +625,6 @@ public class Editor {
            mSuggestionsPopupWindow.hide();
        }
        hideInsertionPointCursorController();
        stopSelectionActionMode();
    }

    /**
@@ -1101,10 +1101,12 @@ public class Editor {
                final int selStart = mTextView.getSelectionStart();
                final int selEnd = mTextView.getSelectionEnd();
                hideControllers();
                stopSelectionActionMode();
                Selection.setSelection((Spannable) mTextView.getText(), selStart, selEnd);
            } else {
                if (mTemporaryDetach) mPreserveDetachedSelection = true;
                hideControllers();
                stopSelectionActionMode();
                if (mTemporaryDetach) mPreserveDetachedSelection = false;
                downgradeEasyCorrectionSpans();
            }
@@ -1147,6 +1149,7 @@ public class Editor {
        // We do not hide the span controllers, since they can be added when a new text is
        // inserted into the text view (voice IME).
        hideCursorControllers();
        stopSelectionActionMode();
    }

    private int getLastTapPosition() {
@@ -1878,6 +1881,7 @@ public class Editor {
    void onTouchUpEvent(MotionEvent event) {
        boolean selectAllGotFocus = mSelectAllOnFocus && mTextView.didTouchFocusSelect();
        hideControllers();
        stopSelectionActionMode();
        CharSequence text = mTextView.getText();
        if (!selectAllGotFocus && text.length() > 0) {
            // Move cursor
@@ -1998,6 +2002,7 @@ public class Editor {
            mSuggestionsPopupWindow = new SuggestionsPopupWindow();
        }
        hideControllers();
        stopSelectionActionMode();
        mSuggestionsPopupWindow.show();
    }

+2 −0
Original line number Diff line number Diff line
@@ -6423,6 +6423,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        // extracted mode will start. Some text is selected though, and will trigger an action mode
        // in the extracted view.
        mEditor.hideControllers();
        stopSelectionActionMode();
    }

    /**
@@ -8257,6 +8258,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        super.onVisibilityChanged(changedView, visibility);
        if (mEditor != null && visibility != VISIBLE) {
            mEditor.hideControllers();
            stopSelectionActionMode();
        }
    }