1
0
Fork 0

Re-order apps in application menu on 2 pages.

Add firmware validation app.
This commit is contained in:
JF 2020-08-14 20:47:21 +02:00
parent e6f5ab7b91
commit 41c36d3a42
5 changed files with 19 additions and 15 deletions

View file

@ -2,6 +2,6 @@
namespace Pinetime { namespace Pinetime {
namespace Applications { 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};
} }
} }

View file

@ -190,6 +190,7 @@ void DisplayApp::RunningState() {
case Apps::Gauge: currentScreen.reset(new Screens::Gauge(this)); break; case Apps::Gauge: currentScreen.reset(new Screens::Gauge(this)); break;
case Apps::Brightness : currentScreen.reset(new Screens::Brightness(this, brightnessController)); 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::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; nextApp = Apps::None;
} }

View file

@ -11,7 +11,7 @@ ApplicationList::ApplicationList(Pinetime::Applications::DisplayApp *app) :
Screen(app), Screen(app),
screens{app, { screens{app, {
[this]() -> std::unique_ptr<Screen> { return CreateScreen1(); }, [this]() -> std::unique_ptr<Screen> { return CreateScreen1(); },
//[this]() -> std::unique_ptr<Screen> { return CreateScreen2(); }, [this]() -> std::unique_ptr<Screen> { return CreateScreen2(); },
//[this]() -> std::unique_ptr<Screen> { return CreateScreen3(); } //[this]() -> std::unique_ptr<Screen> { return CreateScreen3(); }
} }
} {} } {}
@ -39,13 +39,15 @@ bool ApplicationList::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
std::unique_ptr<Screen> ApplicationList::CreateScreen1() { std::unique_ptr<Screen> ApplicationList::CreateScreen1() {
std::array<Screens::Tile::Applications, 6> applications { std::array<Screens::Tile::Applications, 6> applications {
{{Symbols::asterisk, Apps::Meter}, {{Symbols::clock, Apps::Clock},
{Symbols::tachometer, Apps::Gauge},
{Symbols::clock, Apps::Clock},
{Symbols::music, Apps::Music}, {Symbols::music, Apps::Music},
{Symbols::sun, Apps::Brightness},
{Symbols::list, Apps::SysInfo}, {Symbols::list, Apps::SysInfo},
{Symbols::sun, Apps::Brightness} {Symbols::check, Apps::FirmwareValidation},
{Symbols::none, Apps::None}
} }
}; };
return std::unique_ptr<Screen>(new Screens::Tile(app, applications)); return std::unique_ptr<Screen>(new Screens::Tile(app, applications));
@ -53,12 +55,12 @@ std::unique_ptr<Screen> ApplicationList::CreateScreen1() {
std::unique_ptr<Screen> ApplicationList::CreateScreen2() { std::unique_ptr<Screen> ApplicationList::CreateScreen2() {
std::array<Screens::Tile::Applications, 6> applications { std::array<Screens::Tile::Applications, 6> applications {
{{"0", Apps::Meter}, {{Symbols::tachometer, Apps::Gauge},
{"1", Apps::Gauge}, {Symbols::asterisk, Apps::Meter},
{"2", Apps::Clock}, {Symbols::none, Apps::None},
{"3", Apps::Music}, {Symbols::none, Apps::None},
{"4", Apps::SysInfo}, {Symbols::none, Apps::None},
{"5", Apps::Brightness} {Symbols::none, Apps::None}
} }
}; };

View file

@ -22,7 +22,7 @@ namespace Pinetime {
private: private:
bool running = true; bool running = true;
ScreenList<1> screens; ScreenList<2> screens;
std::unique_ptr<Screen> CreateScreen1(); std::unique_ptr<Screen> CreateScreen1();
std::unique_ptr<Screen> CreateScreen2(); std::unique_ptr<Screen> CreateScreen2();
std::unique_ptr<Screen> CreateScreen3(); std::unique_ptr<Screen> CreateScreen3();

View file

@ -4,6 +4,7 @@ namespace Pinetime {
namespace Applications { namespace Applications {
namespace Screens { namespace Screens {
namespace Symbols { namespace Symbols {
static constexpr char* none = "";
static constexpr char* batteryFull = "\xEF\x89\x80"; static constexpr char* batteryFull = "\xEF\x89\x80";
static constexpr char* batteryEmpty = "\xEF\x89\x84"; static constexpr char* batteryEmpty = "\xEF\x89\x84";
static constexpr char* batteryThreeQuarter = "\xEF\x89\x81"; static constexpr char* batteryThreeQuarter = "\xEF\x89\x81";