Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2cbe278a authored by Daniel Nishi's avatar Daniel Nishi Committed by Android (Google) Code Review
Browse files

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

parents ff8312b3 e55bffaf
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -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>
+2 −4
Original line number Original line Diff line number Diff line
@@ -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));
    }
    }