Loading core/java/android/widget/Editor.java +17 −8 Original line number Diff line number Diff line Loading @@ -393,7 +393,7 @@ public class Editor { } mPreserveDetachedSelection = true; hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); mPreserveDetachedSelection = false; mTemporaryDetach = false; Loading Loading @@ -605,9 +605,9 @@ public class Editor { } /** * Hides the insertion controller and stops text selection mode, hiding the selection controller * Hides the insertion and span controllers. */ void hideControllers() { void hideCursorAndSpanControllers() { hideCursorControllers(); hideSpanControllers(); } Loading Loading @@ -1104,12 +1104,12 @@ public class Editor { // ExtractEditText goes out of focus. final int selStart = mTextView.getSelectionStart(); final int selEnd = mTextView.getSelectionEnd(); hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); Selection.setSelection((Spannable) mTextView.getText(), selStart, selEnd); } else { if (mTemporaryDetach) mPreserveDetachedSelection = true; hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); if (mTemporaryDetach) mPreserveDetachedSelection = false; downgradeEasyCorrectionSpans(); Loading Loading @@ -1182,6 +1182,12 @@ public class Editor { mBlink.uncancel(); makeBlink(); } final InputMethodManager imm = InputMethodManager.peekInstance(); final boolean immFullScreen = (imm != null && imm.isFullscreenMode()); if (mSelectionModifierCursorController != null && mTextView.hasSelection() && !immFullScreen) { mSelectionModifierCursorController.show(); } } else { if (mBlink != null) { mBlink.cancel(); Loading @@ -1190,7 +1196,10 @@ public class Editor { mInputContentType.enterDown = false; } // Order matters! Must be done before onParentLostFocus to rely on isShowingUp hideControllers(); hideCursorAndSpanControllers(); if (mSelectionModifierCursorController != null) { mSelectionModifierCursorController.hide(); } if (mSuggestionsPopupWindow != null) { mSuggestionsPopupWindow.onParentLostFocus(); } Loading Loading @@ -1913,7 +1922,7 @@ public class Editor { void onTouchUpEvent(MotionEvent event) { boolean selectAllGotFocus = mSelectAllOnFocus && mTextView.didTouchFocusSelect(); hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); CharSequence text = mTextView.getText(); if (!selectAllGotFocus && text.length() > 0) { Loading Loading @@ -2034,7 +2043,7 @@ public class Editor { if (mSuggestionsPopupWindow == null) { mSuggestionsPopupWindow = new SuggestionsPopupWindow(); } hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); mSuggestionsPopupWindow.show(); } Loading core/java/android/widget/TextView.java +3 −3 Original line number Diff line number Diff line Loading @@ -6364,7 +6364,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // This would stop a possible selection mode, but no such mode is started in case // extracted mode will start. Some text is selected though, and will trigger an action mode // in the extracted view. mEditor.hideControllers(); mEditor.hideCursorAndSpanControllers(); stopTextActionMode(); } Loading Loading @@ -8193,7 +8193,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); if (mEditor != null && visibility != VISIBLE) { mEditor.hideControllers(); mEditor.hideCursorAndSpanControllers(); stopTextActionMode(); } } Loading Loading @@ -9645,7 +9645,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // since we are doing so explicitlty by other means and these // controllers interact with how selection behaves. if (mEditor != null) { mEditor.hideControllers(); mEditor.hideCursorAndSpanControllers(); } CharSequence text = getIterableTextForAccessibility(); if (Math.min(start, end) >= 0 && Math.max(start, end) <= text.length()) { Loading Loading
core/java/android/widget/Editor.java +17 −8 Original line number Diff line number Diff line Loading @@ -393,7 +393,7 @@ public class Editor { } mPreserveDetachedSelection = true; hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); mPreserveDetachedSelection = false; mTemporaryDetach = false; Loading Loading @@ -605,9 +605,9 @@ public class Editor { } /** * Hides the insertion controller and stops text selection mode, hiding the selection controller * Hides the insertion and span controllers. */ void hideControllers() { void hideCursorAndSpanControllers() { hideCursorControllers(); hideSpanControllers(); } Loading Loading @@ -1104,12 +1104,12 @@ public class Editor { // ExtractEditText goes out of focus. final int selStart = mTextView.getSelectionStart(); final int selEnd = mTextView.getSelectionEnd(); hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); Selection.setSelection((Spannable) mTextView.getText(), selStart, selEnd); } else { if (mTemporaryDetach) mPreserveDetachedSelection = true; hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); if (mTemporaryDetach) mPreserveDetachedSelection = false; downgradeEasyCorrectionSpans(); Loading Loading @@ -1182,6 +1182,12 @@ public class Editor { mBlink.uncancel(); makeBlink(); } final InputMethodManager imm = InputMethodManager.peekInstance(); final boolean immFullScreen = (imm != null && imm.isFullscreenMode()); if (mSelectionModifierCursorController != null && mTextView.hasSelection() && !immFullScreen) { mSelectionModifierCursorController.show(); } } else { if (mBlink != null) { mBlink.cancel(); Loading @@ -1190,7 +1196,10 @@ public class Editor { mInputContentType.enterDown = false; } // Order matters! Must be done before onParentLostFocus to rely on isShowingUp hideControllers(); hideCursorAndSpanControllers(); if (mSelectionModifierCursorController != null) { mSelectionModifierCursorController.hide(); } if (mSuggestionsPopupWindow != null) { mSuggestionsPopupWindow.onParentLostFocus(); } Loading Loading @@ -1913,7 +1922,7 @@ public class Editor { void onTouchUpEvent(MotionEvent event) { boolean selectAllGotFocus = mSelectAllOnFocus && mTextView.didTouchFocusSelect(); hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); CharSequence text = mTextView.getText(); if (!selectAllGotFocus && text.length() > 0) { Loading Loading @@ -2034,7 +2043,7 @@ public class Editor { if (mSuggestionsPopupWindow == null) { mSuggestionsPopupWindow = new SuggestionsPopupWindow(); } hideControllers(); hideCursorAndSpanControllers(); stopTextActionMode(); mSuggestionsPopupWindow.show(); } Loading
core/java/android/widget/TextView.java +3 −3 Original line number Diff line number Diff line Loading @@ -6364,7 +6364,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // This would stop a possible selection mode, but no such mode is started in case // extracted mode will start. Some text is selected though, and will trigger an action mode // in the extracted view. mEditor.hideControllers(); mEditor.hideCursorAndSpanControllers(); stopTextActionMode(); } Loading Loading @@ -8193,7 +8193,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); if (mEditor != null && visibility != VISIBLE) { mEditor.hideControllers(); mEditor.hideCursorAndSpanControllers(); stopTextActionMode(); } } Loading Loading @@ -9645,7 +9645,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // since we are doing so explicitlty by other means and these // controllers interact with how selection behaves. if (mEditor != null) { mEditor.hideControllers(); mEditor.hideCursorAndSpanControllers(); } CharSequence text = getIterableTextForAccessibility(); if (Math.min(start, end) >= 0 && Math.max(start, end) <= text.length()) { Loading