Loading res/layout/storage_summary_donut.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/selectableItemBackground" android:background="?android:attr/colorSecondary" android:gravity="center_vertical" android:orientation="horizontal" > Loading res/values/colors.xml +0 −3 Original line number Diff line number Diff line Loading @@ -104,9 +104,6 @@ <color name="status_bar_color">#3c3c3c</color> <!-- Color for the background of the donut graph.--> <color name="donut_background_grey">#ffd7d7d7</color> <!-- Color for the background of the shortcut icons.--> <color name="shortcut_background">#fff5f5f5</color> Loading src/com/android/settings/fuelgauge/BatteryMeterView.java +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ public class BatteryMeterView extends ImageView { public BatteryMeterView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); final int frameColor = context.getColor(R.color.batterymeter_frame_color); final int frameColor = context.getColor(R.color.meter_background_color); mAccentColorFilter = new PorterDuffColorFilter( Utils.getColorAttr(context, android.R.attr.colorAccent), PorterDuff.Mode.SRC_IN); mErrorColorFilter = new PorterDuffColorFilter( Loading src/com/android/settings/widget/DonutView.java +30 −8 Original line number Diff line number Diff line Loading @@ -17,12 +17,14 @@ package com.android.settings.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.text.TextPaint; import android.util.AttributeSet; import android.view.View; import com.android.internal.util.Preconditions; import com.android.settings.R; import com.android.settings.Utils; Loading Loading @@ -50,20 +52,26 @@ public class DonutView extends View { super(context, attrs); mDeviceDensity = getResources().getDisplayMetrics().density; mStrokeWidth = 6f * mDeviceDensity; final ColorFilter mAccentColorFilter = new PorterDuffColorFilter( Utils.getColorAttr(context, android.R.attr.colorAccent), PorterDuff.Mode.SRC_IN); mBackgroundCircle = new Paint(); mBackgroundCircle.setAntiAlias(true); mBackgroundCircle.setStrokeCap(Paint.Cap.BUTT); mBackgroundCircle.setStyle(Paint.Style.STROKE); mBackgroundCircle.setStrokeWidth(mStrokeWidth); mBackgroundCircle.setColor(getResources().getColor(R.color.donut_background_grey)); mBackgroundCircle.setColorFilter(mAccentColorFilter); mBackgroundCircle.setColor(context.getColor(R.color.meter_background_color)); mFilledArc = new Paint(); mFilledArc.setAntiAlias(true); mFilledArc.setStrokeCap(Paint.Cap.BUTT); mFilledArc.setStyle(Paint.Style.STROKE); mFilledArc.setStrokeWidth(mStrokeWidth); mFilledArc.setColor(Utils.getColorAccent(getContext())); mFilledArc.setColor(Utils.getDefaultColor(mContext, R.color.meter_consumed_color)); mFilledArc.setColorFilter(mAccentColorFilter); mTextPaint = new TextPaint(); mTextPaint.setColor(Utils.getColorAccent(getContext())); Loading @@ -86,11 +94,25 @@ public class DonutView extends View { } private void drawDonut(Canvas canvas) { canvas.drawArc(0 + mStrokeWidth, 0 + mStrokeWidth, getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, 360, false, mBackgroundCircle); canvas.drawArc(0 + mStrokeWidth, 0 + mStrokeWidth, getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, (360 * mPercent / 100), false, mFilledArc); canvas.drawArc( 0 + mStrokeWidth, 0 + mStrokeWidth, getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, 360, false, mBackgroundCircle); canvas.drawArc( 0 + mStrokeWidth, 0 + mStrokeWidth, getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, (360 * mPercent / 100), false, mFilledArc); } private void drawInnerText(Canvas canvas) { Loading Loading
res/layout/storage_summary_donut.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/selectableItemBackground" android:background="?android:attr/colorSecondary" android:gravity="center_vertical" android:orientation="horizontal" > Loading
res/values/colors.xml +0 −3 Original line number Diff line number Diff line Loading @@ -104,9 +104,6 @@ <color name="status_bar_color">#3c3c3c</color> <!-- Color for the background of the donut graph.--> <color name="donut_background_grey">#ffd7d7d7</color> <!-- Color for the background of the shortcut icons.--> <color name="shortcut_background">#fff5f5f5</color> Loading
src/com/android/settings/fuelgauge/BatteryMeterView.java +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ public class BatteryMeterView extends ImageView { public BatteryMeterView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); final int frameColor = context.getColor(R.color.batterymeter_frame_color); final int frameColor = context.getColor(R.color.meter_background_color); mAccentColorFilter = new PorterDuffColorFilter( Utils.getColorAttr(context, android.R.attr.colorAccent), PorterDuff.Mode.SRC_IN); mErrorColorFilter = new PorterDuffColorFilter( Loading
src/com/android/settings/widget/DonutView.java +30 −8 Original line number Diff line number Diff line Loading @@ -17,12 +17,14 @@ package com.android.settings.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.text.TextPaint; import android.util.AttributeSet; import android.view.View; import com.android.internal.util.Preconditions; import com.android.settings.R; import com.android.settings.Utils; Loading Loading @@ -50,20 +52,26 @@ public class DonutView extends View { super(context, attrs); mDeviceDensity = getResources().getDisplayMetrics().density; mStrokeWidth = 6f * mDeviceDensity; final ColorFilter mAccentColorFilter = new PorterDuffColorFilter( Utils.getColorAttr(context, android.R.attr.colorAccent), PorterDuff.Mode.SRC_IN); mBackgroundCircle = new Paint(); mBackgroundCircle.setAntiAlias(true); mBackgroundCircle.setStrokeCap(Paint.Cap.BUTT); mBackgroundCircle.setStyle(Paint.Style.STROKE); mBackgroundCircle.setStrokeWidth(mStrokeWidth); mBackgroundCircle.setColor(getResources().getColor(R.color.donut_background_grey)); mBackgroundCircle.setColorFilter(mAccentColorFilter); mBackgroundCircle.setColor(context.getColor(R.color.meter_background_color)); mFilledArc = new Paint(); mFilledArc.setAntiAlias(true); mFilledArc.setStrokeCap(Paint.Cap.BUTT); mFilledArc.setStyle(Paint.Style.STROKE); mFilledArc.setStrokeWidth(mStrokeWidth); mFilledArc.setColor(Utils.getColorAccent(getContext())); mFilledArc.setColor(Utils.getDefaultColor(mContext, R.color.meter_consumed_color)); mFilledArc.setColorFilter(mAccentColorFilter); mTextPaint = new TextPaint(); mTextPaint.setColor(Utils.getColorAccent(getContext())); Loading @@ -86,11 +94,25 @@ public class DonutView extends View { } private void drawDonut(Canvas canvas) { canvas.drawArc(0 + mStrokeWidth, 0 + mStrokeWidth, getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, 360, false, mBackgroundCircle); canvas.drawArc(0 + mStrokeWidth, 0 + mStrokeWidth, getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, (360 * mPercent / 100), false, mFilledArc); canvas.drawArc( 0 + mStrokeWidth, 0 + mStrokeWidth, getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, 360, false, mBackgroundCircle); canvas.drawArc( 0 + mStrokeWidth, 0 + mStrokeWidth, getWidth() - mStrokeWidth, getHeight() - mStrokeWidth, TOP, (360 * mPercent / 100), false, mFilledArc); } private void drawInnerText(Canvas canvas) { Loading