@@ -17,6 +17,7 @@ Notifications::Notifications(DisplayApp* app,
1717 : Screen(app),
1818 notificationManager {notificationManager},
1919 alertNotificationService {alertNotificationService},
20+ motorController {motorController},
2021 systemTask {systemTask},
2122 mode {mode} {
2223 notificationManager.ClearNewNotificationFlag ();
@@ -29,7 +30,8 @@ Notifications::Notifications(DisplayApp* app,
2930 notification.category ,
3031 notificationManager.NbNotifications (),
3132 mode,
32- alertNotificationService);
33+ alertNotificationService,
34+ motorController);
3335 validDisplay = true ;
3436 } else {
3537 currentItem = std::make_unique<NotificationItem>(" Notification" ,
@@ -38,7 +40,8 @@ Notifications::Notifications(DisplayApp* app,
3840 notification.category ,
3941 notificationManager.NbNotifications (),
4042 Modes::Preview,
41- alertNotificationService);
43+ alertNotificationService,
44+ motorController);
4245 }
4346
4447 if (mode == Modes::Preview) {
@@ -66,7 +69,7 @@ Notifications::Notifications(DisplayApp* app,
6669Notifications::~Notifications () {
6770 lv_task_del (taskRefresh);
6871 // make sure we stop any vibrations before exiting
69- Controllers::MotorController:: StopRinging ();
72+ motorController. StopRinging ();
7073 systemTask.PushMessage (System::Messages::EnableSleeping);
7174 lv_obj_clean (lv_scr_act ());
7275}
@@ -87,7 +90,7 @@ void Notifications::Refresh() {
8790
8891void Notifications::OnPreviewInteraction () {
8992 systemTask.PushMessage (System::Messages::EnableSleeping);
90- Controllers::MotorController:: StopRinging ();
93+ motorController. StopRinging ();
9194 if (timeoutLine != nullptr ) {
9295 lv_obj_del (timeoutLine);
9396 timeoutLine = nullptr ;
@@ -125,7 +128,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
125128 previousNotification.category ,
126129 notificationManager.NbNotifications (),
127130 mode,
128- alertNotificationService);
131+ alertNotificationService,
132+ motorController);
129133 }
130134 return true ;
131135 case Pinetime::Applications::TouchEvents::SwipeUp: {
@@ -150,7 +154,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
150154 nextNotification.category ,
151155 notificationManager.NbNotifications (),
152156 mode,
153- alertNotificationService);
157+ alertNotificationService,
158+ motorController);
154159 }
155160 return true ;
156161 default :
@@ -171,8 +176,9 @@ Notifications::NotificationItem::NotificationItem(const char* title,
171176 Controllers::NotificationManager::Categories category,
172177 uint8_t notifNb,
173178 Modes mode,
174- Pinetime::Controllers::AlertNotificationService& alertNotificationService)
175- : mode {mode}, alertNotificationService {alertNotificationService} {
179+ Pinetime::Controllers::AlertNotificationService& alertNotificationService,
180+ Pinetime::Controllers::MotorController& motorController)
181+ : mode {mode}, alertNotificationService {alertNotificationService}, motorController {motorController} {
176182 lv_obj_t * container1 = lv_cont_create (lv_scr_act (), NULL );
177183
178184 lv_obj_set_style_local_bg_color (container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex (0x222222 ));
@@ -269,7 +275,7 @@ void Notifications::NotificationItem::OnCallButtonEvent(lv_obj_t* obj, lv_event_
269275 return ;
270276 }
271277
272- Controllers::MotorController:: StopRinging ();
278+ motorController. StopRinging ();
273279
274280 if (obj == bt_accept) {
275281 alertNotificationService.AcceptIncomingCall ();
0 commit comments