diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-04-13 18:53:16 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-04-13 18:53:16 (GMT) |
| commit | 531c1172a2357d53b214aaf7b29efee47d9b32e5 (patch) | |
| tree | e9c008f13900e1d3c63332a3bbc305754f8ae35c /src/displayapp/DisplayApp.cpp | |
| parent | 27fa6bba08766831fe143fe5ca13767bedcd9072 (diff) | |
Revert "Sans notification (notification manager retained as it seems to be used by the dfu manager)"ultraredux2
This reverts commit 569e6fea41c13f33ad1374bb80ca489aaf4a7037.
Diffstat (limited to 'src/displayapp/DisplayApp.cpp')
| -rw-r--r-- | src/displayapp/DisplayApp.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 8f6ab6e..e7b3416 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -10,6 +10,7 @@ #include "displayapp/screens/Clock.h" #include "displayapp/screens/FirmwareUpdate.h" #include "displayapp/screens/FirmwareValidation.h" +#include "displayapp/screens/Notifications.h" #include "displayapp/screens/Tile.h" #include "displayapp/screens/Error.h" @@ -141,6 +142,9 @@ void DisplayApp::Refresh() { // clockScreen.SetBleConnectionState(bleController.IsConnected() ? Screens::Clock::BleConnectionStates::Connected : // Screens::Clock::BleConnectionStates::NotConnected); break; + case Messages::NewNotification: + LoadApp(Apps::NotificationsPreview, DisplayApp::FullRefreshDirections::Down); + break; case Messages::TouchEvent: { if (state != States::Running) { break; @@ -155,6 +159,9 @@ void DisplayApp::Refresh() { case TouchEvents::SwipeUp: LoadApp(Apps::Launcher, DisplayApp::FullRefreshDirections::Up); break; + case TouchEvents::SwipeDown: + LoadApp(Apps::Notifications, DisplayApp::FullRefreshDirections::Down); + break; case TouchEvents::SwipeRight: LoadApp(Apps::QuickSettings, DisplayApp::FullRefreshDirections::RightAnim); break; @@ -177,7 +184,9 @@ void DisplayApp::Refresh() { break; case Messages::ButtonLongPressed: if (currentApp != Apps::Clock) { - if (currentApp == Apps::QuickSettings) { + if (currentApp == Apps::Notifications) { + LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::Up); + } else if (currentApp == Apps::QuickSettings) { LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::LeftAnim); } else { LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::Down); @@ -188,6 +197,12 @@ void DisplayApp::Refresh() { // Open up Firmware window, before possible reboot if press continues LoadApp(Apps::FirmwareValidation, DisplayApp::FullRefreshDirections::Up); break; + case Messages::ButtonDoubleClicked: + if (currentApp != Apps::Notifications && currentApp != Apps::NotificationsPreview) { + LoadApp(Apps::Notifications, DisplayApp::FullRefreshDirections::Down); + } + break; + case Messages::BleFirmwareUpdateStarted: LoadApp(Apps::FirmwareUpdate, DisplayApp::FullRefreshDirections::Down); break; @@ -259,6 +274,16 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) currentScreen = std::make_unique<Screens::FirmwareUpdate>(this, bleController); ReturnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::None); break; + case Apps::Notifications: + currentScreen = std::make_unique<Screens::Notifications>( + this, notificationManager, systemTask->nimble().alertService(), motorController, *systemTask, Screens::Notifications::Modes::Normal); + ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); + break; + case Apps::NotificationsPreview: + currentScreen = std::make_unique<Screens::Notifications>( + this, notificationManager, systemTask->nimble().alertService(), motorController, *systemTask, Screens::Notifications::Modes::Preview); + ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); + break; // Settings case Apps::QuickSettings: currentScreen = std::make_unique<Screens::QuickSettings>( |
