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

Commit 4bb2833f authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Restored selectAllOnFocus

Bug introduced in recent refactoring
https://android-git.corp.google.com/g/#/c/158896/

Do not move cursor when selectAllOnFocus and focus just happened.
The didTouchFocusSelect() condition was not copied over from ArrowKeyMM.

Change-Id: Id01d225c436ae3dd97c5d77d5dac5d0690d7de76
parent a6b8fe1c
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -8377,10 +8377,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            }

            if (touchIsFinished && (isTextEditable() || mTextIsSelectable)) {
                // Move cursor
                final int offset = getOffsetForPosition(event.getX(), event.getY());
                Selection.setSelection((Spannable) mText, offset);

                // Show the IME, except when selecting in read-only text.
                final InputMethodManager imm = InputMethodManager.peekInstance();
                viewClicked(imm);
@@ -8399,6 +8395,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                        if (isCursorInsideEasyCorrectionSpan()) {
                            showSuggestions();
                        } else if (hasInsertionController()) {
                            // Move cursor
                            final int offset = getOffsetForPosition(event.getX(), event.getY());
                            Selection.setSelection((Spannable) mText, offset);
                            getInsertionController().show();
                        }
                    }