Compare commits

..

No commits in common. "f7f20405161a413122e875eff4f8d55b4784c1ee" and "9fb8505a82cab9b345ee339f97f8f9d6630d87e0" have entirely different histories.

2 changed files with 21 additions and 25 deletions

View File

@ -148,27 +148,25 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(Controllers::DateTime& dateTi
lv_obj_set_pos(backgroundLabel, 0, 0); lv_obj_set_pos(backgroundLabel, 0, 0);
lv_label_set_text_static(backgroundLabel, ""); lv_label_set_text_static(backgroundLabel, "");
//Working here heartbeatIcon = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_static(heartbeatIcon, Symbols::heartBeat);
lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2);
stepIcon = lv_label_create(lv_scr_act(), nullptr); heartbeatValue = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_static(stepIcon, Symbols::shoe); lv_obj_set_style_local_text_color(heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text); lv_label_set_text_static(heartbeatValue, "");
lv_obj_align(stepIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2); lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
stepValue = lv_label_create(lv_scr_act(), nullptr); stepValue = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text); lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_label_set_text_static(stepValue, ""); lv_label_set_text_static(stepValue, "0");
lv_obj_align(stepValue, stepIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0); lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, -2);
oldStepValue = lv_label_create(lv_scr_act(), nullptr); stepIcon = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(oldStepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text); lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_label_set_text_static(oldStepValue, "0"); lv_label_set_text_static(stepIcon, Symbols::shoe);
lv_obj_align(oldStepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, -2); lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0);
oldStepIcon = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(oldStepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_label_set_text_static(oldStepIcon, Symbols::shoe);
lv_obj_align(oldStepIcon, oldStepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0);
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
Refresh(); Refresh();
@ -295,22 +293,22 @@ void WatchFaceCasioStyleG7710::Refresh() {
heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped; heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) { if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
if (heartbeatRunning.Get()) { if (heartbeatRunning.Get()) {
lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text); lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get()); lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
} else { } else {
lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x1B1B1B)); lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x1B1B1B));
lv_label_set_text_static(heartbeatValue, ""); lv_label_set_text_static(heartbeatValue, "");
} }
lv_obj_realign(stepIcon); lv_obj_realign(heartbeatIcon);
lv_obj_realign(heartbeatValue); lv_obj_realign(heartbeatValue);
} }
stepCount = motionController.NbSteps(); stepCount = motionController.NbSteps();
if (stepCount.IsUpdated()) { if (stepCount.IsUpdated()) {
lv_label_set_text_fmt(oldStepValue, "%lu", stepCount.Get()); lv_label_set_text_fmt(stepValue, "%lu", stepCount.Get());
lv_obj_realign(oldStepValue); lv_obj_realign(stepValue);
lv_obj_realign(oldStepIcon); lv_obj_realign(stepIcon);
} }
} }

View File

@ -80,10 +80,8 @@ namespace Pinetime {
lv_obj_t* label_battery_value; lv_obj_t* label_battery_value;
lv_obj_t* heartbeatIcon; lv_obj_t* heartbeatIcon;
lv_obj_t* heartbeatValue; lv_obj_t* heartbeatValue;
lv_obj_t* stepIcon; //TODO: remove unused variables lv_obj_t* stepIcon;
lv_obj_t* oldStepIcon;
lv_obj_t* stepValue; lv_obj_t* stepValue;
lv_obj_t* oldStepValue;
lv_obj_t* notificationIcon; lv_obj_t* notificationIcon;
lv_obj_t* line_icons; lv_obj_t* line_icons;