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
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 76dacb3..1af8395 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -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>
diff --git a/src/com/android/settings/widget/DonutView.java b/src/com/android/settings/widget/DonutView.java
index 295cb79..9a14b3b 100644
--- a/src/com/android/settings/widget/DonutView.java
+++ b/src/com/android/settings/widget/DonutView.java
@@ -39,7 +39,6 @@
// 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 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 @@
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));
}