diff options
| author | 2014-09-02 21:53:25 +0000 | |
|---|---|---|
| committer | 2014-09-02 21:53:26 +0000 | |
| commit | 4c5ea10caf8b84ab05c2d032145a7a3a26aa9b51 (patch) | |
| tree | 242bc52eaaf321051035df29d8473b7184022073 | |
| parent | 980d466342f2c4271ac3fee6751a6da7c3c35c4f (diff) | |
| parent | 463cf1aea84c6f27155b45f3df70ec2550afb6ab (diff) | |
Merge "Ensure layout in getExtendedPadding calls" into lmp-dev
| -rw-r--r-- | core/java/android/widget/TextView.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 9b3a1e001c29..3e1b674892a1 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -1861,6 +1861,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return getCompoundPaddingTop(); } + if (mLayout == null) { + assumeLayout(); + } + if (mLayout.getLineCount() <= mMaximum) { return getCompoundPaddingTop(); } @@ -1894,6 +1898,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return getCompoundPaddingBottom(); } + if (mLayout == null) { + assumeLayout(); + } + if (mLayout.getLineCount() <= mMaximum) { return getCompoundPaddingBottom(); } |