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

Commit ea118122 authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Handle tap and move cursor before showing suggestions"

parents 91391744 868121f2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -8402,6 +8402,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                boolean selectAllGotFocus = mSelectAllOnFocus && didTouchFocusSelect();
                hideControllers();
                if (!selectAllGotFocus && mText.length() > 0) {
                    // Move cursor
                    final int offset = getOffsetForPosition(event.getX(), event.getY());
                    Selection.setSelection((Spannable) mText, offset);
                    if (mSpellChecker != null) {
                        // When the cursor moves, the word that was typed may need spell check
                        mSpellChecker.onSelectionChanged();
@@ -8418,9 +8421,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                            postDelayed(mShowSuggestionRunnable,
                                    ViewConfiguration.getDoubleTapTimeout());
                        } else if (hasInsertionController()) {
                            // Move cursor
                            final int offset = getOffsetForPosition(event.getX(), event.getY());
                            Selection.setSelection((Spannable) mText, offset);
                            getInsertionController().show();
                        }
                    }