Loading core/java/android/inputmethodservice/ExtractEditText.java +8 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,14 @@ public class ExtractEditText extends EditText { } } /** * @hide */ @Override public boolean isInExtractedMode() { return true; } /** * {@inheritDoc} * @hide Loading core/java/android/widget/Editor.java +8 −6 Original line number Diff line number Diff line Loading @@ -623,7 +623,7 @@ public class Editor { // One is the true focus lost where suggestions pop-up (if any) should be dismissed, and the // other is an side effect of showing the suggestions pop-up itself. We use isShowingUp() // to distinguish one from the other. if (mSuggestionsPopupWindow != null && ((mTextView instanceof ExtractEditText) || if (mSuggestionsPopupWindow != null && ((mTextView.isInExtractedMode()) || !mSuggestionsPopupWindow.isShowingUp())) { // Should be done before hide insertion point controller since it triggers a show of it mSuggestionsPopupWindow.hide(); Loading @@ -640,7 +640,7 @@ public class Editor { mTextView.removeAdjacentSuggestionSpans(end); if (mTextView.isTextEditable() && mTextView.isSuggestionsEnabled() && !(mTextView instanceof ExtractEditText)) { !(mTextView.isInExtractedMode())) { if (mSpellChecker == null && createSpellChecker) { mSpellChecker = new SpellChecker(mTextView); } Loading Loading @@ -1063,7 +1063,7 @@ public class Editor { // ExtractEditText clears focus, which gives focus to the ExtractEditText. // This special case ensure that we keep current selection in that case. // It would be better to know why the DecorView does not have focus at that time. if (((mTextView instanceof ExtractEditText) || mSelectionMoved) && if (((mTextView.isInExtractedMode()) || mSelectionMoved) && selStart >= 0 && selEnd >= 0) { /* * Someone intentionally set the selection, so let them Loading Loading @@ -1099,7 +1099,7 @@ public class Editor { // Don't leave us in the middle of a batch edit. mTextView.onEndBatchEdit(); if (mTextView instanceof ExtractEditText) { if (mTextView.isInExtractedMode()) { // terminateTextSelectionMode removes selection, which we want to keep when // ExtractEditText goes out of focus. final int selStart = mTextView.getSelectionStart(); Loading Loading @@ -1825,7 +1825,7 @@ public class Editor { } private boolean extractedTextModeWillBeStarted() { if (!(mTextView instanceof ExtractEditText)) { if (!(mTextView.isInExtractedMode())) { final InputMethodManager imm = InputMethodManager.peekInstance(); return imm != null && imm.isFullscreenMode(); } Loading Loading @@ -4657,7 +4657,9 @@ public class Editor { mEndHandle.showAtLocation(endOffset); // No longer the first dragging motion, reset. if (!(mTextView.isInExtractedMode())) { startSelectionActionMode(); } mDragAcceleratorActive = false; mStartOffset = -1; mSwitchedLines = false; Loading core/java/android/widget/TextView.java +9 −0 Original line number Diff line number Diff line Loading @@ -8636,6 +8636,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return getTextServicesLocale(false /* allowNullLocale */); } /** * @return true if this TextView is specialized for showing and interacting with the extracted * text in a full-screen input method. * @hide */ public boolean isInExtractedMode() { return false; } /** * This is a temporary method. Future versions may support multi-locale text. * Caveat: This method may not return the latest spell checker locale, but this should be Loading Loading
core/java/android/inputmethodservice/ExtractEditText.java +8 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,14 @@ public class ExtractEditText extends EditText { } } /** * @hide */ @Override public boolean isInExtractedMode() { return true; } /** * {@inheritDoc} * @hide Loading
core/java/android/widget/Editor.java +8 −6 Original line number Diff line number Diff line Loading @@ -623,7 +623,7 @@ public class Editor { // One is the true focus lost where suggestions pop-up (if any) should be dismissed, and the // other is an side effect of showing the suggestions pop-up itself. We use isShowingUp() // to distinguish one from the other. if (mSuggestionsPopupWindow != null && ((mTextView instanceof ExtractEditText) || if (mSuggestionsPopupWindow != null && ((mTextView.isInExtractedMode()) || !mSuggestionsPopupWindow.isShowingUp())) { // Should be done before hide insertion point controller since it triggers a show of it mSuggestionsPopupWindow.hide(); Loading @@ -640,7 +640,7 @@ public class Editor { mTextView.removeAdjacentSuggestionSpans(end); if (mTextView.isTextEditable() && mTextView.isSuggestionsEnabled() && !(mTextView instanceof ExtractEditText)) { !(mTextView.isInExtractedMode())) { if (mSpellChecker == null && createSpellChecker) { mSpellChecker = new SpellChecker(mTextView); } Loading Loading @@ -1063,7 +1063,7 @@ public class Editor { // ExtractEditText clears focus, which gives focus to the ExtractEditText. // This special case ensure that we keep current selection in that case. // It would be better to know why the DecorView does not have focus at that time. if (((mTextView instanceof ExtractEditText) || mSelectionMoved) && if (((mTextView.isInExtractedMode()) || mSelectionMoved) && selStart >= 0 && selEnd >= 0) { /* * Someone intentionally set the selection, so let them Loading Loading @@ -1099,7 +1099,7 @@ public class Editor { // Don't leave us in the middle of a batch edit. mTextView.onEndBatchEdit(); if (mTextView instanceof ExtractEditText) { if (mTextView.isInExtractedMode()) { // terminateTextSelectionMode removes selection, which we want to keep when // ExtractEditText goes out of focus. final int selStart = mTextView.getSelectionStart(); Loading Loading @@ -1825,7 +1825,7 @@ public class Editor { } private boolean extractedTextModeWillBeStarted() { if (!(mTextView instanceof ExtractEditText)) { if (!(mTextView.isInExtractedMode())) { final InputMethodManager imm = InputMethodManager.peekInstance(); return imm != null && imm.isFullscreenMode(); } Loading Loading @@ -4657,7 +4657,9 @@ public class Editor { mEndHandle.showAtLocation(endOffset); // No longer the first dragging motion, reset. if (!(mTextView.isInExtractedMode())) { startSelectionActionMode(); } mDragAcceleratorActive = false; mStartOffset = -1; mSwitchedLines = false; Loading
core/java/android/widget/TextView.java +9 −0 Original line number Diff line number Diff line Loading @@ -8636,6 +8636,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return getTextServicesLocale(false /* allowNullLocale */); } /** * @return true if this TextView is specialized for showing and interacting with the extracted * text in a full-screen input method. * @hide */ public boolean isInExtractedMode() { return false; } /** * This is a temporary method. Future versions may support multi-locale text. * Caveat: This method may not return the latest spell checker locale, but this should be Loading