diff options
| author | 2016-04-18 14:32:47 -0700 | |
|---|---|---|
| committer | 2016-04-18 15:17:02 -0700 | |
| commit | 375366cb2d6b8be3d81e59ea0ce27332c3eada66 (patch) | |
| tree | a6713f00950e3008002e79b791e844a94aba6e2c | |
| parent | 8dd32a56f74b896b21895ec75d58fa415caa2c70 (diff) | |
Request re-layout after setText if layout width is 0
When TextView is in a layout with weight params (i.e. LinearLayout) and
the width is set to 0, do not try to prevent requestLayout.
Bug: 27995311
Change-Id: Idfe9d8d0b595a6db95beb1afd83ca96a2bd46546
| -rw-r--r-- | core/java/android/widget/TextView.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 48fd58b219db..8097d7a1ea85 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -7310,7 +7310,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // If we have a fixed width, we can just swap in a new text layout // if the text height stays the same or if the view height is fixed. - if ((mLayoutParams.width != LayoutParams.WRAP_CONTENT || + if (((mLayoutParams.width != LayoutParams.WRAP_CONTENT && mLayoutParams.width != 0) || (mMaxWidthMode == mMinWidthMode && mMaxWidth == mMinWidth)) && (mHint == null || mHintLayout != null) && (mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight() > 0)) { |