From 41c36d3a422fd08867f743de78c0aeee4418b622 Mon Sep 17 00:00:00 2001 From: JF Date: Fri, 14 Aug 2020 20:47:21 +0200 Subject: [PATCH] Re-order apps in application menu on 2 pages. Add firmware validation app. --- src/DisplayApp/Apps.h | 2 +- src/DisplayApp/DisplayApp.cpp | 1 + src/DisplayApp/Screens/ApplicationList.cpp | 28 ++++++++++++---------- src/DisplayApp/Screens/ApplicationList.h | 2 +- src/DisplayApp/Screens/Symbols.h | 1 + 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/DisplayApp/Apps.h b/src/DisplayApp/Apps.h index 2ee74299..2666d905 100644 --- a/src/DisplayApp/Apps.h +++ b/src/DisplayApp/Apps.h @@ -2,6 +2,6 @@ namespace Pinetime { namespace Applications { - enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music}; + enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music, FirmwareValidation}; } } \ No newline at end of file diff --git a/src/DisplayApp/DisplayApp.cpp b/src/DisplayApp/DisplayApp.cpp index bbd99a3d..93557807 100644 --- a/src/DisplayApp/DisplayApp.cpp +++ b/src/DisplayApp/DisplayApp.cpp @@ -190,6 +190,7 @@ void DisplayApp::RunningState() { case Apps::Gauge: currentScreen.reset(new Screens::Gauge(this)); break; 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; } nextApp = Apps::None; } diff --git a/src/DisplayApp/Screens/ApplicationList.cpp b/src/DisplayApp/Screens/ApplicationList.cpp index c7c096f4..575426f0 100644 --- a/src/DisplayApp/Screens/ApplicationList.cpp +++ b/src/DisplayApp/Screens/ApplicationList.cpp @@ -11,7 +11,7 @@ ApplicationList::ApplicationList(Pinetime::Applications::DisplayApp *app) : Screen(app), screens{app, { [this]() -> std::unique_ptr { return CreateScreen1(); }, - //[this]() -> std::unique_ptr { return CreateScreen2(); }, + [this]() -> std::unique_ptr { return CreateScreen2(); }, //[this]() -> std::unique_ptr { return CreateScreen3(); } } } {} @@ -39,13 +39,15 @@ bool ApplicationList::OnTouchEvent(Pinetime::Applications::TouchEvents event) { std::unique_ptr ApplicationList::CreateScreen1() { std::array applications { - {{Symbols::asterisk, Apps::Meter}, - {Symbols::tachometer, Apps::Gauge}, - {Symbols::clock, Apps::Clock}, - {Symbols::music, Apps::Music}, - {Symbols::list, Apps::SysInfo}, - {Symbols::sun, Apps::Brightness} + {{Symbols::clock, Apps::Clock}, + {Symbols::music, Apps::Music}, + {Symbols::sun, Apps::Brightness}, + {Symbols::list, Apps::SysInfo}, + {Symbols::check, Apps::FirmwareValidation}, + {Symbols::none, Apps::None} } + + }; return std::unique_ptr(new Screens::Tile(app, applications)); @@ -53,12 +55,12 @@ std::unique_ptr ApplicationList::CreateScreen1() { std::unique_ptr ApplicationList::CreateScreen2() { std::array applications { - {{"0", Apps::Meter}, - {"1", Apps::Gauge}, - {"2", Apps::Clock}, - {"3", Apps::Music}, - {"4", Apps::SysInfo}, - {"5", Apps::Brightness} + {{Symbols::tachometer, Apps::Gauge}, + {Symbols::asterisk, Apps::Meter}, + {Symbols::none, Apps::None}, + {Symbols::none, Apps::None}, + {Symbols::none, Apps::None}, + {Symbols::none, Apps::None} } }; diff --git a/src/DisplayApp/Screens/ApplicationList.h b/src/DisplayApp/Screens/ApplicationList.h index 372cbb7a..a1e6811b 100644 --- a/src/DisplayApp/Screens/ApplicationList.h +++ b/src/DisplayApp/Screens/ApplicationList.h @@ -22,7 +22,7 @@ namespace Pinetime { private: bool running = true; - ScreenList<1> screens; + ScreenList<2> screens; std::unique_ptr CreateScreen1(); std::unique_ptr CreateScreen2(); std::unique_ptr CreateScreen3(); diff --git a/src/DisplayApp/Screens/Symbols.h b/src/DisplayApp/Screens/Symbols.h index 940006d5..54c3f8f0 100644 --- a/src/DisplayApp/Screens/Symbols.h +++ b/src/DisplayApp/Screens/Symbols.h @@ -4,6 +4,7 @@ namespace Pinetime { namespace Applications { namespace Screens { namespace Symbols { + static constexpr char* none = ""; static constexpr char* batteryFull = "\xEF\x89\x80"; static constexpr char* batteryEmpty = "\xEF\x89\x84"; static constexpr char* batteryThreeQuarter = "\xEF\x89\x81";