diff options
| author | Jean-François Milants <jf@codingfield.com> | 2021-03-07 07:44:14 (GMT) |
|---|---|---|
| committer | Jean-François Milants <jf@codingfield.com> | 2021-03-07 07:44:14 (GMT) |
| commit | 9f67e6f6525bd4071609ff9edd6ce132d7ca1464 (patch) | |
| tree | 65b2dc22bb257c6dd4fc8be77762173b564c340c /src/displayapp/screens/Notifications.h | |
| parent | 740b3d7b58dd92a6a6f99620a090ae4f05c03299 (diff) | |
| parent | ada942535718d48eec37cca4f50d678e7201dc67 (diff) | |
Merge branch 'develop' into recovery-firmware
# Conflicts:
# src/CMakeLists.txt
# src/displayapp/DisplayApp.h
# src/systemtask/SystemTask.cpp
# src/systemtask/SystemTask.h
Diffstat (limited to 'src/displayapp/screens/Notifications.h')
| -rw-r--r-- | src/displayapp/screens/Notifications.h | 58 |
1 files changed, 38 insertions, 20 deletions
diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index f5c6a86..028a378 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -7,50 +7,68 @@ #include "components/ble/NotificationManager.h" namespace Pinetime { + namespace Controllers { + class AlertNotificationService; + } namespace Applications { namespace Screens { + class Notifications : public Screen { public: enum class Modes {Normal, Preview}; - explicit Notifications(DisplayApp* app, Pinetime::Controllers::NotificationManager& notificationManager, Modes mode); + explicit Notifications(DisplayApp* app, Pinetime::Controllers::NotificationManager& notificationManager, Pinetime::Controllers::AlertNotificationService& alertNotificationService, Modes mode); ~Notifications() override; bool Refresh() override; bool OnButtonPushed() override; bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override; + class NotificationItem { + public: + NotificationItem(const char* title, const char* msg, uint8_t notifNr, Controllers::NotificationManager::Categories, uint8_t notifNb, Modes mode, Pinetime::Controllers::AlertNotificationService& alertNotificationService); + ~NotificationItem(); + bool Refresh() {return false;} + void OnAcceptIncomingCall(lv_event_t event); + void OnMuteIncomingCall(lv_event_t event); + void OnRejectIncomingCall(lv_event_t event); + private: - bool running = true; + uint8_t notifNr = 0; + uint8_t notifNb = 0; + char pageText[4]; - class NotificationItem { - public: - NotificationItem(const char* title, const char* msg, uint8_t notifNr, uint8_t notifNb, Modes mode); - ~NotificationItem(); - bool Refresh() {return false;} - - private: - uint8_t notifNr = 0; - uint8_t notifNb = 0; - char pageText[4]; - - lv_obj_t* container1; - lv_obj_t* t1; - lv_obj_t* l1; - lv_obj_t* bottomPlaceholder; - Modes mode; - }; + lv_obj_t* container1; + lv_obj_t* t1; + lv_obj_t* l1; + lv_obj_t* l2; + lv_obj_t* bt_accept; + lv_obj_t* bt_mute; + lv_obj_t* bt_reject; + lv_obj_t* label_accept; + lv_obj_t* label_mute; + lv_obj_t* label_reject; + lv_obj_t* bottomPlaceholder; + Modes mode; + Pinetime::Controllers::AlertNotificationService& alertNotificationService; + + + }; + + private: + bool running = true; struct NotificationData { const char* title; const char* text; }; Pinetime::Controllers::NotificationManager& notificationManager; + Pinetime::Controllers::AlertNotificationService& alertNotificationService; Modes mode = Modes::Normal; std::unique_ptr<NotificationItem> currentItem; Controllers::NotificationManager::Notification::Id currentId; bool validDisplay = false; - lv_point_t timeoutLinePoints[2] { {0, 237}, {239, 237} }; + lv_point_t timeoutLinePoints[2] { {0, 1}, {239, 1} }; lv_obj_t* timeoutLine; uint32_t timeoutTickCountStart; uint32_t timeoutTickCountEnd; |
