From 1d3742e14f09316a1d795527713eb8f9742f0ffb Mon Sep 17 00:00:00 2001 From: Joaquim Date: Sun, 4 Apr 2021 03:08:51 +0100 Subject: Big UI and navigation Rewrite new navigation add some color to the apps redesign menus new settings menu new quick settings code clean up size reduction by converting navigation images to font and more... --- src/displayapp/screens/Notifications.cpp | 48 +++++++++++++------------------- 1 file changed, 20 insertions(+), 28 deletions(-) (limited to 'src/displayapp/screens/Notifications.cpp') diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index c903ed0f..ea6adc64 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -18,21 +18,21 @@ Notifications::Notifications(DisplayApp *app, if(notification.valid) { currentId = notification.id; currentItem = std::make_unique("\nNotification", - notification.message.data(), - notification.index, - notification.category, - notificationManager.NbNotifications(), - mode, - alertNotificationService); + notification.message.data(), + notification.index, + notification.category, + notificationManager.NbNotifications(), + mode, + alertNotificationService); validDisplay = true; } else { currentItem = std::make_unique("\nNotification", - "No notification to display", - 0, - notification.category, - notificationManager.NbNotifications(), - Modes::Preview, - alertNotificationService); + "No notification to display", + 0, + notification.category, + notificationManager.NbNotifications(), + Modes::Preview, + alertNotificationService); } if(mode == Modes::Preview) { @@ -62,11 +62,6 @@ bool Notifications::Refresh() { timeoutLinePoints[1].x = pos; lv_line_set_points(timeoutLine, timeoutLinePoints, 2); - - if (!running) { - // Start clock app when exiting this one - app->StartApp(Apps::Clock); - } } return running; @@ -74,7 +69,7 @@ bool Notifications::Refresh() { bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { switch (event) { - case Pinetime::Applications::TouchEvents::SwipeUp: { + case Pinetime::Applications::TouchEvents::SwipeDown: { Controllers::NotificationManager::Notification previousNotification; if(validDisplay) previousNotification = notificationManager.GetPrevious(currentId); @@ -86,7 +81,7 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { validDisplay = true; currentId = previousNotification.id; currentItem.reset(nullptr); - app->SetFullRefresh(DisplayApp::FullRefreshDirections::Up); + app->SetFullRefresh(DisplayApp::FullRefreshDirections::Down); currentItem = std::make_unique("\nNotification", previousNotification.message.data(), previousNotification.index, @@ -96,19 +91,22 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { alertNotificationService); } return true; - case Pinetime::Applications::TouchEvents::SwipeDown: { + case Pinetime::Applications::TouchEvents::SwipeUp: { Controllers::NotificationManager::Notification nextNotification; if(validDisplay) nextNotification = notificationManager.GetNext(currentId); else nextNotification = notificationManager.GetLastNotification(); - if (!nextNotification.valid) return true; + if (!nextNotification.valid) { + running = false; + return false; + } validDisplay = true; currentId = nextNotification.id; currentItem.reset(nullptr); - app->SetFullRefresh(DisplayApp::FullRefreshDirections::Down); + app->SetFullRefresh(DisplayApp::FullRefreshDirections::Up); currentItem = std::make_unique("\nNotification", nextNotification.message.data(), nextNotification.index, @@ -127,12 +125,6 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } } - -bool Notifications::OnButtonPushed() { - running = false; - return true; -} - namespace { static void AcceptIncomingCallEventHandler(lv_obj_t* obj, lv_event_t event) { auto* item = static_cast(obj->user_data); -- cgit v1.2.3-70-g09d2