#include "ApplicationList.h" #include #include #include "Symbols.h" #include "Tile.h" #include "displayapp/Apps.h" #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; ApplicationList::ApplicationList(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::Settings &settingsController, Pinetime::Controllers::Battery& batteryController, Controllers::DateTime& dateTimeController) : Screen(app), settingsController{settingsController}, batteryController{batteryController}, dateTimeController{dateTimeController}, screens{app, settingsController.GetAppMenu(), { [this]() -> std::unique_ptr { return CreateScreen1(); }, [this]() -> std::unique_ptr { return CreateScreen2(); }, //[this]() -> std::unique_ptr { return CreateScreen3(); } }, Screens::ScreenListModes::UpDown } {} ApplicationList::~ApplicationList() { lv_obj_clean(lv_scr_act()); } bool ApplicationList::Refresh() { if(running) running = screens.Refresh(); return running; } bool ApplicationList::OnTouchEvent(Pinetime::Applications::TouchEvents event) { return screens.OnTouchEvent(event); } std::unique_ptr ApplicationList::CreateScreen1() { std::array applications { { {Symbols::stopWatch, Apps::StopWatch}, {Symbols::music, Apps::Music}, {Symbols::map, Apps::Navigation}, {Symbols::shoe, Apps::Motion}, {Symbols::heartBeat, Apps::HeartRate}, {"Tasks", Apps::Tasks}, } }; return std::make_unique(0, 2, app, settingsController, batteryController, dateTimeController, applications); } std::unique_ptr ApplicationList::CreateScreen2() { std::array applications { { {Symbols::paintbrush, Apps::Paint}, {Symbols::paddle, Apps::Paddle}, {"2", Apps::Twos}, {"", Apps::None}, {"", Apps::None}, {"", Apps::None}, } }; return std::make_unique(1, 2, app, settingsController, batteryController, dateTimeController, applications); } /*std::unique_ptr ApplicationList::CreateScreen3() { std::array applications { {{"A", Apps::Meter}, {"B", Apps::Navigation}, {"C", Apps::Clock}, {"D", Apps::Music}, {"E", Apps::SysInfo}, {"F", Apps::Brightness} } }; return std::make_unique(2, 3, app, settingsController, batteryController, dateTimeController, applications); }*/