summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Stingaceanu <stg@google.com>2015-07-14 14:03:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-07-14 14:03:23 +0000
commit8af7432ca3fc1ce3539997d24439954f0e64134c (patch)
tree463f2e50ded6faff3df24df2a26eba175a535e16
parentf5e20ec36480897f4c37fd63554872e74d874f02 (diff)
parent5396c131c02246145637ac11e4061cbca9efc558 (diff)
downloadframeworks_base-8af7432ca3fc1ce3539997d24439954f0e64134c.zip
frameworks_base-8af7432ca3fc1ce3539997d24439954f0e64134c.tar.gz
frameworks_base-8af7432ca3fc1ce3539997d24439954f0e64134c.tar.bz2
Merge "Fix "Select All" in extracted mode" into mnc-dev
-rw-r--r--core/java/android/inputmethodservice/ExtractEditText.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/core/java/android/inputmethodservice/ExtractEditText.java b/core/java/android/inputmethodservice/ExtractEditText.java
index 24596c3..b039fc7 100644
--- a/core/java/android/inputmethodservice/ExtractEditText.java
+++ b/core/java/android/inputmethodservice/ExtractEditText.java
@@ -29,7 +29,7 @@ import android.widget.EditText;
public class ExtractEditText extends EditText {
private InputMethodService mIME;
private int mSettingExtractedText;
-
+
public ExtractEditText(Context context) {
super(context, null);
}
@@ -45,11 +45,11 @@ public class ExtractEditText extends EditText {
public ExtractEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
-
+
void setIME(InputMethodService ime) {
mIME = ime;
}
-
+
/**
* Start making changes that will not be reported to the client. That
* is, {@link #onSelectionChanged(int, int)} will not result in sending
@@ -58,7 +58,7 @@ public class ExtractEditText extends EditText {
public void startInternalChanges() {
mSettingExtractedText += 1;
}
-
+
/**
* Finish making changes that will not be reported to the client. That
* is, {@link #onSelectionChanged(int, int)} will not result in sending
@@ -67,7 +67,7 @@ public class ExtractEditText extends EditText {
public void finishInternalChanges() {
mSettingExtractedText -= 1;
}
-
+
/**
* Implement just to keep track of when we are setting text from the
* client (vs. seeing changes in ourself from the user).
@@ -80,7 +80,7 @@ public class ExtractEditText extends EditText {
mSettingExtractedText--;
}
}
-
+
/**
* Report to the underlying text editor about selection changes.
*/
@@ -89,7 +89,7 @@ public class ExtractEditText extends EditText {
mIME.onExtractedSelectionChanged(selStart, selEnd);
}
}
-
+
/**
* Redirect clicks to the IME for handling there. First allows any
* on click handler to run, though.
@@ -101,9 +101,10 @@ public class ExtractEditText extends EditText {
}
return false;
}
-
+
@Override public boolean onTextContextMenuItem(int id) {
- if (mIME != null && mIME.onExtractTextContextMenuItem(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)) {
// 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();
@@ -111,7 +112,7 @@ public class ExtractEditText extends EditText {
}
return super.onTextContextMenuItem(id);
}
-
+
/**
* We are always considered to be an input method target.
*/
@@ -119,14 +120,14 @@ public class ExtractEditText extends EditText {
public boolean isInputMethodTarget() {
return true;
}
-
+
/**
* Return true if the edit text is currently showing a scroll bar.
*/
public boolean hasVerticalScrollBar() {
return computeVerticalScrollRange() > computeVerticalScrollExtent();
}
-
+
/**
* Pretend like the window this view is in always has focus, so its
* highlight and cursor will be displayed.