Merge "Blinking runnable is created only if text is editable. DO NOT MERGE." into gingerbread

This commit is contained in:
Gilles Debunne
2011-02-04 15:46:15 -08:00
committed by Android (Google) Code Review

View File

@@ -6541,7 +6541,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
private void makeBlink() {
if (!mCursorVisible) {
if (!mCursorVisible || !isTextEditable()) {
if (mBlink != null) {
mBlink.removeCallbacks(mBlink);
}
@@ -6932,7 +6932,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
* @return True iff this TextView contains a text that can be edited.
*/
private boolean isTextEditable() {
return mText instanceof Editable && onCheckIsTextEditor();
return mText instanceof Editable && onCheckIsTextEditor() && isEnabled();
}
/**