Loading core/java/android/inputmethodservice/ExtractEditText.java +6 −2 Original line number Diff line number Diff line Loading @@ -103,8 +103,12 @@ public class ExtractEditText extends EditText { } @Override public boolean onTextContextMenuItem(int id) { // Select all shouldn't be handled by the original edit text, but by the extracted one. if (id != android.R.id.selectAll && mIME != null && mIME.onExtractTextContextMenuItem(id)) { // Select all and Replace text shouldn't be handled by the original edit text, but by the // extracted one. if (id == android.R.id.selectAll || id == android.R.id.replaceText) { return super.onTextContextMenuItem(id); } if (mIME != null && mIME.onExtractTextContextMenuItem(id)) { // Mode was started on Extracted, needs to be stopped here. // Cut will change the text, which stops selection mode. if (id == android.R.id.copy || id == android.R.id.paste) stopTextActionMode(); Loading core/java/android/widget/Editor.java +2 −1 Original line number Diff line number Diff line Loading @@ -3225,7 +3225,8 @@ public class Editor { } private void updateReplaceItem(Menu menu) { boolean canReplace = mTextView.isSuggestionsEnabled() && shouldOfferToShowSuggestions(); boolean canReplace = mTextView.isSuggestionsEnabled() && shouldOfferToShowSuggestions() && !(mTextView.isInExtractedMode() && mTextView.hasSelection()); boolean replaceItemExists = menu.findItem(TextView.ID_REPLACE) != null; if (canReplace && !replaceItemExists) { menu.add(Menu.NONE, TextView.ID_REPLACE, MENU_ITEM_ORDER_REPLACE, Loading Loading
core/java/android/inputmethodservice/ExtractEditText.java +6 −2 Original line number Diff line number Diff line Loading @@ -103,8 +103,12 @@ public class ExtractEditText extends EditText { } @Override public boolean onTextContextMenuItem(int id) { // Select all shouldn't be handled by the original edit text, but by the extracted one. if (id != android.R.id.selectAll && mIME != null && mIME.onExtractTextContextMenuItem(id)) { // Select all and Replace text shouldn't be handled by the original edit text, but by the // extracted one. if (id == android.R.id.selectAll || id == android.R.id.replaceText) { return super.onTextContextMenuItem(id); } if (mIME != null && mIME.onExtractTextContextMenuItem(id)) { // Mode was started on Extracted, needs to be stopped here. // Cut will change the text, which stops selection mode. if (id == android.R.id.copy || id == android.R.id.paste) stopTextActionMode(); Loading
core/java/android/widget/Editor.java +2 −1 Original line number Diff line number Diff line Loading @@ -3225,7 +3225,8 @@ public class Editor { } private void updateReplaceItem(Menu menu) { boolean canReplace = mTextView.isSuggestionsEnabled() && shouldOfferToShowSuggestions(); boolean canReplace = mTextView.isSuggestionsEnabled() && shouldOfferToShowSuggestions() && !(mTextView.isInExtractedMode() && mTextView.hasSelection()); boolean replaceItemExists = menu.findItem(TextView.ID_REPLACE) != null; if (canReplace && !replaceItemExists) { menu.add(Menu.NONE, TextView.ID_REPLACE, MENU_ITEM_ORDER_REPLACE, Loading