diff options
author | Yuling Liang <yulingliang@google.com> | 2014-04-25 16:34:15 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-25 16:34:15 +0000 |
commit | 60f8349b9819130e81e28106a35bf3362d337045 (patch) | |
tree | f7d61737d27c3ac1f4b9061f8f032dd12b4e87a8 /core/java/android | |
parent | ebd6a2d2710ebf7196a399d6d5a2f0745844310b (diff) | |
parent | 243e551ac380f86639eee3e95a482d8e17836670 (diff) | |
download | frameworks_base-60f8349b9819130e81e28106a35bf3362d337045.zip frameworks_base-60f8349b9819130e81e28106a35bf3362d337045.tar.gz frameworks_base-60f8349b9819130e81e28106a35bf3362d337045.tar.bz2 |
am 243e551a: Merge "Followon fix for 14276128 Clipping at bottom of TextView" into klp-modular-dev
* commit '243e551ac380f86639eee3e95a482d8e17836670':
Followon fix for 14276128 Clipping at bottom of TextView
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/text/StaticLayout.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index 1f32d4d..814326c 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -633,7 +633,11 @@ public class StaticLayout extends Layout { bottom = fm.bottom; } - if (j == 0) { + boolean firstLine = (j == 0); + boolean currentLineIsTheLastVisibleOne = (j + 1 == mMaximumVisibleLineCount); + boolean lastLine = currentLineIsTheLastVisibleOne || (end == bufEnd); + + if (firstLine) { if (trackPad) { mTopPadding = top - above; } @@ -642,7 +646,10 @@ public class StaticLayout extends Layout { above = top; } } - if (end == bufEnd) { + + int extra; + + if (lastLine) { if (trackPad) { mBottomPadding = bottom - below; } @@ -652,9 +659,8 @@ public class StaticLayout extends Layout { } } - int extra; - if (needMultiply && end != bufEnd) { + if (needMultiply && !lastLine) { double ex = (below - above) * (spacingmult - 1) + spacingadd; if (ex >= 0) { extra = (int)(ex + EXTRA_ROUNDING); @@ -691,8 +697,6 @@ public class StaticLayout extends Layout { if (ellipsize != null) { // If there is only one line, then do any type of ellipsis except when it is MARQUEE // if there are multiple lines, just allow END ellipsis on the last line - boolean firstLine = (j == 0); - boolean currentLineIsTheLastVisibleOne = (j + 1 == mMaximumVisibleLineCount); boolean forceEllipsis = moreChars && (mLineCount + 1 == mMaximumVisibleLineCount); boolean doEllipsis = |