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

Commit bb09a7cd authored by Andrei Stingaceanu's avatar Andrei Stingaceanu Committed by Android Git Automerger
Browse files

am bc687f96: Merge "Drag handles persist after lost focus in extracted mode" into mnc-dev

* commit 'bc687f96':
  Drag handles persist after lost focus in extracted mode
parents 6d45f279 bc687f96
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1121,7 +1121,6 @@ public class Editor {
                if (mTemporaryDetach) mPreserveDetachedSelection = false;
                downgradeEasyCorrectionSpans();
            }

            // No need to create the controller
            if (mSelectionModifierCursorController != null) {
                mSelectionModifierCursorController.resetTouchOffsets();
@@ -1793,7 +1792,7 @@ public class Editor {
     *
     * @return true if there already was a selection or if the current word was selected.
     */
    private boolean checkFieldAndSelectCurrentWord() {
    boolean checkFieldAndSelectCurrentWord() {
        if (!mTextView.canSelectText() || !mTextView.requestFocus()) {
            Log.w(TextView.LOG_TAG,
                    "TextView does not support text selection. Selection cancelled.");
@@ -1840,7 +1839,7 @@ public class Editor {
        return selectionStarted;
    }

    private boolean extractedTextModeWillBeStarted() {
    boolean extractedTextModeWillBeStarted() {
        if (!(mTextView.isInExtractedMode())) {
            final InputMethodManager imm = InputMethodManager.peekInstance();
            return  imm != null && imm.isFullscreenMode();
+5 −1
Original line number Diff line number Diff line
@@ -5232,7 +5232,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        // - onFocusChanged cannot start it when focus is given to a view with selected text (after
        //   a screen rotation) since layout is not yet initialized at that point.
        if (mEditor != null && mEditor.mCreatedWithASelection) {
            if (mEditor.extractedTextModeWillBeStarted()) {
                mEditor.checkFieldAndSelectCurrentWord();
            } else {
                mEditor.startSelectionActionMode();
            }
            mEditor.mCreatedWithASelection = false;
        }