From 55427d83b87960903cd6213ac9c73e694ee547bd Mon Sep 17 00:00:00 2001 From: JF Date: Mon, 19 Oct 2020 21:46:41 +0200 Subject: [WIP] Add new notification UI that use HW scrolling effects. Both notification apps are available in the menu, we can compare them. --- src/displayapp/screens/Notifications.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src/displayapp/screens/Notifications.h') diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index b4d0beda..e6f20877 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -1,11 +1,11 @@ #pragma once -#include +#include +#include + #include "Screen.h" -#include -#include "Modal.h" -#include -#include +#include "ScreenList.h" + namespace Pinetime { namespace Applications { @@ -17,19 +17,27 @@ namespace Pinetime { bool Refresh() override; bool OnButtonPushed() override; - void OnObjectEvent(lv_obj_t* obj, lv_event_t event, uint32_t buttonId); bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override; private: - class ListWidget { + ScreenList<3> screens; + bool running = true; + std::unique_ptr CreateScreen1(); + std::unique_ptr CreateScreen2(); + std::unique_ptr CreateScreen3(); + + class NotificationItem : public Screen { public: - ListWidget(); + NotificationItem(DisplayApp* app, const char* title, const char* msg, uint8_t notifNr, uint8_t notifNb); + NotificationItem(DisplayApp* app, const char* title1, const char* msg1, const char* title2, const char* msg2, uint8_t notifNr, uint8_t notifNb); + ~NotificationItem() override; + bool Refresh() override {return false;} + private: - lv_obj_t* page = nullptr; + uint8_t notifNr = 0; + uint8_t notifNb = 0; + char pageText[4]; }; - - bool running = true; - ListWidget list; }; } } -- cgit v1.2.3-70-g09d2