InfiniTime.git

commit 55427d83b87960903cd6213ac9c73e694ee547bd

Author: JF <jf@codingfield.com>

[WIP] Add new notification UI that use HW scrolling effects. Both notification apps are available in the menu, we can compare them.

 src/CMakeLists.txt | 5 
 src/displayapp/Apps.h | 2 
 src/displayapp/DisplayApp.cpp | 2 
 src/displayapp/screens/ApplicationList.cpp | 4 
 src/displayapp/screens/Notifications.cpp | 214 +++++++++++-----
 src/displayapp/screens/Notifications.h | 32 +
 src/displayapp/screens/Notifications_swscroll.cpp | 145 +++++++++++
 src/displayapp/screens/Notifications_swscroll.h | 36 ++


diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4647e92d017ff6bf2a313ebe631e0a312c26c0c8..36c693112cf72aa1bd8302508c06ab0d79861381 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -342,6 +342,7 @@         displayapp/screens/Music.cpp
         displayapp/screens/FirmwareValidation.cpp
         displayapp/screens/ApplicationList.cpp
         displayapp/screens/Notifications.cpp
+        displayapp/screens/Notifications_swscroll.cpp
         main.cpp
         drivers/St7789.cpp
         drivers/SpiNorFlash.cpp
@@ -420,7 +421,8 @@         displayapp/screens/FirmwareUpdate.h
         displayapp/screens/FirmwareValidation.h
         displayapp/screens/ApplicationList.h
         displayapp/Apps.h
-        displayapp/screens/Notifications.h
+    displayapp/screens/Notifications.h
+    displayapp/screens/Notifications_swscroll.h.h
         drivers/St7789.h
         drivers/SpiNorFlash.h
         drivers/SpiMaster.h
@@ -749,7 +751,6 @@                 -c 'shutdown'
                 COMMENT "flashing ${EXECUTABLE_NAME}.hex"
                 )
     else ()
-        message()
         add_custom_target(FLASH_ERASE
                 COMMAND ${OPENOCD_BIN_PATH} -f interface/stlink.cfg -c 'transport select hla_swd' -f target/nrf52.cfg -c init -c halt -c 'nrf5 mass_erase' -c reset -c shutdown
                 COMMENT "erasing flashing"




diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h
index bfa799ba04a5556114388fe2f841218b741c9662..8241b188f13a095153844c2935a1de9d700db95d 100644
--- a/src/displayapp/Apps.h
+++ b/src/displayapp/Apps.h
@@ -2,6 +2,6 @@ #pragma once
 
 namespace Pinetime {
   namespace Applications {
-    enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music, FirmwareValidation, Paint, Notifications};
+    enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music, FirmwareValidation, Paint, Notifications, Notifications2};
   }
 }
\ No newline at end of file




diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 6653fa3dd7ea45000ce3fbc68c63fbc964bbe44a..ab4a5a7d573bb7dae46f0538758f957ebab50b6a 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -9,6 +9,7 @@ #include 
 #include "components/datetime/DateTimeController.h"
 #include <drivers/Cst816s.h>
 #include "displayapp/screens/Notifications.h"
+#include "displayapp/screens/Notifications_swscroll.h"
 #include "displayapp/screens/Tile.h"
 #include "displayapp/screens/Meter.h"
 #include "displayapp/screens/Gauge.h"
@@ -204,6 +205,7 @@       case Apps::Brightness : currentScreen.reset(new Screens::Brightness(this, brightnessController)); break;
       case Apps::Music : currentScreen.reset(new Screens::Music(this, systemTask.nimble().music())); break;
       case Apps::FirmwareValidation: currentScreen.reset(new Screens::FirmwareValidation(this, validator)); break;
       case Apps::Notifications: currentScreen.reset(new Screens::Notifications(this)); break;
+      case Apps::Notifications2: currentScreen.reset(new Screens::Notifications2(this)); break;
     }
     nextApp = Apps::None;
   }




diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp
index 27590b9733deea01b0ae310f1dd7b5d0cf72396c..8d98606280a22dc8ef828dc1fcad0ac6f2acc142 100644
--- a/src/displayapp/screens/ApplicationList.cpp
+++ b/src/displayapp/screens/ApplicationList.cpp
@@ -58,8 +58,8 @@   std::array applications {
           {{Symbols::tachometer, Apps::Gauge},
            {Symbols::asterisk, Apps::Meter},
            {Symbols::paintbrush, Apps::Paint},
-           {Symbols::shoe, Apps::Notifications},
-           {Symbols::none, Apps::None},
+                  {Symbols::shoe, Apps::Notifications},
+                  {Symbols::shoe, Apps::Notifications2},
            {Symbols::none, Apps::None}
           }
   };




diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp
index fd1225f379d4f06af1569ae448fe26da12893c31..3cd26353256ebaa3592561d30675a7bd39afef7b 100644
--- a/src/displayapp/screens/Notifications.cpp
+++ b/src/displayapp/screens/Notifications.cpp
@@ -1,12 +1,16 @@
+#include <libs/lvgl/lvgl.h>
+#include <displayapp/DisplayApp.h>
+#include <functional>
 #include "Notifications.h"
-#include "displayapp/DisplayApp.h"
-#include <libs/lvgl/lvgl.h>
-
 using namespace Pinetime::Applications::Screens;
 
