Skip to content

Commit 3f7c049

Browse files
Resolved duplication for Digital Watch Face
1 parent 56d8fdd commit 3f7c049

File tree

2 files changed

+3
-26
lines changed

2 files changed

+3
-26
lines changed

src/displayapp/screens/WatchFaceDigital.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "components/motion/MotionController.h"
1414
#include "components/ble/SimpleWeatherService.h"
1515
#include "components/settings/Settings.h"
16-
#include "components/alarm/AlarmController.h"
1716

1817
using namespace Pinetime::Applications::Screens;
1918

@@ -25,16 +24,14 @@ WatchFaceDigital::WatchFaceDigital(Controllers::DateTime& dateTimeController,
2524
Controllers::Settings& settingsController,
2625
Controllers::HeartRateController& heartRateController,
2726
Controllers::MotionController& motionController,
28-
Controllers::SimpleWeatherService& weatherService,
29-
Controllers::AlarmController& alarmController)
27+
Controllers::SimpleWeatherService& weatherService)
3028
: currentDateTime {{}},
3129
dateTimeController {dateTimeController},
3230
notificationManager {notificationManager},
3331
settingsController {settingsController},
3432
heartRateController {heartRateController},
3533
motionController {motionController},
3634
weatherService {weatherService},
37-
alarmController {alarmController},
3835
statusIcons(batteryController, bleController, alarmController) {
3936

4037
statusIcons.Create();
@@ -89,11 +86,6 @@ WatchFaceDigital::WatchFaceDigital(Controllers::DateTime& dateTimeController,
8986
lv_label_set_text_static(stepIcon, Symbols::shoe);
9087
lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0);
9188

92-
alarmIcon = lv_label_create(lv_scr_act(), nullptr);
93-
lv_obj_set_style_local_text_color(alarmIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FFE7));
94-
lv_label_set_text_static(alarmIcon, Symbols::bell);
95-
lv_obj_align(alarmIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0);
96-
9789
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
9890
Refresh();
9991
}
@@ -199,13 +191,4 @@ void WatchFaceDigital::Refresh() {
199191
lv_obj_realign(temperature);
200192
lv_obj_realign(weatherIcon);
201193
}
202-
203-
alarmSet = alarmController.IsEnabled();
204-
if (alarmSet.Get()) {
205-
lv_obj_set_style_local_text_color(alarmIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x6AA84F));
206-
lv_obj_realign(alarmIcon);
207-
} else {
208-
lv_obj_set_style_local_text_color(alarmIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x1B1B1B));
209-
lv_obj_realign(alarmIcon);
210-
}
211194
}

src/displayapp/screens/WatchFaceDigital.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace Pinetime {
2121
class NotificationManager;
2222
class HeartRateController;
2323
class MotionController;
24-
class AlarmController;
2524
}
2625

2726
namespace Applications {
@@ -37,8 +36,7 @@ namespace Pinetime {
3736
Controllers::Settings& settingsController,
3837
Controllers::HeartRateController& heartRateController,
3938
Controllers::MotionController& motionController,
40-
Controllers::SimpleWeatherService& weather,
41-
Controllers::AlarmController& alarmController);
39+
Controllers::SimpleWeatherService& weather);
4240
~WatchFaceDigital() override;
4341

4442
void Refresh() override;
@@ -53,7 +51,6 @@ namespace Pinetime {
5351
Utility::DirtyValue<bool> heartbeatRunning {};
5452
Utility::DirtyValue<bool> notificationState {};
5553
Utility::DirtyValue<std::optional<Pinetime::Controllers::SimpleWeatherService::CurrentWeather>> currentWeather {};
56-
Utility::DirtyValue<bool> alarmSet {};
5754

5855
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate;
5956

@@ -67,15 +64,13 @@ namespace Pinetime {
6764
lv_obj_t* notificationIcon;
6865
lv_obj_t* weatherIcon;
6966
lv_obj_t* temperature;
70-
lv_obj_t* alarmIcon;
7167

7268
Controllers::DateTime& dateTimeController;
7369
Controllers::NotificationManager& notificationManager;
7470
Controllers::Settings& settingsController;
7571
Controllers::HeartRateController& heartRateController;
7672
Controllers::MotionController& motionController;
7773
Controllers::SimpleWeatherService& weatherService;
78-
Controllers::AlarmController& alarmController;
7974

8075
lv_task_t* taskRefresh;
8176
Widgets::StatusIcons statusIcons;
@@ -96,8 +91,7 @@ namespace Pinetime {
9691
controllers.settingsController,
9792
controllers.heartRateController,
9893
controllers.motionController,
99-
*controllers.weatherController,
100-
controllers.alarmController);
94+
*controllers.weatherController);
10195
};
10296

10397
static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {

0 commit comments

Comments
 (0)