-
-
Notifications
You must be signed in to change notification settings - Fork 984
/
Copy pathSettingTimeFormat.cpp
42 lines (36 loc) · 1.47 KB
/
SettingTimeFormat.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "displayapp/screens/settings/SettingTimeFormat.h"
#include "displayapp/screens/settings/SettingClockFormat.h"
#include "displayapp/screens/settings/SettingDateFormat.h"
#include "displayapp/DisplayApp.h"
#include "displayapp/screens/ScreenList.h"
#include "components/settings/Settings.h"
#include "displayapp/widgets/DotIndicator.h"
using namespace Pinetime::Applications::Screens;
bool SettingTimeFormat::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
return screens.OnTouchEvent(event);
}
SettingTimeFormat::SettingTimeFormat(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
: settingsController {settingsController},
screens {app,
0,
{[this]() -> std::unique_ptr<Screen> {
return screenClockFormat();
},
[this]() -> std::unique_ptr<Screen> {
return screenDateFormat();
}},
Screens::ScreenListModes::UpDown} {
}
std::unique_ptr<Screen> SettingTimeFormat::screenDateFormat() {
Widgets::DotIndicator dotIndicator(1, 2);
dotIndicator.Create();
return std::make_unique<Screens::SettingDateFormat>(settingsController);
}
std::unique_ptr<Screen> SettingTimeFormat::screenClockFormat() {
Widgets::DotIndicator dotIndicator(0, 2);
dotIndicator.Create();
return std::make_unique<Screens::SettingClockFormat>(settingsController);
}
SettingTimeFormat::~SettingTimeFormat() {
lv_obj_clean(lv_scr_act());
}