|
5 | 5 |
|
6 | 6 | using namespace Pinetime::Applications::Screens; |
7 | 7 |
|
| 8 | +using Days = Pinetime::Controllers::MotionController::Days; |
| 9 | + |
| 10 | +namespace { |
| 11 | + constexpr const char* yesterdayStr = "Yest: %5lu"; |
| 12 | +} |
| 13 | + |
8 | 14 | static void lap_event_handler(lv_obj_t* obj, lv_event_t event) { |
9 | 15 | auto* steps = static_cast<Steps*>(obj->user_data); |
10 | 16 | steps->lapBtnEventHandler(event); |
@@ -33,13 +39,19 @@ Steps::Steps(Controllers::MotionController& motionController, Controllers::Setti |
33 | 39 | lSteps = lv_label_create(lv_scr_act(), nullptr); |
34 | 40 | lv_obj_set_style_local_text_color(lSteps, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_LIME); |
35 | 41 | lv_obj_set_style_local_text_font(lSteps, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42); |
36 | | - lv_label_set_text_fmt(lSteps, "%li", stepsCount); |
| 42 | + lv_label_set_text_fmt(lSteps, "%lu", stepsCount); |
37 | 43 | lv_obj_align(lSteps, nullptr, LV_ALIGN_CENTER, 0, -40); |
38 | 44 |
|
39 | 45 | lv_obj_t* lstepsL = lv_label_create(lv_scr_act(), nullptr); |
40 | 46 | lv_obj_set_style_local_text_color(lstepsL, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray); |
41 | 47 | lv_label_set_text_static(lstepsL, "Steps"); |
42 | | - lv_obj_align(lstepsL, lSteps, LV_ALIGN_OUT_BOTTOM_MID, 0, 5); |
| 48 | + lv_obj_align(lstepsL, lSteps, LV_ALIGN_OUT_BOTTOM_MID, 0, 0); |
| 49 | + |
| 50 | + lStepsYesterday = lv_label_create(lv_scr_act(), nullptr); |
| 51 | + lv_obj_set_style_local_text_color(lStepsYesterday, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray); |
| 52 | + lv_label_set_text_fmt(lStepsYesterday, yesterdayStr, motionController.NbSteps(Days::Yesterday)); |
| 53 | + lv_label_set_align(lStepsYesterday, LV_LABEL_ALIGN_CENTER); |
| 54 | + lv_obj_align(lStepsYesterday, lSteps, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); |
43 | 55 |
|
44 | 56 | lv_obj_t* lstepsGoal = lv_label_create(lv_scr_act(), nullptr); |
45 | 57 | lv_obj_set_style_local_text_color(lstepsGoal, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_CYAN); |
@@ -76,7 +88,10 @@ void Steps::Refresh() { |
76 | 88 | stepsCount = motionController.NbSteps(); |
77 | 89 | currentTripSteps = motionController.GetTripSteps(); |
78 | 90 |
|
79 | | - lv_label_set_text_fmt(lSteps, "%li", stepsCount); |
| 91 | + lv_label_set_text_fmt(lSteps, "%lu", stepsCount); |
| 92 | + lv_obj_align(lSteps, nullptr, LV_ALIGN_CENTER, 0, -40); |
| 93 | + |
| 94 | + lv_label_set_text_fmt(lStepsYesterday, yesterdayStr, motionController.NbSteps(Days::Yesterday)); |
80 | 95 | lv_obj_align(lSteps, nullptr, LV_ALIGN_CENTER, 0, -40); |
81 | 96 |
|
82 | 97 | if (currentTripSteps < 100000) { |
|
0 commit comments