Merge "Made paste work in ExtractEditText" into gingerbread

This commit is contained in:
Gilles Debunne
2010-10-10 10:51:52 -07:00
committed by Android (Google) Code Review

View File

@@ -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);
}