Merge branch 'develop' of
https://github.com/JF002/InfiniTime into StepsApp
This commit is contained in:
@@ -8,27 +8,27 @@
|
||||
|
||||
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<Screen> { return CreateScreen1(); },
|
||||
[this]() -> std::unique_ptr<Screen> { return CreateScreen2(); }
|
||||
},
|
||||
Screens::ScreenListModes::UpDown
|
||||
} {}
|
||||
Settings::Settings(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
|
||||
: Screen(app),
|
||||
settingsController {settingsController},
|
||||
screens {app,
|
||||
settingsController.GetSettingsMenu(),
|
||||
{[this]() -> std::unique_ptr<Screen> {
|
||||
return CreateScreen1();
|
||||
},
|
||||
[this]() -> std::unique_ptr<Screen> {
|
||||
return CreateScreen2();
|
||||
}},
|
||||
Screens::ScreenListModes::UpDown} {
|
||||
}
|
||||
|
||||
Settings::~Settings() {
|
||||
lv_obj_clean(lv_scr_act());
|
||||
}
|
||||
|
||||
bool Settings::Refresh() {
|
||||
|
||||
if(running)
|
||||
|
||||
if (running)
|
||||
running = screens.Refresh();
|
||||
return running;
|
||||
}
|
||||
@@ -39,31 +39,24 @@ bool Settings::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
|
||||
|
||||
std::unique_ptr<Screen> Settings::CreateScreen1() {
|
||||
|
||||
std::array<Screens::List::Applications, 4> applications {
|
||||
{
|
||||
{Symbols::sun, "Display", Apps::SettingDisplay},
|
||||
{Symbols::clock, "Wake Up", Apps::SettingWakeUp},
|
||||
{Symbols::clock, "Time format", Apps::SettingTimeFormat},
|
||||
{Symbols::clock, "Watch face", Apps::SettingWatchFace},
|
||||
}
|
||||
|
||||
};
|
||||
std::array<Screens::List::Applications, 4> applications {{
|
||||
{Symbols::sun, "Display", Apps::SettingDisplay},
|
||||
{Symbols::clock, "Wake Up", Apps::SettingWakeUp},
|
||||
{Symbols::clock, "Time format", Apps::SettingTimeFormat},
|
||||
{Symbols::clock, "Watch face", Apps::SettingWatchFace},
|
||||
}};
|
||||
|
||||
return std::unique_ptr<Screen>(new Screens::List(0, 2, app, settingsController, applications));
|
||||
}
|
||||
|
||||
|
||||
std::unique_ptr<Screen> Settings::CreateScreen2() {
|
||||
|
||||
std::array<Screens::List::Applications, 4> applications {
|
||||
{
|
||||
{Symbols::shoe, "Steps", Apps::SettingSteps},
|
||||
{Symbols::batteryHalf, "Battery", Apps::BatteryInfo},
|
||||
{Symbols::check, "Firmware", Apps::FirmwareValidation},
|
||||
{Symbols::list, "About", Apps::SysInfo},
|
||||
}
|
||||
|
||||
};
|
||||
std::array<Screens::List::Applications, 4> applications {{
|
||||
{Symbols::shoe, "Steps", Apps::SettingSteps},
|
||||
{Symbols::batteryHalf, "Battery", Apps::BatteryInfo},
|
||||
{Symbols::check, "Firmware", Apps::FirmwareValidation},
|
||||
{Symbols::list, "About", Apps::SysInfo},
|
||||
}};
|
||||
|
||||
return std::unique_ptr<Screen>(new Screens::List(1, 2, app, settingsController, applications));
|
||||
}
|
||||
|
Reference in New Issue
Block a user