diff options
author | JF <jf@codingfield.com> | 2020-04-05 18:59:15 +0200 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2020-04-05 18:59:15 +0200 |
commit | 6e1bd118c5ecc53016548072501591b329500870 (patch) | |
tree | 8447f6b7bbff0f423e9cf5d15ed709c630bed25e /src/DisplayApp/DisplayApp.cpp | |
parent | 7e9a7e4d5fa0f55b43180600d499f1d0ce6aded1 (diff) | |
parent | d5c2a58914fdeac4ef69382269b81d529e6d7c90 (diff) |
Merge branch 'ble-notifications' of JF/PineTime into develop
Diffstat (limited to 'src/DisplayApp/DisplayApp.cpp')
-rw-r--r-- | src/DisplayApp/DisplayApp.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/DisplayApp/DisplayApp.cpp b/src/DisplayApp/DisplayApp.cpp index e7187f1d..1b4515e0 100644 --- a/src/DisplayApp/DisplayApp.cpp +++ b/src/DisplayApp/DisplayApp.cpp @@ -15,18 +15,16 @@ #include <DisplayApp/Screens/Gauge.h> #include <DisplayApp/Screens/Brightness.h> #include <DisplayApp/Screens/ScreenList.h> +#include <Components/Ble/NotificationManager.h> #include "../SystemTask/SystemTask.h" using namespace Pinetime::Applications; -DisplayApp::DisplayApp(Pinetime::Drivers::St7789& lcd, - Pinetime::Components::LittleVgl& lvgl, - Pinetime::Drivers::Cst816S& touchPanel, - Controllers::Battery &batteryController, - Controllers::Ble &bleController, - Controllers::DateTime &dateTimeController, - Pinetime::Drivers::WatchdogView& watchdog, - Pinetime::System::SystemTask& systemTask) : +DisplayApp::DisplayApp(Drivers::St7789 &lcd, Components::LittleVgl &lvgl, Drivers::Cst816S &touchPanel, + Controllers::Battery &batteryController, Controllers::Ble &bleController, + Controllers::DateTime &dateTimeController, Drivers::WatchdogView &watchdog, + System::SystemTask &systemTask, + Pinetime::Controllers::NotificationManager& notificationManager) : lcd{lcd}, lvgl{lvgl}, batteryController{batteryController}, @@ -35,9 +33,11 @@ DisplayApp::DisplayApp(Pinetime::Drivers::St7789& lcd, watchdog{watchdog}, touchPanel{touchPanel}, currentScreen{new Screens::Clock(this, dateTimeController, batteryController, bleController) }, - systemTask{systemTask} { + systemTask{systemTask}, + notificationManager{notificationManager} { msgQueue = xQueueCreate(queueSize, itemSize); onClockApp = true; + modal.reset(new Screens::Modal(this)); } void DisplayApp::Start() { @@ -103,6 +103,7 @@ void DisplayApp::Refresh() { state = States::Running; break; case Messages::UpdateDateTime: +// modal->Show(); break; case Messages::UpdateBleConnection: // clockScreen.SetBleConnectionState(bleController.IsConnected() ? Screens::Clock::BleConnectionStates::Connected : Screens::Clock::BleConnectionStates::NotConnected); @@ -110,6 +111,11 @@ void DisplayApp::Refresh() { case Messages::UpdateBatteryLevel: // clockScreen.SetBatteryPercentRemaining(batteryController.PercentRemaining()); break; + case Messages::NewNotification: { + auto notification = notificationManager.Pop(); + modal->Show(notification.message.data()); + } + break; case Messages::TouchEvent: { if (state != States::Running) break; auto gesture = OnTouchEvent(); |