From 10973c777648a5893f9c668d2675061f359c223d Mon Sep 17 00:00:00 2001 From: Yuling Liang Date: Fri, 25 Apr 2014 17:32:08 +0000 Subject: Revert "Followon fix for 14276128 Clipping at bottom of TextView" This reverts commit a10e19845ce76c0e4dd38018c84b83c9255dc9fe. Change-Id: I6d40451c9eb6285859e16d251b55947663a3553a --- core/java/android/text/StaticLayout.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'core/java/android/text') diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index 814326c..1f32d4d 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -633,11 +633,7 @@ public class StaticLayout extends Layout { bottom = fm.bottom; } - boolean firstLine = (j == 0); - boolean currentLineIsTheLastVisibleOne = (j + 1 == mMaximumVisibleLineCount); - boolean lastLine = currentLineIsTheLastVisibleOne || (end == bufEnd); - - if (firstLine) { + if (j == 0) { if (trackPad) { mTopPadding = top - above; } @@ -646,10 +642,7 @@ public class StaticLayout extends Layout { above = top; } } - - int extra; - - if (lastLine) { + if (end == bufEnd) { if (trackPad) { mBottomPadding = bottom - below; } @@ -659,8 +652,9 @@ public class StaticLayout extends Layout { } } + int extra; - if (needMultiply && !lastLine) { + if (needMultiply && end != bufEnd) { double ex = (below - above) * (spacingmult - 1) + spacingadd; if (ex >= 0) { extra = (int)(ex + EXTRA_ROUNDING); @@ -697,6 +691,8 @@ 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 = -- cgit v1.1