Merge "Ellipsized and Non-ellipsized baselines should be same." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
afe3cd1aaf
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user