1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-19 00:19:25 +01:00

Fill up Goals chart with transparent grey

This commit is contained in:
Arjan Schrijver 2024-02-16 20:36:28 +01:00
parent e159905349
commit 36f1912d23
2 changed files with 10 additions and 2 deletions

View File

@ -37,7 +37,7 @@ public abstract class AbstractDashboardWidget extends Fragment {
protected DashboardFragment.DashboardData dashboardData;
protected @ColorInt int color_not_worn = Color.argb(75, 128, 128, 128);
protected @ColorInt int color_not_worn = Color.argb(50, 128, 128, 128);
protected @ColorInt int color_worn = Color.rgb(128, 128, 128);
protected @ColorInt int color_activity = Color.GREEN;
protected @ColorInt int color_deep_sleep = Color.BLUE;
@ -80,7 +80,7 @@ public abstract class AbstractDashboardWidget extends Fragment {
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeCap(Paint.Cap.ROUND);
paint.setStrokeWidth(barWidth);
paint.setColor(Color.argb(75, 150, 150, 150));
paint.setColor(color_not_worn);
canvas.drawArc(barMargin, barMargin, width - barMargin, width - barMargin, 180 + 180 * filledFactor, 180 - 180 * filledFactor, false, paint);
paint.setColor(filledColor);
canvas.drawArc(barMargin, barMargin, width - barMargin, width - barMargin, 180, 180 * filledFactor, false, paint);

View File

@ -124,18 +124,26 @@ public class DashboardGoalsWidget extends AbstractDashboardWidget {
paint.setStrokeCap(Paint.Cap.ROUND);
paint.setStrokeWidth(barWidth);
paint.setColor(color_not_worn);
canvas.drawArc(barMargin, barMargin, width - barMargin, height - barMargin, 270, 360, false, paint);
paint.setColor(color_activity);
canvas.drawArc(barMargin, barMargin, width - barMargin, height - barMargin, 270, 360 * dashboardData.getStepsGoalFactor(), false, paint);
barMargin += barWidth * 1.5;
paint.setColor(color_not_worn);
canvas.drawArc(barMargin, barMargin, width - barMargin, height - barMargin, 270, 360, false, paint);
paint.setColor(color_distance);
canvas.drawArc(barMargin, barMargin, width - barMargin, height - barMargin, 270, 360 * dashboardData.getDistanceGoalFactor(), false, paint);
barMargin += barWidth * 1.5;
paint.setColor(color_not_worn);
canvas.drawArc(barMargin, barMargin, width - barMargin, height - barMargin, 270, 360, false, paint);
paint.setColor(color_active_time);
canvas.drawArc(barMargin, barMargin, width - barMargin, height - barMargin, 270, 360 * dashboardData.getActiveMinutesGoalFactor(), false, paint);
barMargin += barWidth * 1.5;
paint.setColor(color_not_worn);
canvas.drawArc(barMargin, barMargin, width - barMargin, height - barMargin, 270, 360, false, paint);
paint.setColor(color_light_sleep);
canvas.drawArc(barMargin, barMargin, width - barMargin, height - barMargin, 270, 360 * dashboardData.getSleepMinutesGoalFactor(), false, paint);
return null;