-Notifications::Notifications(DisplayApp* app) : Screen(app) {
+Notifications::Notifications(DisplayApp* app) : Screen(app), screens{app, {
+        [this]() -> std::unique_ptr<Screen> { return CreateScreen1(); },
+        [this]() -> std::unique_ptr<Screen> { return CreateScreen2(); },
+        [this]() -> std::unique_ptr<Screen> { return CreateScreen3(); }
+}
+} {
 
-  app->SetTouchMode(DisplayApp::TouchModes::Polling);
 }
 
 Notifications::~Notifications() {
@@ -14,132 +18,196 @@   lv_obj_clean(lv_scr_act());
 }
 
 bool Notifications::Refresh() {
+  screens.Refresh();
   return running;
 }
 
-void Notifications::OnObjectEvent(lv_obj_t *obj, lv_event_t event, uint32_t buttonId) {
-
+bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
+  return screens.OnTouchEvent(event);
 }
-
-bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { return true; }
 
 
 bool Notifications::OnButtonPushed() {
-  app->StartApp(Apps::Clock);
   running = false;
   return true;
 }
 
-
-Notifications::ListWidget::ListWidget() {
-  static lv_point_t valid_pos[] = {{0,0}, {0,1}};
-  page = lv_tileview_create(lv_scr_act(), NULL);
-  lv_obj_set_size(page, LV_HOR_RES, LV_VER_RES);
-  lv_obj_align(page, NULL, LV_ALIGN_CENTER, 0, 0);
-  lv_tileview_set_valid_positions(page, valid_pos, 2);
+std::unique_ptr<Screen> Notifications::CreateScreen1() {
+  return std::unique_ptr<Screen>(new Notifications::NotificationItem(app, "Message", "Marcel Pickett: Did you bring your ticket?", "Shot notif", "Short text", 1, 3));
+}
 
-  static lv_style_t pageStyle;
-  lv_style_copy(&pageStyle, lv_tileview_get_style(page, LV_TILEVIEW_STYLE_MAIN));
+std::unique_ptr<Screen> Notifications::CreateScreen2() {
+  return std::unique_ptr<Screen>(new Notifications::NotificationItem(app, "Alarm", "Missed: 09:30", 2, 3));
+}
 
-  lv_tileview_set_style(page, LV_TILEVIEW_STYLE_MAIN, &pageStyle);
+std::unique_ptr<Screen> Notifications::CreateScreen3() {
+  return std::unique_ptr<Screen>(new Notifications::NotificationItem(app, "Spotify", "Now playing: Bame game - Kanye West", 3, 3));
+}
 
+Notifications::NotificationItem::NotificationItem(Pinetime::Applications::DisplayApp *app, const char *title, const char* msg, uint8_t notifNr, uint8_t notifNb) :
+        Screen(app), notifNr{notifNr}, notifNb{notifNb} {
 
-  lv_obj_t* container1 = lv_cont_create(page, NULL);
+  lv_obj_t* container1 = lv_cont_create(lv_scr_act(), NULL);
   static lv_style_t contStyle;
   lv_style_copy(&contStyle, lv_cont_get_style(container1, LV_CONT_STYLE_MAIN));
   contStyle.body.padding.inner = 20;
   lv_cont_set_style(container1, LV_CONT_STYLE_MAIN, &contStyle);
   lv_obj_set_width(container1, LV_HOR_RES);
+  lv_obj_set_height(container1, LV_VER_RES);
   lv_obj_set_pos(container1, 0, 0);
-  lv_cont_set_layout(container1, LV_LAYOUT_COL_M);
-  lv_cont_set_fit2(container1, LV_FIT_FLOOD, LV_FIT_TIGHT);
+  lv_cont_set_layout(container1, LV_LAYOUT_OFF);
+  lv_cont_set_fit2(container1, LV_FIT_FLOOD, LV_FIT_FLOOD);
 
-  lv_tileview_add_element(page, container1);
 
 
   lv_obj_t* t1 = lv_label_create(container1, NULL);
 
   static lv_style_t titleStyle;
   static lv_style_t textStyle;
+  static lv_style_t bottomStyle;
   lv_style_copy(&titleStyle, lv_label_get_style(t1, LV_LABEL_STYLE_MAIN));
   lv_style_copy(&textStyle, lv_label_get_style(t1, LV_LABEL_STYLE_MAIN));
+  lv_style_copy(&bottomStyle, lv_label_get_style(t1, LV_LABEL_STYLE_MAIN));
+  titleStyle.body.padding.inner = 5;
+  textStyle.body.padding.inner = 5;
+  titleStyle.body.grad_color = LV_COLOR_GRAY;
+  titleStyle.body.main_color = LV_COLOR_GRAY;
+  textStyle.body.border.part = LV_BORDER_NONE;
 
-  //titleStyle.body.main_color = LV_COLOR_RED;
-  //titleStyle.body.grad_color = LV_COLOR_RED;
-  titleStyle.body.padding.inner = 5;
+  //bottomStyle.body.padding.inner = 5;
+  bottomStyle.body.main_color = LV_COLOR_GREEN;
+  bottomStyle.body.grad_color = LV_COLOR_GREEN;
+  bottomStyle.body.border.part = LV_BORDER_TOP;
+  bottomStyle.body.border.color = LV_COLOR_RED;
 
-  //textStyle.body.main_color = LV_COLOR_BLUE;
-  //textStyle.body.grad_color = LV_COLOR_BLUE;
-  textStyle.body.padding.inner = 5;
 
   lv_label_set_style(t1, LV_LABEL_STYLE_MAIN, &titleStyle);
   lv_label_set_long_mode(t1, LV_LABEL_LONG_BREAK);
   lv_label_set_body_draw(t1, true);
   lv_obj_set_width(t1, LV_HOR_RES - (titleStyle.body.padding.left + titleStyle.body.padding.right) );
-  lv_label_set_text(t1, "Message");
+  lv_label_set_text(t1, title);
+  lv_obj_set_pos(t1, titleStyle.body.padding.left, titleStyle.body.padding.top);
 
+  auto titleHeight = lv_obj_get_height(t1);
 
   lv_obj_t* l1 = lv_label_create(container1, NULL);
-  lv_label_set_style(l1, LV_PAGE_STYLE_BG, &textStyle);
+  lv_label_set_style(l1, LV_LABEL_STYLE_MAIN, &textStyle);
+  lv_obj_set_pos(l1, textStyle.body.padding.left, titleHeight + titleStyle.body.padding.bottom + textStyle.body.padding.bottom + textStyle.body.padding.top);
+
   lv_label_set_long_mode(l1, LV_LABEL_LONG_BREAK);
   lv_label_set_body_draw(l1, true);
   lv_obj_set_width(l1, LV_HOR_RES - (textStyle.body.padding.left + textStyle.body.padding.right) );
-  lv_label_set_text(l1, "Marcel Pickett: Did you bring your ticket?");
+  lv_label_set_text(l1, msg);
 
-  /*---*/
-  lv_obj_t* container2 = lv_cont_create(page, NULL);
-  lv_cont_set_style(container2, LV_CONT_STYLE_MAIN, &contStyle);
-  lv_obj_set_width(container2, LV_HOR_RES);
-  lv_obj_set_pos(container2, 0, lv_obj_get_y(container1) + lv_obj_get_height(container1)+5);
-  lv_cont_set_layout(container2, LV_LAYOUT_COL_M);
-  lv_cont_set_fit2(container2, LV_FIT_FLOOD, LV_FIT_TIGHT);
-  lv_tileview_add_element(page, container2);
+  lv_obj_t* bottomlabel = lv_label_create(container1, NULL);
+  lv_label_set_style(bottomlabel, LV_LABEL_STYLE_MAIN, &bottomStyle);
+  lv_obj_set_width(bottomlabel, LV_HOR_RES - (bottomStyle.body.padding.left + bottomStyle.body.padding.right) );
+  snprintf(pageText, 4,  "%d/%d", notifNr, notifNb);
+  lv_label_set_text(bottomlabel, pageText);
+  auto bottomHeight = lv_obj_get_height(bottomlabel);
+  lv_obj_set_pos(bottomlabel, 0, LV_VER_RES - (bottomHeight*2));
+}
 
-  lv_obj_t* t2 = lv_label_create(container2, NULL);
-  lv_label_set_style(t2, LV_PAGE_STYLE_BG, &titleStyle);
-  lv_label_set_long_mode(t2, LV_LABEL_LONG_BREAK);
-  lv_label_set_body_draw(t2, true);
-  lv_obj_set_width(t2, LV_HOR_RES - (titleStyle.body.padding.left + titleStyle.body.padding.right) );
-  lv_label_set_text(t2, "Alarm");
+Notifications::NotificationItem::NotificationItem(Pinetime::Applications::DisplayApp *app, const char *title1, const char* msg1, const char *title2, const char* msg2, uint8_t notifNr, uint8_t notifNb) :
+        Screen(app), notifNr{notifNr}, notifNb{notifNb} {
 
+  lv_obj_t* container1 = lv_cont_create(lv_scr_act(), NULL);
+  static lv_style_t contStyle;
+  lv_style_copy(&contStyle, lv_cont_get_style(container1, LV_CONT_STYLE_MAIN));
+  contStyle.body.padding.inner = 20;
+  lv_cont_set_style(container1, LV_CONT_STYLE_MAIN, &contStyle);
+  lv_obj_set_width(container1, LV_HOR_RES);
+  lv_obj_set_height(container1, LV_VER_RES);
+  lv_obj_set_pos(container1, 0, 0);
+  lv_cont_set_layout(container1, LV_LAYOUT_OFF);
+  lv_cont_set_fit2(container1, LV_FIT_FLOOD, LV_FIT_FLOOD);
 
-  lv_obj_t* l2 = lv_label_create(container2, NULL);
-  lv_label_set_style(l2, LV_PAGE_STYLE_BG, &textStyle);
-  lv_label_set_long_mode(l2, LV_LABEL_LONG_BREAK);
-  lv_label_set_body_draw(l2, true);
-  lv_obj_set_width(l2, LV_HOR_RES - (textStyle.body.padding.left + textStyle.body.padding.right) );
-  lv_label_set_text(l2, "Missed: 09:30");
+
 
-  /*****/
-  lv_obj_t* container3 = lv_cont_create(page, NULL);
-  lv_cont_set_style(container3, LV_CONT_STYLE_MAIN, &contStyle);
-  lv_obj_set_width(container3, LV_HOR_RES);
-  lv_obj_set_pos(container3, 0, lv_obj_get_y(container2) + lv_obj_get_height(container2)+5);
-  lv_cont_set_layout(container3, LV_LAYOUT_COL_M);
-  lv_cont_set_fit2(container3, LV_FIT_FLOOD, LV_FIT_TIGHT);
-  lv_tileview_add_element(page, container3);
+  lv_obj_t* t1 = lv_label_create(container1, NULL);
 
-  lv_obj_t* t3 = lv_label_create(container3, NULL);
-  lv_label_set_style(t3, LV_PAGE_STYLE_BG, &titleStyle);
-  lv_label_set_long_mode(t3, LV_LABEL_LONG_BREAK);
-  lv_label_set_body_draw(t3, true);
-  lv_obj_set_width(t3, LV_HOR_RES - (titleStyle.body.padding.left + titleStyle.body.padding.right) );
-  lv_label_set_text(t3, "Spotify");
+  static lv_style_t titleStyle;
+  static lv_style_t textStyle;
+  static lv_style_t bottomStyle;
+  lv_style_copy(&titleStyle, lv_label_get_style(t1, LV_LABEL_STYLE_MAIN));
+  lv_style_copy(&textStyle, lv_label_get_style(t1, LV_LABEL_STYLE_MAIN));
+  lv_style_copy(&bottomStyle, lv_label_get_style(t1, LV_LABEL_STYLE_MAIN));
+  titleStyle.body.padding.inner = 5;
+  textStyle.body.padding.inner = 5;
+  titleStyle.body.grad_color = LV_COLOR_GRAY;
+  titleStyle.body.main_color = LV_COLOR_GRAY;
+  textStyle.body.border.part = LV_BORDER_NONE;
+
+  //bottomStyle.body.padding.inner = 5;
+  bottomStyle.body.main_color = LV_COLOR_GREEN;
+  bottomStyle.body.grad_color = LV_COLOR_GREEN;
+  bottomStyle.body.border.part = LV_BORDER_TOP;
+  bottomStyle.body.border.color = LV_COLOR_RED;
+
+
+  lv_label_set_style(t1, LV_LABEL_STYLE_MAIN, &titleStyle);
+  lv_label_set_long_mode(t1, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(t1, true);
+  lv_obj_set_width(t1, LV_HOR_RES - (titleStyle.body.padding.left + titleStyle.body.padding.right) );
+  lv_label_set_text(t1, title1);
+  lv_obj_set_pos(t1, titleStyle.body.padding.left, titleStyle.body.padding.top);
+
+  auto titleHeight = lv_obj_get_height(t1);
+
+  lv_obj_t* l1 = lv_label_create(container1, NULL);
+  lv_label_set_style(l1, LV_LABEL_STYLE_MAIN, &textStyle);
+  lv_obj_set_pos(l1, textStyle.body.padding.left, titleHeight + titleStyle.body.padding.bottom + textStyle.body.padding.bottom + textStyle.body.padding.top);
 
+  lv_label_set_long_mode(l1, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(l1, true);
+  lv_obj_set_width(l1, LV_HOR_RES - (textStyle.body.padding.left + textStyle.body.padding.right) );
+  lv_label_set_text(l1, msg1);
 
-  lv_obj_t* l3 = lv_label_create(container3, NULL);
-  lv_label_set_style(l3, LV_PAGE_STYLE_BG, &textStyle);
-  lv_label_set_long_mode(l3, LV_LABEL_LONG_BREAK);
-  lv_label_set_body_draw(l3, true);
-  lv_obj_set_width(l3, LV_HOR_RES - (textStyle.body.padding.left + textStyle.body.padding.right) );
-  lv_label_set_text(l3, "Now playing: Bame game - Kanye West");
+  auto bottomPos = lv_obj_get_y(l1) + lv_obj_get_height(l1) + textStyle.body.padding.bottom;
 
+  /*
+  lv_obj_t* bottomlabel = lv_label_create(container1, NULL);
+  lv_label_set_style(bottomlabel, LV_LABEL_STYLE_MAIN, &bottomStyle);
+  lv_obj_set_width(bottomlabel, LV_HOR_RES - (bottomStyle.body.padding.left + bottomStyle.body.padding.right) );
+  snprintf(pageText, 4,  "%d/%d", notifNr, notifNb);
+  lv_label_set_text(bottomlabel, pageText);
+  auto bottomHeight = lv_obj_get_height(bottomlabel);
+  lv_obj_set_pos(bottomlabel, 0, LV_VER_RES - (bottomHeight*2));
+   */
 
+  //-------------------------------------------------
+/*
+  lv_obj_t* container2 = lv_cont_create(lv_scr_act(), NULL);
+  lv_cont_set_style(container2, LV_CONT_STYLE_MAIN, &contStyle);
+  lv_obj_set_width(container2, LV_HOR_RES);
+  lv_obj_set_height(container2, LV_VER_RES - bottomPos);
+  lv_obj_set_pos(container2, 0, bottomPos);
+  lv_cont_set_layout(container2, LV_LAYOUT_OFF);
+  lv_cont_set_fit2(container2, LV_FIT_FLOOD, LV_FIT_FLOOD);
+*/
+  lv_obj_t* t2 = lv_label_create(container1, NULL);
 
 
+  lv_label_set_style(t2, LV_LABEL_STYLE_MAIN, &titleStyle);
+  lv_label_set_long_mode(t2, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(t2, true);
+  lv_obj_set_width(t2, LV_HOR_RES - (titleStyle.body.padding.left + titleStyle.body.padding.right) );
+  lv_label_set_text(t2, title2);
+  lv_obj_set_pos(t2, titleStyle.body.padding.left, bottomPos + titleStyle.body.padding.top);
 
+  auto title2Height = lv_obj_get_height(t2);
 
+  lv_obj_t* l2 = lv_label_create(container1, NULL);
+  lv_label_set_style(l2, LV_LABEL_STYLE_MAIN, &textStyle);
+  lv_obj_set_pos(l2, textStyle.body.padding.left, bottomPos + title2Height + titleStyle.body.padding.bottom + textStyle.body.padding.bottom + textStyle.body.padding.top);
 
+  lv_label_set_long_mode(l2, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(l2, true);
+  lv_obj_set_width(l2, LV_HOR_RES - (textStyle.body.padding.left + textStyle.body.padding.right) );
+  lv_label_set_text(l2, msg2);
 
+}
 
+Notifications::NotificationItem::~NotificationItem() {
+  lv_obj_clean(lv_scr_act());
 }




diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h
index b4d0beda6a686623a041175e36f674333d59c8ab..e6f208776397c5cf9d26f6e8df6fe5421f1933e5 100644
--- a/src/displayapp/screens/Notifications.h
+++ b/src/displayapp/screens/Notifications.h
@@ -1,11 +1,11 @@
 #pragma once
 
-#include <cstdint>
+#include <functional>
+#include <vector>
+
 #include "Screen.h"
-#include <bits/unique_ptr.h>
-#include "Modal.h"
-#include <lvgl/src/lv_core/lv_style.h>
-#include <displayapp/Apps.h>
+#include "ScreenList.h"
+
 
 namespace Pinetime {
   namespace Applications {
@@ -17,19 +17,27 @@           ~Notifications() override;
 
           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<Screen> CreateScreen1();
+          std::unique_ptr<Screen> CreateScreen2();
+          std::unique_ptr<Screen> 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;
       };
     }
   }




diff --git a/src/displayapp/screens/Notifications_swscroll.cpp b/src/displayapp/screens/Notifications_swscroll.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a5eb74e967b123d950fc610bd4dd831517d814bb
--- /dev/null
+++ b/src/displayapp/screens/Notifications_swscroll.cpp
@@ -0,0 +1,145 @@
+#include "Notifications_swscroll.h"
+#include "displayapp/DisplayApp.h"
+#include <libs/lvgl/lvgl.h>
+
+using namespace Pinetime::Applications::Screens;
+
+Notifications2::Notifications2(DisplayApp* app) : Screen(app) {
+
+  app->SetTouchMode(DisplayApp::TouchModes::Polling);
+}
+
+Notifications2::~Notifications2() {
+  lv_obj_clean(lv_scr_act());
+}
+
+bool Notifications2::Refresh() {
+  return running;
+}
+
+void Notifications2::OnObjectEvent(lv_obj_t *obj, lv_event_t event, uint32_t buttonId) {
+
+}
+
+bool Notifications2::OnTouchEvent(Pinetime::Applications::TouchEvents event) { return true; }
+
+
+bool Notifications2::OnButtonPushed() {
+  app->StartApp(Apps::Clock);
+  running = false;
+  return true;
+}
+
+
+Notifications2::ListWidget::ListWidget() {
+  static lv_point_t valid_pos[] = {{0,0}, {0,1}};
+  page = lv_tileview_create(lv_scr_act(), NULL);
+  lv_obj_set_size(page, LV_HOR_RES, LV_VER_RES);
+  lv_obj_align(page, NULL, LV_ALIGN_CENTER, 0, 0);
+  lv_tileview_set_valid_positions(page, valid_pos, 2);
+
+  static lv_style_t pageStyle;
+  lv_style_copy(&pageStyle, lv_tileview_get_style(page, LV_TILEVIEW_STYLE_MAIN));
+
+  lv_tileview_set_style(page, LV_TILEVIEW_STYLE_MAIN, &pageStyle);
+
+
+  lv_obj_t* container1 = lv_cont_create(page, NULL);
+  static lv_style_t contStyle;
+  lv_style_copy(&contStyle, lv_cont_get_style(container1, LV_CONT_STYLE_MAIN));
+  contStyle.body.padding.inner = 20;
+  lv_cont_set_style(container1, LV_CONT_STYLE_MAIN, &contStyle);
+  lv_obj_set_width(container1, LV_HOR_RES);
+  lv_obj_set_pos(container1, 0, 0);
+  lv_cont_set_layout(container1, LV_LAYOUT_COL_M);
+  lv_cont_set_fit2(container1, LV_FIT_FLOOD, LV_FIT_TIGHT);
+
+  lv_tileview_add_element(page, container1);
+
+
+  lv_obj_t* t1 = lv_label_create(container1, NULL);
+
+  static lv_style_t titleStyle;
+  static lv_style_t textStyle;
+  lv_style_copy(&titleStyle, lv_label_get_style(t1, LV_LABEL_STYLE_MAIN));
+  lv_style_copy(&textStyle, lv_label_get_style(t1, LV_LABEL_STYLE_MAIN));
+
+  //titleStyle.body.main_color = LV_COLOR_RED;
+  //titleStyle.body.grad_color = LV_COLOR_RED;
+  titleStyle.body.padding.inner = 5;
+
+  //textStyle.body.main_color = LV_COLOR_BLUE;
+  //textStyle.body.grad_color = LV_COLOR_BLUE;
+  textStyle.body.padding.inner = 5;
+
+  lv_label_set_style(t1, LV_LABEL_STYLE_MAIN, &titleStyle);
+  lv_label_set_long_mode(t1, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(t1, true);
+  lv_obj_set_width(t1, LV_HOR_RES - (titleStyle.body.padding.left + titleStyle.body.padding.right) );
+  lv_label_set_text(t1, "Message");
+
+
+  lv_obj_t* l1 = lv_label_create(container1, NULL);
+  lv_label_set_style(l1, LV_PAGE_STYLE_BG, &textStyle);
+  lv_label_set_long_mode(l1, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(l1, true);
+  lv_obj_set_width(l1, LV_HOR_RES - (textStyle.body.padding.left + textStyle.body.padding.right) );
+  lv_label_set_text(l1, "Marcel Pickett: Did you bring your ticket?");
+
+  /*---*/
+  lv_obj_t* container2 = lv_cont_create(page, NULL);
+  lv_cont_set_style(container2, LV_CONT_STYLE_MAIN, &contStyle);
+  lv_obj_set_width(container2, LV_HOR_RES);
+  lv_obj_set_pos(container2, 0, lv_obj_get_y(container1) + lv_obj_get_height(container1)+5);
+  lv_cont_set_layout(container2, LV_LAYOUT_COL_M);
+  lv_cont_set_fit2(container2, LV_FIT_FLOOD, LV_FIT_TIGHT);
+  lv_tileview_add_element(page, container2);
+
+  lv_obj_t* t2 = lv_label_create(container2, NULL);
+  lv_label_set_style(t2, LV_PAGE_STYLE_BG, &titleStyle);
+  lv_label_set_long_mode(t2, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(t2, true);
+  lv_obj_set_width(t2, LV_HOR_RES - (titleStyle.body.padding.left + titleStyle.body.padding.right) );
+  lv_label_set_text(t2, "Alarm");
+
+
+  lv_obj_t* l2 = lv_label_create(container2, NULL);
+  lv_label_set_style(l2, LV_PAGE_STYLE_BG, &textStyle);
+  lv_label_set_long_mode(l2, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(l2, true);
+  lv_obj_set_width(l2, LV_HOR_RES - (textStyle.body.padding.left + textStyle.body.padding.right) );
+  lv_label_set_text(l2, "Missed: 09:30");
+
+  /*****/
+  lv_obj_t* container3 = lv_cont_create(page, NULL);
+  lv_cont_set_style(container3, LV_CONT_STYLE_MAIN, &contStyle);
+  lv_obj_set_width(container3, LV_HOR_RES);
+  lv_obj_set_pos(container3, 0, lv_obj_get_y(container2) + lv_obj_get_height(container2)+5);
+  lv_cont_set_layout(container3, LV_LAYOUT_COL_M);
+  lv_cont_set_fit2(container3, LV_FIT_FLOOD, LV_FIT_TIGHT);
+  lv_tileview_add_element(page, container3);
+
+  lv_obj_t* t3 = lv_label_create(container3, NULL);
+  lv_label_set_style(t3, LV_PAGE_STYLE_BG, &titleStyle);
+  lv_label_set_long_mode(t3, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(t3, true);
+  lv_obj_set_width(t3, LV_HOR_RES - (titleStyle.body.padding.left + titleStyle.body.padding.right) );
+  lv_label_set_text(t3, "Spotify");
+
+
+  lv_obj_t* l3 = lv_label_create(container3, NULL);
+  lv_label_set_style(l3, LV_PAGE_STYLE_BG, &textStyle);
+  lv_label_set_long_mode(l3, LV_LABEL_LONG_BREAK);
+  lv_label_set_body_draw(l3, true);
+  lv_obj_set_width(l3, LV_HOR_RES - (textStyle.body.padding.left + textStyle.body.padding.right) );
+  lv_label_set_text(l3, "Now playing: Bame game - Kanye West");
+
+
+
+
+
+
+
+
+
+}




diff --git a/src/displayapp/screens/Notifications_swscroll.h b/src/displayapp/screens/Notifications_swscroll.h
new file mode 100644
index 0000000000000000000000000000000000000000..48960797f6da5a85634292f002d47e8d4a50ad1a
--- /dev/null
+++ b/src/displayapp/screens/Notifications_swscroll.h
@@ -0,0 +1,36 @@
+#pragma once
+
+#include <cstdint>
+#include "Screen.h"
+#include <bits/unique_ptr.h>
+#include "Modal.h"
+#include <lvgl/src/lv_core/lv_style.h>
+#include <displayapp/Apps.h>
+
+namespace Pinetime {
+  namespace Applications {
+    namespace Screens {
+      class Notifications2 : public Screen {
+        public:
+          explicit Notifications2(DisplayApp* app);
+          ~Notifications2() override;
+
+          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 {
+            public:
+              ListWidget();
+            private:
+              lv_obj_t* page = nullptr;
+          };
+
+          bool running = true;
+          ListWidget list;
+      };
+    }
+  }
+}