@@ -14,15 +14,17 @@ Notifications::Notifications(DisplayApp* app,
1414 Pinetime::Controllers::NotificationManager& notificationManager,
1515 Pinetime::Controllers::AlertNotificationService& alertNotificationService,
1616 Pinetime::Controllers::MotorController& motorController,
17+ Pinetime::Controllers::Settings& settingsController,
1718 System::SystemTask& systemTask,
1819 Modes mode)
1920 : app {app},
2021 notificationManager {notificationManager},
2122 alertNotificationService {alertNotificationService},
2223 motorController {motorController},
24+ settingsController {settingsController},
2325 wakeLock (systemTask),
2426 mode {mode} {
25-
27+ printf ( " Notifications: mode=%d, timeoutLength=%lu \n " , ( int )mode, timeoutLength);
2628 notificationManager.ClearNewNotificationFlag ();
2729 auto notification = notificationManager.GetLastNotification ();
2830 if (notification.valid ) {
@@ -33,10 +35,11 @@ Notifications::Notifications(DisplayApp* app,
3335 notification.category ,
3436 notificationManager.NbNotifications (),
3537 alertNotificationService,
36- motorController);
38+ motorController,
39+ settingsController);
3740 validDisplay = true ;
3841 } else {
39- currentItem = std::make_unique<NotificationItem>(alertNotificationService, motorController);
42+ currentItem = std::make_unique<NotificationItem>(alertNotificationService, motorController, settingsController );
4043 validDisplay = false ;
4144 }
4245 if (mode == Modes::Preview) {
@@ -109,7 +112,8 @@ void Notifications::Refresh() {
109112 notification.category ,
110113 notificationManager.NbNotifications (),
111114 alertNotificationService,
112- motorController);
115+ motorController,
116+ settingsController);
113117 } else {
114118 running = false ;
115119 }
@@ -202,7 +206,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
202206 previousNotification.category ,
203207 notificationManager.NbNotifications (),
204208 alertNotificationService,
205- motorController);
209+ motorController,
210+ settingsController);
206211 }
207212 return true ;
208213 case Pinetime::Applications::TouchEvents::SwipeUp: {
@@ -229,7 +234,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
229234 nextNotification.category ,
230235 notificationManager.NbNotifications (),
231236 alertNotificationService,
232- motorController);
237+ motorController,
238+ settingsController);
233239 }
234240 return true ;
235241 default :
@@ -245,14 +251,16 @@ namespace {
245251}
246252
247253Notifications::NotificationItem::NotificationItem (Pinetime::Controllers::AlertNotificationService& alertNotificationService,
248- Pinetime::Controllers::MotorController& motorController)
254+ Pinetime::Controllers::MotorController& motorController,
255+ Pinetime::Controllers::Settings& settingsController)
249256 : NotificationItem(" Notifications" ,
250257 " No notifications to display" ,
251258 0 ,
252259 Controllers::NotificationManager::Categories::Unknown,
253260 0 ,
254261 alertNotificationService,
255- motorController) {
262+ motorController,
263+ settingsController) {
256264}
257265
258266Notifications::NotificationItem::NotificationItem (const char * title,
@@ -261,8 +269,9 @@ Notifications::NotificationItem::NotificationItem(const char* title,
261269 Controllers::NotificationManager::Categories category,
262270 uint8_t notifNb,
263271 Pinetime::Controllers::AlertNotificationService& alertNotificationService,
264- Pinetime::Controllers::MotorController& motorController)
265- : alertNotificationService {alertNotificationService}, motorController {motorController} {
272+ Pinetime::Controllers::MotorController& motorController,
273+ Pinetime::Controllers::Settings& settingsController)
274+ : alertNotificationService {alertNotificationService}, motorController {motorController}, settingsController {settingsController} {
266275 container = lv_cont_create (lv_scr_act (), nullptr );
267276 lv_obj_set_size (container, LV_HOR_RES, LV_VER_RES);
268277 lv_obj_set_style_local_bg_color (container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
0 commit comments