am 705a27a9: Merge "Non-editable TextViews should not display a cursor." into honeycomb
* commit '705a27a97ccd8e363944083d948b7f5204916b85':
Non-editable TextViews should not display a cursor.
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index a0a615a..ab07a7e 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -4334,7 +4334,7 @@
selStart = getSelectionStart();
selEnd = getSelectionEnd();
- if ((mCursorVisible || mTextIsSelectable) && selStart >= 0 && isEnabled()) {
+ if ((isCursorVisible() || mTextIsSelectable) && selStart >= 0 && isEnabled()) {
if (mHighlightPath == null)
mHighlightPath = new Path();
@@ -6491,6 +6491,10 @@
prepareCursorControllers();
}
+ private boolean isCursorVisible() {
+ return mCursorVisible && isTextEditable();
+ }
+
private boolean canMarquee() {
int width = (mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight());
return width > 0 && mLayout.getLineWidth(0) > width;
@@ -6979,7 +6983,7 @@
}
private void makeBlink() {
- if (!mCursorVisible || !isTextEditable()) {
+ if (!isCursorVisible()) {
if (mBlink != null) {
mBlink.removeCallbacks(mBlink);
}
@@ -7373,8 +7377,7 @@
|| windowParams.type > WindowManager.LayoutParams.LAST_SUB_WINDOW;
}
- mInsertionControllerEnabled = windowSupportsHandles && isTextEditable() && mCursorVisible &&
- mLayout != null;
+ mInsertionControllerEnabled = windowSupportsHandles && isCursorVisible() && mLayout != null;
mSelectionControllerEnabled = windowSupportsHandles && textCanBeSelected() &&
mLayout != null;