summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Notifications.h
diff options
context:
space:
mode:
authorJF002 <JF002@users.noreply.github.com>2020-10-27 21:57:48 +0100
committerGitHub <noreply@github.com>2020-10-27 21:57:48 +0100
commitcb9e8815d8bc6ce71fd8e97f3e3dae402658ce1f (patch)
tree1750edfed02f547102e468eca485caab3b08e98d /src/displayapp/screens/Notifications.h
parentc5bf09d21b2ed8e2435ec625e351594f58713924 (diff)
parent7de43a16608e599369867cb3cfa7d5776a5b6380 (diff)
Merge pull request #108 from JF002/notification-ui
Improved notification UI
Diffstat (limited to 'src/displayapp/screens/Notifications.h')
-rw-r--r--src/displayapp/screens/Notifications.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h
new file mode 100644
index 00000000..fb4e1ef2
--- /dev/null
+++ b/src/displayapp/screens/Notifications.h
@@ -0,0 +1,61 @@
+#pragma once
+
+#include <functional>
+#include <vector>
+
+#include "Screen.h"
+#include "ScreenList.h"
+
+
+namespace Pinetime {
+ namespace Applications {
+ namespace Screens {
+ class Notifications : public Screen {
+ public:
+ enum class Modes {Normal, Preview};
+ explicit Notifications(DisplayApp* app, Pinetime::Controllers::NotificationManager& notificationManager, Modes mode);
+ ~Notifications() override;
+
+ bool Refresh() override;
+ bool OnButtonPushed() override;
+ bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;
+
+ private:
+ bool running = true;
+
+ 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;
+ };
+
+ struct NotificationData {
+ const char* title;
+ const char* text;
+ };
+ Pinetime::Controllers::NotificationManager& notificationManager;
+ 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_obj_t* timeoutLine;
+ uint32_t timeoutTickCountStart;
+ uint32_t timeoutTickCountEnd;
+ };
+ }
+ }
+}