diff options
| author | 2015-07-21 00:14:50 +0000 | |
|---|---|---|
| committer | 2015-07-21 00:14:50 +0000 | |
| commit | 2305f99d012b73f5768e1937cc18c2598d606aeb (patch) | |
| tree | 3a5fb36b8c991fc64a8abb1c86d061f8d9a1f2f0 | |
| parent | ef9bf044891fc15d175dd725ab22cef2df3fe17d (diff) | |
| parent | abe22377262a2aadbeb3b64d8bc10916b0256d6d (diff) | |
am abe22377: am 7423ca03: am d49c3b65: am 00eb5767: am 437eb6ce: Merge "Fix: Wrong suggestion popup position in extract mode." into mnc-dev
* commit 'abe22377262a2aadbeb3b64d8bc10916b0256d6d':
Fix: Wrong suggestion popup position in extract mode.
| -rw-r--r-- | core/java/android/inputmethodservice/ExtractEditText.java | 8 | ||||
| -rw-r--r-- | core/java/android/widget/Editor.java | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/core/java/android/inputmethodservice/ExtractEditText.java b/core/java/android/inputmethodservice/ExtractEditText.java index b039fc762245..a2c1d1841c20 100644 --- a/core/java/android/inputmethodservice/ExtractEditText.java +++ b/core/java/android/inputmethodservice/ExtractEditText.java @@ -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(); diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index d897f49dbffd..15d13aeebca8 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -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, |