summaryrefslogtreecommitdiffstats
path: root/core/java/android/inputmethodservice
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2015-07-06 18:20:41 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2015-07-17 16:36:57 -0700
commitfd3eff27bdb2592cf398d11c5f2f03ba5170f962 (patch)
tree4fbb8b32abcb2940ba7e52dfc93f3a6fcd548dfe /core/java/android/inputmethodservice
parentdb8fa48ed0864125a07f2bbe078fd60abd875ac7 (diff)
downloadframeworks_base-fd3eff27bdb2592cf398d11c5f2f03ba5170f962.zip
frameworks_base-fd3eff27bdb2592cf398d11c5f2f03ba5170f962.tar.gz
frameworks_base-fd3eff27bdb2592cf398d11c5f2f03ba5170f962.tar.bz2
Fix: Wrong suggestion popup position in extract mode.
Replace text was handled by the original EditText; thus, we couldn't correctly decide popup window position. Also, changing selection range replaces entire text of the extracted EditText. As a result, text cannot be replaced with the selected item when there is a selection. This change is a workaround for this issue. This quits offering "Replace" for selection in extract mode. Bug: 22038802 Change-Id: I052b027cfd10eeb289f77f4c6b228acf58fea636
Diffstat (limited to 'core/java/android/inputmethodservice')
-rw-r--r--core/java/android/inputmethodservice/ExtractEditText.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/inputmethodservice/ExtractEditText.java b/core/java/android/inputmethodservice/ExtractEditText.java
index b039fc7..a2c1d18 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();