Merge "Ellipsized and Non-ellipsized baselines should be same." into nyc-dev

This commit is contained in:
Siyamed Sinir
2016-02-16 22:37:53 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 12 deletions

View File

@@ -189,12 +189,6 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback
mBottom = spacing;
if (includepad) {
mDesc = spacing + metrics.top;
} else {
mDesc = spacing + metrics.ascent;
}
if (trustWidth) {
mMax = metrics.width;
} else {
@@ -214,6 +208,8 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback
mTopPadding = metrics.top - metrics.ascent;
mBottomPadding = metrics.bottom - metrics.descent;
}
mDesc = spacing + mBottomPadding + (includepad ? metrics.top : metrics.ascent);
}
/**

View File

@@ -6853,11 +6853,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
.setLineSpacing(mSpacingAdd, mSpacingMult)
.setIncludePad(mIncludePad)
.setBreakStrategy(mBreakStrategy)
.setHyphenationFrequency(mHyphenationFrequency);
.setHyphenationFrequency(mHyphenationFrequency)
.setMaxLines(mMaxMode == LINES ? mMaximum : Integer.MAX_VALUE);
if (shouldEllipsize) {
builder.setEllipsize(mEllipsize)
.setEllipsizedWidth(ellipsisWidth)
.setMaxLines(mMaxMode == LINES ? mMaximum : Integer.MAX_VALUE);
.setEllipsizedWidth(ellipsisWidth);
}
mHintLayout = builder.build();
}
@@ -6944,11 +6944,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
.setLineSpacing(mSpacingAdd, mSpacingMult)
.setIncludePad(mIncludePad)
.setBreakStrategy(mBreakStrategy)
.setHyphenationFrequency(mHyphenationFrequency);
.setHyphenationFrequency(mHyphenationFrequency)
.setMaxLines(mMaxMode == LINES ? mMaximum : Integer.MAX_VALUE);
if (shouldEllipsize) {
builder.setEllipsize(effectiveEllipsize)
.setEllipsizedWidth(ellipsisWidth)
.setMaxLines(mMaxMode == LINES ? mMaximum : Integer.MAX_VALUE);
.setEllipsizedWidth(ellipsisWidth);
}
// TODO: explore always setting maxLines
result = builder.build();