#include "Settings.h" #include #include #include "displayapp/screens/List.h" #include "displayapp/Apps.h" #include "displayapp/DisplayApp.h" #include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; Settings::Settings(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) : Screen(app), settingsController {settingsController}, screens {app, settingsController.GetSettingsMenu(), {[this]() -> std::unique_ptr { return CreateScreen1(); }, [this]() -> std::unique_ptr { return CreateScreen2(); }, [this]() -> std::unique_ptr { return CreateScreen3(); }}, Screens::ScreenListModes::UpDown} { } Settings::~Settings() { lv_obj_clean(lv_scr_act()); } bool Settings::OnTouchEvent(Pinetime::Applications::TouchEvents event) { return screens.OnTouchEvent(event); } std::unique_ptr Settings::CreateScreen1() { std::array applications {{ {Symbols::sun, "Display", Apps::SettingDisplay}, {Symbols::eye, "Wake Up", Apps::SettingWakeUp}, {Symbols::clock, "Time format", Apps::SettingTimeFormat}, {Symbols::home, "Watch face", Apps::SettingWatchFace}, }}; return std::make_unique(0, 3, app, settingsController, applications); } std::unique_ptr Settings::CreateScreen2() { std::array applications {{ {Symbols::shoe, "Steps", Apps::SettingSteps}, {Symbols::batteryHalf, "Battery", Apps::BatteryInfo}, {Symbols::clock, "Set date", Apps::SettingSetDate}, {Symbols::clock, "Set time", Apps::SettingSetTime} }}; return std::make_unique(1, 3, app, settingsController, applications); } std::unique_ptr Settings::CreateScreen3() { std::array applications {{ {Symbols::check, "Firmware", Apps::FirmwareValidation}, {Symbols::list, "About", Apps::SysInfo}, {Symbols::none, "None", Apps::None}, {Symbols::none, "None", Apps::None} }}; return std::make_unique(2, 3, app, settingsController, applications); }