resolved conflicts for merge of 5d919b43 to gingerbread-plus-aosp

Change-Id: I8b8a8dfdd99052f3d43a0feb47168876b41e336d
This commit is contained in:
Jean-Baptiste Queru
2010-10-20 18:16:57 -07:00

View File

@ -976,6 +976,22 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
setTypeface(tf, styleIndex);
}
@Override
public void setEnabled(boolean enabled) {
if (enabled == isEnabled()) {
return;
}
if (!enabled) {
// Hide the soft input if the currently active TextView is disabled
InputMethodManager imm = InputMethodManager.peekInstance();
if (imm != null && imm.isActive(this)) {
imm.hideSoftInputFromWindow(getWindowToken(), 0);
}
}
super.setEnabled(enabled);
}
/**
* Sets the typeface and style in which the text should be displayed,
* and turns on the fake bold and italic bits in the Paint if the
@ -4562,7 +4578,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
@Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
if (onCheckIsTextEditor()) {
if (onCheckIsTextEditor() && isEnabled()) {
if (mInputMethodState == null) {
mInputMethodState = new InputMethodState();
}
@ -6821,7 +6837,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
return superResult;
}
if ((mMovement != null || onCheckIsTextEditor()) && mText instanceof Spannable && mLayout != null) {
if ((mMovement != null || onCheckIsTextEditor()) && isEnabled()
&& mText instanceof Spannable && mLayout != null) {
if (mInsertionPointCursorController != null) {
mInsertionPointCursorController.onTouchEvent(event);
}