summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Notifications.cpp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2021-08-01 14:13:32 +0300
committerRiku Isokoski <riksu9000@gmail.com>2021-08-01 14:13:32 +0300
commita618f43b4d8b1d0868c37e10193d3c95ce080040 (patch)
tree087d151c77562799ead1058739d289ed44cd74f9 /src/displayapp/screens/Notifications.cpp
parente6dcb3009fe6f847a7486dbb1b3143bbf49a15b9 (diff)
Fixes
Diffstat (limited to 'src/displayapp/screens/Notifications.cpp')
-rw-r--r--src/displayapp/screens/Notifications.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp
index 5096917e..c061c146 100644
--- a/src/displayapp/screens/Notifications.cpp
+++ b/src/displayapp/screens/Notifications.cpp
@@ -11,6 +11,7 @@ extern lv_font_t jetbrains_mono_bold_20;
Notifications::Notifications(DisplayApp* app,
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
+ Pinetime::Controllers::MotorController& motorController,
Modes mode)
: Screen(app), notificationManager {notificationManager}, alertNotificationService {alertNotificationService}, mode {mode} {
notificationManager.ClearNewNotificationFlag();
@@ -35,16 +36,21 @@ Notifications::Notifications(DisplayApp* app,
alertNotificationService);
}
- if (mode == Modes::Preview && notification.category != Controllers::NotificationManager::Categories::IncomingCall) {
- timeoutLine = lv_line_create(lv_scr_act(), nullptr);
+ if (mode == Modes::Preview) {
+ if (notification.category == Controllers::NotificationManager::Categories::IncomingCall) {
+ motorController.StartRinging();
+ } else {
+ motorController.RunForDuration(35);
+ timeoutLine = lv_line_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_line_width(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
- lv_obj_set_style_local_line_color(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
- lv_obj_set_style_local_line_rounded(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, true);
+ lv_obj_set_style_local_line_width(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
+ lv_obj_set_style_local_line_color(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
+ lv_obj_set_style_local_line_rounded(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, true);
- lv_line_set_points(timeoutLine, timeoutLinePoints, 2);
- timeoutTickCountStart = xTaskGetTickCount();
- timeoutTickCountEnd = timeoutTickCountStart + (5 * 1024);
+ lv_line_set_points(timeoutLine, timeoutLinePoints, 2);
+ timeoutTickCountStart = xTaskGetTickCount();
+ timeoutTickCountEnd = timeoutTickCountStart + (5 * 1024);
+ }
}
}
@@ -68,8 +74,9 @@ bool Notifications::Refresh() {
}
bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
- if (mode != Modes::Normal)
- return true;
+ if (mode != Modes::Normal) {
+ return false;
+ }
switch (event) {
case Pinetime::Applications::TouchEvents::SwipeDown: {