|
11 | 11 | #include "components/ble/SimpleWeatherService.h"
|
12 | 12 | #include "displayapp/screens/WeatherSymbols.h"
|
13 | 13 | #include "displayapp/InfiniTimeTheme.h"
|
| 14 | +#include "displayapp/InfiniTimeTheme.h" |
14 | 15 |
|
15 | 16 | using namespace Pinetime::Applications::Screens;
|
16 | 17 |
|
@@ -38,37 +39,45 @@ WatchFaceTerminal::WatchFaceTerminal(Controllers::DateTime& dateTimeController,
|
38 | 39 | connectState = lv_label_create(lv_scr_act(), nullptr);
|
39 | 40 | lv_label_set_recolor(connectState, true);
|
40 | 41 | lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60);
|
| 42 | + motionController {motionController} { |
41 | 43 |
|
42 | 44 | notificationIcon = lv_label_create(lv_scr_act(), nullptr);
|
43 |
| - lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_LEFT_MID, 0, -100); |
44 |
| - |
45 |
| - label_date = lv_label_create(lv_scr_act(), nullptr); |
46 |
| - lv_label_set_recolor(label_date, true); |
47 |
| - lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -40); |
| 45 | + lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_LEFT_MID, 0, -90); |
48 | 46 |
|
49 | 47 | label_prompt_1 = lv_label_create(lv_scr_act(), nullptr);
|
50 |
| - lv_obj_align(label_prompt_1, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -80); |
| 48 | + lv_obj_set_style_local_text_color(label_prompt_1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray); |
| 49 | + lv_obj_align(label_prompt_1, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -70); |
51 | 50 | lv_label_set_text_static(label_prompt_1, "user@watch:~ $ now");
|
52 | 51 |
|
53 |
| - label_prompt_2 = lv_label_create(lv_scr_act(), nullptr); |
54 |
| - lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 80); |
55 |
| - lv_label_set_text_static(label_prompt_2, "user@watch:~ $"); |
56 |
| - |
57 | 52 | label_time = lv_label_create(lv_scr_act(), nullptr);
|
58 | 53 | lv_label_set_recolor(label_time, true);
|
59 |
| - lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -60); |
| 54 | + lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -50); |
60 | 55 |
|
61 |
| - heartbeatValue = lv_label_create(lv_scr_act(), nullptr); |
62 |
| - lv_label_set_recolor(heartbeatValue, true); |
63 |
| - lv_obj_align(heartbeatValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 20); |
| 56 | + label_date = lv_label_create(lv_scr_act(), nullptr); |
| 57 | + lv_label_set_recolor(label_date, true); |
| 58 | + lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -30); |
| 59 | + |
| 60 | + batteryValue = lv_label_create(lv_scr_act(), nullptr); |
| 61 | + lv_label_set_recolor(batteryValue, true); |
| 62 | + lv_obj_align(batteryValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -10); |
64 | 63 |
|
65 | 64 | stepValue = lv_label_create(lv_scr_act(), nullptr);
|
66 | 65 | lv_label_set_recolor(stepValue, true);
|
67 |
| - lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 0); |
| 66 | + lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::orange); |
| 67 | + lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 10); |
68 | 68 |
|
69 |
| - weather = lv_label_create(lv_scr_act(), nullptr); |
70 |
| - lv_label_set_recolor(weather, true); |
71 |
| - lv_obj_align(weather, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 40); |
| 69 | + heartbeatValue = lv_label_create(lv_scr_act(), nullptr); |
| 70 | + lv_label_set_recolor(heartbeatValue, true); |
| 71 | + lv_obj_align(heartbeatValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 30); |
| 72 | + |
| 73 | + connectState = lv_label_create(lv_scr_act(), nullptr); |
| 74 | + lv_label_set_recolor(connectState, true); |
| 75 | + lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 50); |
| 76 | + |
| 77 | + label_prompt_2 = lv_label_create(lv_scr_act(), nullptr); |
| 78 | + lv_obj_set_style_local_text_color(label_prompt_2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray); |
| 79 | + lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 70); |
| 80 | + lv_label_set_text_static(label_prompt_2, "user@watch:~ $"); |
72 | 81 |
|
73 | 82 | taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
|
74 | 83 | Refresh();
|
@@ -143,35 +152,29 @@ void WatchFaceTerminal::Refresh() {
|
143 | 152 | heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
|
144 | 153 | if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
|
145 | 154 | if (heartbeatRunning.Get()) {
|
146 |
| - lv_label_set_text_fmt(heartbeatValue, "[L_HR]#ee3311 %d bpm#", heartbeat.Get()); |
| 155 | + |
| 156 | + lv_obj_set_style_local_text_color(heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::deepOrange); |
| 157 | + lv_label_set_text_fmt(heartbeatValue, "#ffffff [L_HR]# %d bpm", heartbeat.Get()); |
147 | 158 | } else {
|
148 |
| - lv_label_set_text_static(heartbeatValue, "[L_HR]#ee3311 ---#"); |
| 159 | + lv_label_set_text_static(heartbeatValue, "#ffffff [L_HR]# ---"); |
| 160 | + lv_obj_set_style_local_text_color(heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::gray); |
149 | 161 | }
|
150 | 162 | }
|
151 | 163 |
|
152 |
| - stepCount = motionController.NbSteps(); |
153 |
| - if (stepCount.IsUpdated()) { |
154 |
| - lv_label_set_text_fmt(stepValue, "[STEP]#ee3377 %lu steps#", stepCount.Get()); |
155 |
| - } |
156 |
| - |
157 |
| - currentWeather = weatherService.Current(); |
158 |
| - if (currentWeather.IsUpdated()) { |
159 |
| - auto optCurrentWeather = currentWeather.Get(); |
160 |
| - if (optCurrentWeather) { |
161 |
| - int16_t temp = optCurrentWeather->temperature.Celsius(); |
162 |
| - char tempUnit = 'C'; |
163 |
| - if (settingsController.GetWeatherFormat() == Controllers::Settings::WeatherFormat::Imperial) { |
164 |
| - temp = optCurrentWeather->temperature.Fahrenheit(); |
165 |
| - tempUnit = 'F'; |
166 |
| - } |
167 |
| - lv_label_set_text_fmt(weather, |
168 |
| - "[WTHR]#ffdd00 %d°%c %s#", |
169 |
| - temp, |
170 |
| - tempUnit, |
171 |
| - // Change to GetSimpleCondition with pull request #2134 (Add shorter/simpler weather condition options) |
172 |
| - Symbols::GetCondition(optCurrentWeather->iconId)); |
| 164 | + bleState = bleController.IsConnected(); |
| 165 | + bleRadioEnabled = bleController.IsRadioEnabled(); |
| 166 | + if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) { |
| 167 | + if (!bleRadioEnabled.Get()) { |
| 168 | + lv_label_set_text_static(connectState, "#ffffff [STAT]# Disabled"); |
| 169 | + lv_obj_set_style_local_text_color(connectState, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::gray); |
173 | 170 | } else {
|
174 |
| - lv_label_set_text(weather, "[WTHR]#ffdd00 ---"); |
| 171 | + if (bleState.Get()) { |
| 172 | + lv_label_set_text_static(connectState, "#ffffff [STAT]# Connected"); |
| 173 | + lv_obj_set_style_local_text_color(connectState, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::blue); |
| 174 | + } else { |
| 175 | + lv_label_set_text_static(connectState, "#ffffff [STAT]# Disconnected"); |
| 176 | + lv_obj_set_style_local_text_color(connectState, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::gray); |
| 177 | + } |
175 | 178 | }
|
176 | 179 | }
|
177 | 180 | }
|
0 commit comments