Merge "Use fallback linespacing in ChartSweepView and ChartGridView"
This commit is contained in:
committed by
Android (Google) Code Review
commit
d0c1f65451
@@ -170,8 +170,9 @@ public class ChartGridView extends View {
|
||||
paint.setColor(mLabelColor);
|
||||
paint.setTextSize(mLabelSize);
|
||||
|
||||
return new StaticLayout(text, paint,
|
||||
(int) Math.ceil(Layout.getDesiredWidth(text, paint)),
|
||||
Layout.Alignment.ALIGN_NORMAL, 1.f, 0, true);
|
||||
return StaticLayout.Builder.obtain(text, 0, text.length(), paint,
|
||||
(int) Math.ceil(Layout.getDesiredWidth(text, paint)))
|
||||
.setUseLineSpacingFromFallbacks(true)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
@@ -265,8 +265,11 @@ public class ChartSweepView extends View {
|
||||
paint.setColor(mLabelColor);
|
||||
|
||||
mLabelTemplate = new SpannableStringBuilder(template);
|
||||
mLabelLayout = new DynamicLayout(
|
||||
mLabelTemplate, paint, LARGE_WIDTH, Alignment.ALIGN_RIGHT, 1f, 0f, false);
|
||||
mLabelLayout = DynamicLayout.Builder.obtain(mLabelTemplate, paint, LARGE_WIDTH)
|
||||
.setAlignment(Alignment.ALIGN_RIGHT)
|
||||
.setIncludePad(false)
|
||||
.setUseLineSpacingFromFallbacks(true)
|
||||
.build();
|
||||
invalidateLabel();
|
||||
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user