summaryrefslogtreecommitdiff
path: root/src/displayapp/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/screens')
-rw-r--r--src/displayapp/screens/Notifications.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp
index 1a8fca9c..2fac6acb 100644
--- a/src/displayapp/screens/Notifications.cpp
+++ b/src/displayapp/screens/Notifications.cpp
@@ -17,13 +17,13 @@ Notifications::Notifications(DisplayApp *app,
auto notification = notificationManager.GetLastNotification();
if(notification.valid) {
currentId = notification.id;
- currentItem = std::make_unique<NotificationItem>("\nNotification",
- notification.message.data(),
- notification.index,
- notification.category,
- notificationManager.NbNotifications(),
- mode,
- alertNotificationService);
+ currentItem = std::make_unique<NotificationItem>(notification.Title(),
+ notification.Message(),
+ notification.index,
+ notification.category,
+ notificationManager.NbNotifications(),
+ mode,
+ alertNotificationService);
validDisplay = true;
} else {
currentItem = std::make_unique<NotificationItem>("\nNotification",
@@ -68,6 +68,8 @@ bool Notifications::Refresh() {
}
bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
+ if(mode != Modes::Normal) return true;
+
switch (event) {
case Pinetime::Applications::TouchEvents::SwipeDown: {
Controllers::NotificationManager::Notification previousNotification;
@@ -82,8 +84,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
currentId = previousNotification.id;
currentItem.reset(nullptr);
app->SetFullRefresh(DisplayApp::FullRefreshDirections::Down);
- currentItem = std::make_unique<NotificationItem>("\nNotification",
- previousNotification.message.data(),
+ currentItem = std::make_unique<NotificationItem>(previousNotification.Title(),
+ previousNotification.Message(),
previousNotification.index,
previousNotification.category,
notificationManager.NbNotifications(),
@@ -107,8 +109,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
currentId = nextNotification.id;
currentItem.reset(nullptr);
app->SetFullRefresh(DisplayApp::FullRefreshDirections::Up);
- currentItem = std::make_unique<NotificationItem>("\nNotification",
- nextNotification.message.data(),
+ currentItem = std::make_unique<NotificationItem>(nextNotification.Title(),
+ nextNotification.Message(),
nextNotification.index,
nextNotification.category,
notificationManager.NbNotifications(),
@@ -170,8 +172,9 @@ namespace {
lv_obj_t* alert_type = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x888888));
+ if(title == nullptr) title = "Notification";
lv_label_set_text(alert_type, title);
- lv_obj_align(alert_type, NULL, LV_ALIGN_IN_TOP_LEFT, 0, -4);
+ lv_obj_align(alert_type, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 16);
/////////
switch(category) {