OSDN Git Service

Merge "Request re-layout after setText if layout width is 0" into nyc-dev
authorSiyamed Sinir <siyamed@google.com>
Tue, 19 Apr 2016 17:09:52 +0000 (17:09 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Tue, 19 Apr 2016 17:09:52 +0000 (17:09 +0000)
am: d01e6f9

* commit 'd01e6f90832e7b7d55218836aae227452080f9b8':
  Request re-layout after setText if layout width is 0

Change-Id: Ia2ad9975ecbc3ebf2b468f515fcbf82a9bc4bb2d

core/java/android/widget/TextView.java

index 48fd58b..8097d7a 100644 (file)
@@ -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)) {