Merge "Put the donut on a diet." into oc-dr1-dev

This commit is contained in:
Daniel Nishi
2017-06-28 20:54:57 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 4 deletions

View File

@@ -319,8 +319,11 @@
<dimen name="storage_donut_view_label_text_size">14sp</dimen>
<!-- Text size of the label text in the donut if the label text is long. -->
<dimen name="storage_donut_view_shrunken_label_text_size">10sp</dimen>
<!-- The width of the storage summary donut -->
<dimen name="storage_donut_thickness">4dp</dimen>
<!-- Battery meter view size -->
<dimen name="battery_meter_width">66dp</dimen>
<dimen name="battery_meter_height">100dp</dimen>
</resources>

View File

@@ -39,7 +39,6 @@ public class DonutView extends View {
// From manual testing, this is the longest we can go without visual errors.
private static final int LINE_CHARACTER_LIMIT = 10;
private float mStrokeWidth;
private float mDeviceDensity;
private int mPercent;
private Paint mBackgroundCircle;
private Paint mFilledArc;
@@ -54,8 +53,7 @@ public class DonutView extends View {
public DonutView(Context context, AttributeSet attrs) {
super(context, attrs);
mDeviceDensity = getResources().getDisplayMetrics().density;
mStrokeWidth = 6f * mDeviceDensity;
mStrokeWidth = context.getResources().getDimension(R.dimen.storage_donut_thickness);
final ColorFilter mAccentColorFilter =
new PorterDuffColorFilter(
Utils.getColorAttr(context, android.R.attr.colorAccent),
@@ -92,7 +90,7 @@ public class DonutView extends View {
resources.getDimension(R.dimen.storage_donut_view_percent_text_size));
mBigNumberPaint.setTextAlign(Paint.Align.CENTER);
mBigNumberPaint.setTypeface(Typeface.create(
getContext().getString(com.android.internal.R.string.config_headlineFontFamily),
context.getString(com.android.internal.R.string.config_headlineFontFamily),
Typeface.NORMAL));
}