1
0
Fork 0

Wrap PineTimeStyle step counter

This changes the PineTimeStyle step counter gauge continues counting
with wraparound after you achieve your step goal.
This commit is contained in:
Aidan Epstein 2021-12-09 17:59:48 -08:00 committed by Kieran Cawthray
parent b768829c63
commit e13172384b

View file

@ -431,7 +431,7 @@ void WatchFacePineTimeStyle::Refresh() {
stepCount = motionController.NbSteps(); stepCount = motionController.NbSteps();
motionSensorOk = motionController.IsSensorOk(); motionSensorOk = motionController.IsSensorOk();
if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) { if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) {
lv_gauge_set_value(stepGauge, 0, (stepCount.Get() / (settingsController.GetStepsGoal() / 100))); lv_gauge_set_value(stepGauge, 0, (stepCount.Get() / (settingsController.GetStepsGoal() / 100)) % 100);
lv_obj_realign(stepGauge); lv_obj_realign(stepGauge);
if (stepCount.Get() > settingsController.GetStepsGoal()) { if (stepCount.Get() > settingsController.GetStepsGoal()) {
lv_obj_set_style_local_line_color(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); lv_obj_set_style_local_line_color(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);