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.setColor(mLabelColor);
|
||||||
paint.setTextSize(mLabelSize);
|
paint.setTextSize(mLabelSize);
|
||||||
|
|
||||||
return new StaticLayout(text, paint,
|
return StaticLayout.Builder.obtain(text, 0, text.length(), paint,
|
||||||
(int) Math.ceil(Layout.getDesiredWidth(text, paint)),
|
(int) Math.ceil(Layout.getDesiredWidth(text, paint)))
|
||||||
Layout.Alignment.ALIGN_NORMAL, 1.f, 0, true);
|
.setUseLineSpacingFromFallbacks(true)
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -265,8 +265,11 @@ public class ChartSweepView extends View {
|
|||||||
paint.setColor(mLabelColor);
|
paint.setColor(mLabelColor);
|
||||||
|
|
||||||
mLabelTemplate = new SpannableStringBuilder(template);
|
mLabelTemplate = new SpannableStringBuilder(template);
|
||||||
mLabelLayout = new DynamicLayout(
|
mLabelLayout = DynamicLayout.Builder.obtain(mLabelTemplate, paint, LARGE_WIDTH)
|
||||||
mLabelTemplate, paint, LARGE_WIDTH, Alignment.ALIGN_RIGHT, 1f, 0f, false);
|
.setAlignment(Alignment.ALIGN_RIGHT)
|
||||||
|
.setIncludePad(false)
|
||||||
|
.setUseLineSpacingFromFallbacks(true)
|
||||||
|
.build();
|
||||||
invalidateLabel();
|
invalidateLabel();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user