Loading res/values/dimens.xml +3 −0 Original line number Original line Diff line number Diff line Loading @@ -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> src/com/android/settings/widget/DonutView.java +2 −4 Original line number Original line Diff line number Diff line Loading @@ -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; Loading @@ -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), Loading Loading @@ -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)); } } Loading Loading
res/values/dimens.xml +3 −0 Original line number Original line Diff line number Diff line Loading @@ -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>
src/com/android/settings/widget/DonutView.java +2 −4 Original line number Original line Diff line number Diff line Loading @@ -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; Loading @@ -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), Loading Loading @@ -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)); } } Loading