Put the donut on a diet.

Shrinks the donut from 6dp to 4dp to closer match the mocks.

Change-Id: Iaf455beb4f54e7673ff6adc6068e0410fac379b5
Fixes: 62548749
Test: Manual
This commit is contained in:
Daniel Nishi
2017-06-27 15:59:47 -07:00
parent a2dd9978d4
commit e55bffaf59
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> <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. --> <!-- 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> <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 --> <!-- Battery meter view size -->
<dimen name="battery_meter_width">66dp</dimen> <dimen name="battery_meter_width">66dp</dimen>
<dimen name="battery_meter_height">100dp</dimen> <dimen name="battery_meter_height">100dp</dimen>
</resources> </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. // From manual testing, this is the longest we can go without visual errors.
private static final int LINE_CHARACTER_LIMIT = 10; private static final int LINE_CHARACTER_LIMIT = 10;
private float mStrokeWidth; private float mStrokeWidth;
private float mDeviceDensity;
private int mPercent; private int mPercent;
private Paint mBackgroundCircle; private Paint mBackgroundCircle;
private Paint mFilledArc; private Paint mFilledArc;
@@ -54,8 +53,7 @@ public class DonutView extends View {
public DonutView(Context context, AttributeSet attrs) { public DonutView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
mDeviceDensity = getResources().getDisplayMetrics().density; mStrokeWidth = context.getResources().getDimension(R.dimen.storage_donut_thickness);
mStrokeWidth = 6f * mDeviceDensity;
final ColorFilter mAccentColorFilter = final ColorFilter mAccentColorFilter =
new PorterDuffColorFilter( new PorterDuffColorFilter(
Utils.getColorAttr(context, android.R.attr.colorAccent), 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)); resources.getDimension(R.dimen.storage_donut_view_percent_text_size));
mBigNumberPaint.setTextAlign(Paint.Align.CENTER); mBigNumberPaint.setTextAlign(Paint.Align.CENTER);
mBigNumberPaint.setTypeface(Typeface.create( mBigNumberPaint.setTypeface(Typeface.create(
getContext().getString(com.android.internal.R.string.config_headlineFontFamily), context.getString(com.android.internal.R.string.config_headlineFontFamily),
Typeface.NORMAL)); Typeface.NORMAL));
} }