Loading core/java/android/text/method/ArrowKeyMovementMethod.java +2 −18 Original line number Diff line number Diff line Loading @@ -319,25 +319,9 @@ public class ArrowKeyMovementMethod implements MovementMethod { public void onTakeFocus(TextView view, Spannable text, int dir) { if ((dir & (View.FOCUS_FORWARD | View.FOCUS_DOWN)) != 0) { Layout layout = view.getLayout(); if (layout == null) { /* * This shouldn't be null, but do something sensible if it is. */ if (view.getLayout() == null) { // This shouldn't be null, but do something sensible if it is. Selection.setSelection(text, text.length()); } else { /* * Put the cursor at the end of the first line, which is * either the last offset if there is only one line, or the * offset before the first character of the second line * if there is more than one line. */ if (layout.getLineCount() == 1) { Selection.setSelection(text, text.length()); } else { Selection.setSelection(text, layout.getLineStart(1) - 1); } } } else { Selection.setSelection(text, text.length()); Loading core/java/android/widget/TextView.java +10 −2 Original line number Diff line number Diff line Loading @@ -6532,6 +6532,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (!mFrozenWithFocus || (selStart < 0 || selEnd < 0)) { boolean selMoved = mSelectionMoved; if (mSelectionModifierCursorController != null) { final int touchOffset = ((SelectionModifierCursorController) mSelectionModifierCursorController). getMinTouchOffset(); Selection.setSelection((Spannable) mText, touchOffset); } if (mMovement != null) { mMovement.onTakeFocus(this, (Spannable) mText, direction); } Loading Loading @@ -6750,7 +6757,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final int newSelEnd = getSelectionEnd(); CommitSelectionReceiver csr = null; if (newSelStart != oldSelStart || newSelEnd != oldSelEnd) { if (newSelStart != oldSelStart || newSelEnd != oldSelEnd || didTouchFocusSelect()) { csr = new CommitSelectionReceiver(oldSelStart, oldSelEnd, newSelStart, newSelEnd); } Loading Loading
core/java/android/text/method/ArrowKeyMovementMethod.java +2 −18 Original line number Diff line number Diff line Loading @@ -319,25 +319,9 @@ public class ArrowKeyMovementMethod implements MovementMethod { public void onTakeFocus(TextView view, Spannable text, int dir) { if ((dir & (View.FOCUS_FORWARD | View.FOCUS_DOWN)) != 0) { Layout layout = view.getLayout(); if (layout == null) { /* * This shouldn't be null, but do something sensible if it is. */ if (view.getLayout() == null) { // This shouldn't be null, but do something sensible if it is. Selection.setSelection(text, text.length()); } else { /* * Put the cursor at the end of the first line, which is * either the last offset if there is only one line, or the * offset before the first character of the second line * if there is more than one line. */ if (layout.getLineCount() == 1) { Selection.setSelection(text, text.length()); } else { Selection.setSelection(text, layout.getLineStart(1) - 1); } } } else { Selection.setSelection(text, text.length()); Loading
core/java/android/widget/TextView.java +10 −2 Original line number Diff line number Diff line Loading @@ -6532,6 +6532,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (!mFrozenWithFocus || (selStart < 0 || selEnd < 0)) { boolean selMoved = mSelectionMoved; if (mSelectionModifierCursorController != null) { final int touchOffset = ((SelectionModifierCursorController) mSelectionModifierCursorController). getMinTouchOffset(); Selection.setSelection((Spannable) mText, touchOffset); } if (mMovement != null) { mMovement.onTakeFocus(this, (Spannable) mText, direction); } Loading Loading @@ -6750,7 +6757,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final int newSelEnd = getSelectionEnd(); CommitSelectionReceiver csr = null; if (newSelStart != oldSelStart || newSelEnd != oldSelEnd) { if (newSelStart != oldSelStart || newSelEnd != oldSelEnd || didTouchFocusSelect()) { csr = new CommitSelectionReceiver(oldSelStart, oldSelEnd, newSelStart, newSelEnd); } Loading