mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 15:11:51 +02:00
Merge branch 'InfiniTimeOrg:main' into main
This commit is contained in:
commit
642511c69f
|
@ -140,10 +140,10 @@ namespace Pinetime {
|
|||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps:MyApp> {
|
||||
struct AppTraits<Apps::MyApp> {
|
||||
static constexpr Apps app = Apps::MyApp;
|
||||
static constexpr const char* icon = Screens::Symbol::myApp;
|
||||
static Screens::Screens* Create(AppController& controllers) {
|
||||
static constexpr const char* icon = Screens::Symbols::myApp;
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::MyApp();
|
||||
}
|
||||
};
|
||||
|
@ -176,7 +176,7 @@ Now we have our very own app, but InfiniTime does not know about it yet.
|
|||
The first step is to include your `MyApp.cpp` (or any new cpp files for that matter)
|
||||
in the compilation by adding it to [CMakeLists.txt](/CMakeLists.txt).
|
||||
The next step to making it launch-able is to give your app an id.
|
||||
To do this, add an entry in the enum class `Pinetime::Applications::Apps` ([displayapp/Apps.h](/src/displayapp/Apps.h)).
|
||||
To do this, add an entry in the enum class `Pinetime::Applications::Apps` ([displayapp/apps/Apps.h](/src/displayapp/apps/Apps.h.in)).
|
||||
Name this entry after your app. Add `#include "displayapp/screens/MyApp.h"`
|
||||
to the file [displayapp/DisplayApp.cpp](/src/displayapp/DisplayApp.cpp).
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ void WatchFaceAnalog::Refresh() {
|
|||
if (currentDateTime.IsUpdated()) {
|
||||
UpdateClock();
|
||||
|
||||
currentDate = std::chrono::time_point_cast<days>(currentDateTime.Get());
|
||||
currentDate = std::chrono::time_point_cast<std::chrono::days>(currentDateTime.Get());
|
||||
if (currentDate.IsUpdated()) {
|
||||
lv_label_set_text_fmt(label_date_day, "%s\n%02i", dateTimeController.DayOfWeekShortToString(), dateTimeController.Day());
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@ namespace Pinetime {
|
|||
Utility::DirtyValue<bool> bleState {};
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime;
|
||||
Utility::DirtyValue<bool> notificationState {false};
|
||||
using days = std::chrono::duration<int32_t, std::ratio<86400>>; // TODO: days is standard in c++20
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, days>> currentDate;
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate;
|
||||
|
||||
lv_obj_t* minor_scales;
|
||||
lv_obj_t* major_scales;
|
||||
|
|
|
@ -244,7 +244,7 @@ void WatchFaceCasioStyleG7710::Refresh() {
|
|||
}
|
||||
lv_obj_realign(label_time);
|
||||
|
||||
currentDate = std::chrono::time_point_cast<days>(currentDateTime.Get());
|
||||
currentDate = std::chrono::time_point_cast<std::chrono::days>(currentDateTime.Get());
|
||||
if (currentDate.IsUpdated()) {
|
||||
const char* weekNumberFormat = "%V";
|
||||
|
||||
|
|
|
@ -51,8 +51,7 @@ namespace Pinetime {
|
|||
Utility::DirtyValue<uint8_t> heartbeat {};
|
||||
Utility::DirtyValue<bool> heartbeatRunning {};
|
||||
Utility::DirtyValue<bool> notificationState {};
|
||||
using days = std::chrono::duration<int32_t, std::ratio<86400>>; // TODO: days is standard in c++20
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, days>> currentDate;
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate;
|
||||
|
||||
lv_point_t line_icons_points[3] {{0, 5}, {117, 5}, {122, 0}};
|
||||
lv_point_t line_day_of_week_number_points[4] {{0, 0}, {100, 0}, {95, 95}, {0, 95}};
|
||||
|
|
|
@ -125,7 +125,7 @@ void WatchFaceDigital::Refresh() {
|
|||
lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
currentDate = std::chrono::time_point_cast<days>(currentDateTime.Get());
|
||||
currentDate = std::chrono::time_point_cast<std::chrono::days>(currentDateTime.Get());
|
||||
if (currentDate.IsUpdated()) {
|
||||
uint16_t year = dateTimeController.Year();
|
||||
uint8_t day = dateTimeController.Day();
|
||||
|
|
|
@ -54,8 +54,7 @@ namespace Pinetime {
|
|||
Utility::DirtyValue<bool> notificationState {};
|
||||
Utility::DirtyValue<std::optional<Pinetime::Controllers::SimpleWeatherService::CurrentWeather>> currentWeather {};
|
||||
|
||||
using days = std::chrono::duration<int32_t, std::ratio<86400>>; // TODO: days is standard in c++20
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, days>> currentDate;
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate;
|
||||
|
||||
lv_obj_t* label_time;
|
||||
lv_obj_t* label_time_ampm;
|
||||
|
|
|
@ -423,7 +423,7 @@ void WatchFaceInfineat::Refresh() {
|
|||
lv_obj_align(labelMinutes, timeContainer, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
|
||||
}
|
||||
|
||||
currentDate = std::chrono::time_point_cast<days>(currentDateTime.Get());
|
||||
currentDate = std::chrono::time_point_cast<std::chrono::days>(currentDateTime.Get());
|
||||
if (currentDate.IsUpdated()) {
|
||||
uint8_t day = dateTimeController.Day();
|
||||
Controllers::DateTime::Days dayOfWeek = dateTimeController.DayOfWeek();
|
||||
|
|
|
@ -55,8 +55,7 @@ namespace Pinetime {
|
|||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>> currentDateTime {};
|
||||
Utility::DirtyValue<uint32_t> stepCount {};
|
||||
Utility::DirtyValue<bool> notificationState {};
|
||||
using days = std::chrono::duration<int32_t, std::ratio<86400>>; // TODO: days is standard in c++20
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, days>> currentDate;
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate;
|
||||
|
||||
// Lines making up the side cover
|
||||
lv_obj_t* lineBattery;
|
||||
|
|
|
@ -125,7 +125,7 @@ void WatchFaceTerminal::Refresh() {
|
|||
lv_label_set_text_fmt(label_time, "[TIME]#11cc55 %02d:%02d:%02d", hour, minute, second);
|
||||
}
|
||||
|
||||
currentDate = std::chrono::time_point_cast<days>(currentDateTime.Get());
|
||||
currentDate = std::chrono::time_point_cast<std::chrono::days>(currentDateTime.Get());
|
||||
if (currentDate.IsUpdated()) {
|
||||
uint16_t year = dateTimeController.Year();
|
||||
Controllers::DateTime::Months month = dateTimeController.Month();
|
||||
|
|
|
@ -45,8 +45,7 @@ namespace Pinetime {
|
|||
Utility::DirtyValue<uint8_t> heartbeat {};
|
||||
Utility::DirtyValue<bool> heartbeatRunning {};
|
||||
Utility::DirtyValue<bool> notificationState {};
|
||||
using days = std::chrono::duration<int32_t, std::ratio<86400>>; // TODO: days is standard in c++20
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, days>> currentDate;
|
||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate;
|
||||
|
||||
lv_obj_t* label_time;
|
||||
lv_obj_t* label_date;
|
||||
|
|
|
@ -36,17 +36,19 @@ namespace {
|
|||
|
||||
SettingBluetooth::SettingBluetooth(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
|
||||
: app {app},
|
||||
settings {settingsController},
|
||||
checkboxList(
|
||||
0,
|
||||
1,
|
||||
"Bluetooth",
|
||||
Symbols::bluetooth,
|
||||
settingsController.GetBleRadioEnabled() ? 0 : 1,
|
||||
[&settings = settingsController](uint32_t index) {
|
||||
[this](uint32_t index) {
|
||||
const bool priorMode = settings.GetBleRadioEnabled();
|
||||
const bool newMode = options[index].radioEnabled;
|
||||
if (newMode != priorMode) {
|
||||
settings.SetBleRadioEnabled(newMode);
|
||||
this->app->PushMessage(Pinetime::Applications::Display::Messages::BleRadioEnableToggle);
|
||||
}
|
||||
},
|
||||
CreateOptionArray()) {
|
||||
|
@ -54,6 +56,4 @@ SettingBluetooth::SettingBluetooth(Pinetime::Applications::DisplayApp* app, Pine
|
|||
|
||||
SettingBluetooth::~SettingBluetooth() {
|
||||
lv_obj_clean(lv_scr_act());
|
||||
// Pushing the message in the OnValueChanged function causes a freeze?
|
||||
app->PushMessage(Pinetime::Applications::Display::Messages::BleRadioEnableToggle);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace Pinetime {
|
|||
|
||||
private:
|
||||
DisplayApp* app;
|
||||
Pinetime::Controllers::Settings& settings;
|
||||
CheckboxList checkboxList;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue