Merge "Made paste work in ExtractEditText" into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
d14230f1c7
@@ -18,7 +18,6 @@ package android.inputmethodservice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.inputmethod.ExtractedText;
|
||||
import android.widget.EditText;
|
||||
|
||||
@@ -29,7 +28,6 @@ import android.widget.EditText;
|
||||
public class ExtractEditText extends EditText {
|
||||
private InputMethodService mIME;
|
||||
private int mSettingExtractedText;
|
||||
private boolean mContextMenuShouldBeHandledBySuper = false;
|
||||
|
||||
public ExtractEditText(Context context) {
|
||||
super(context, null);
|
||||
@@ -99,19 +97,13 @@ public class ExtractEditText extends EditText {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreateContextMenu(ContextMenu menu) {
|
||||
super.onCreateContextMenu(menu);
|
||||
mContextMenuShouldBeHandledBySuper = true;
|
||||
}
|
||||
|
||||
@Override public boolean onTextContextMenuItem(int id) {
|
||||
if (mIME != null && !mContextMenuShouldBeHandledBySuper) {
|
||||
// Horrible hack: select word option has to be handled by original view to work.
|
||||
if (mIME != null && id != android.R.id.startSelectingText) {
|
||||
if (mIME.onExtractTextContextMenuItem(id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
mContextMenuShouldBeHandledBySuper = false;
|
||||
return super.onTextContextMenuItem(id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user