diff options
Diffstat (limited to 'src/displayapp/screens')
| -rw-r--r-- | src/displayapp/screens/ApplicationList.cpp | 91 | ||||
| -rw-r--r-- | src/displayapp/screens/Clock.h | 26 | ||||
| -rw-r--r-- | src/displayapp/screens/Music.cpp | 15 | ||||
| -rw-r--r-- | src/displayapp/screens/Notifications.cpp | 166 | ||||
| -rw-r--r-- | src/displayapp/screens/Notifications.h | 56 | ||||
| -rw-r--r-- | src/displayapp/screens/Symbols.h | 10 | ||||
| -rw-r--r-- | src/displayapp/screens/Tile.h | 2 |
7 files changed, 260 insertions, 106 deletions
diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index 0f6be27..531636e 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -8,78 +8,77 @@ using namespace Pinetime::Applications::Screens; -ApplicationList::ApplicationList(Pinetime::Applications::DisplayApp *app) : - Screen(app), - screens{app, { - [this]() -> std::unique_ptr<Screen> { return CreateScreen1(); }, - [this]() -> std::unique_ptr<Screen> { return CreateScreen2(); }, - //[this]() -> std::unique_ptr<Screen> { return CreateScreen3(); } - } - } -{ -} +ApplicationList::ApplicationList(Pinetime::Applications::DisplayApp *app) : + Screen(app), + screens{app, { + [this]() -> std::unique_ptr<Screen> { return CreateScreen1(); }, + [this]() -> std::unique_ptr<Screen> { return CreateScreen2(); }, + //[this]() -> std::unique_ptr<Screen> { return CreateScreen3(); } + } + } {} + -ApplicationList::~ApplicationList() -{ +ApplicationList::~ApplicationList() { lv_obj_clean(lv_scr_act()); } -bool ApplicationList::Refresh() -{ - if (running) +bool ApplicationList::Refresh() { + if(running) running = screens.Refresh(); return running; } -bool ApplicationList::OnButtonPushed() -{ +bool ApplicationList::OnButtonPushed() { running = false; app->StartApp(Apps::Clock); return true; } -bool ApplicationList::OnTouchEvent(Pinetime::Applications::TouchEvents event) -{ +bool ApplicationList::OnTouchEvent(Pinetime::Applications::TouchEvents event) { return screens.OnTouchEvent(event); } -std::unique_ptr<Screen> ApplicationList::CreateScreen1() -{ - std::array<Screens::Tile::Applications, 6> applications{ - {{Symbols::clock, Apps::Clock}, - {Symbols::music, Apps::Music}, - {Symbols::sun, Apps::Brightness}, - {Symbols::list, Apps::SysInfo}, - {Symbols::check, Apps::FirmwareValidation}, - {Symbols::heartBeat, Apps::HeartRate}} +std::unique_ptr<Screen> ApplicationList::CreateScreen1() { + std::array<Screens::Tile::Applications, 6> applications { + {{Symbols::clock, Apps::Clock}, + {Symbols::music, Apps::Music}, + {Symbols::sun, Apps::Brightness}, + {Symbols::list, Apps::SysInfo}, + {Symbols::check, Apps::FirmwareValidation}, + {Symbols::heartBeat, Apps::HeartRate} + } + }; return std::unique_ptr<Screen>(new Screens::Tile(app, applications)); } -std::unique_ptr<Screen> ApplicationList::CreateScreen2() -{ - std::array<Screens::Tile::Applications, 6> applications{ - {{Symbols::map, Apps::Navigation}, - {Symbols::asterisk, Apps::Meter}, - {Symbols::paintbrush, Apps::Paint}, - {Symbols::info, Apps::Notifications}, - {Symbols::paddle, Apps::Paddle}, - {"2", Apps::Twos}}}; +std::unique_ptr<Screen> ApplicationList::CreateScreen2() { + std::array<Screens::Tile::Applications, 6> applications { + {{Symbols::map, Apps::Navigation}, + {Symbols::asterisk, Apps::Meter}, + {Symbols::paintbrush, Apps::Paint}, + {Symbols::info, Apps::Notifications}, + {Symbols::paddle, Apps::Paddle}, + {"2", Apps::Twos} + } + }; return std::unique_ptr<Screen>(new Screens::Tile(app, applications)); } -std::unique_ptr<Screen> ApplicationList::CreateScreen3() -{ - std::array<Screens::Tile::Applications, 6> applications{ - {{"A", Apps::Meter}, - {"B", Apps::None}, - {"C", Apps::Clock}, - {"D", Apps::Music}, - {"E", Apps::SysInfo}, - {"F", Apps::Brightness}}}; +std::unique_ptr<Screen> ApplicationList::CreateScreen3() { + std::array<Screens::Tile::Applications, 6> applications { + {{"A", Apps::Meter}, + {"B", Apps::Navigation}, + {"C", Apps::Clock}, + {"D", Apps::Music}, + {"E", Apps::SysInfo}, + {"F", Apps::Brightness} + } + }; return std::unique_ptr<Screen>(new Screens::Tile(app, applications)); } + diff --git a/src/displayapp/screens/Clock.h b/src/displayapp/screens/Clock.h index 3a4c67a..18d7053 100644 --- a/src/displayapp/screens/Clock.h +++ b/src/displayapp/screens/Clock.h @@ -21,11 +21,10 @@ namespace Pinetime { template <class T> class DirtyValue { public: - explicit DirtyValue(T v) { value = v; } - explicit DirtyValue(T& v) { value = v; } + DirtyValue() = default; // Use NSDMI + explicit DirtyValue(T const& v):value{v}{} // Use MIL and const-lvalue-ref bool IsUpdated() const { return isUpdated; } - T& Get() { this->isUpdated = false; return value; } - + T const& Get() { this->isUpdated = false; return value; } // never expose a non-const lvalue-ref DirtyValue& operator=(const T& other) { if (this->value != other) { this->value = other; @@ -34,9 +33,10 @@ namespace Pinetime { return *this; } private: - T value; - bool isUpdated = true; + T value{}; // NSDMI - default initialise type + bool isUpdated{true}; // NSDMI - use brace initilisation }; + class Clock : public Screen { public: Clock(DisplayApp* app, @@ -64,13 +64,13 @@ namespace Pinetime { Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; uint8_t currentDay = 0; - DirtyValue<int> batteryPercentRemaining {0}; - DirtyValue<bool> bleState {false}; - DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime; - DirtyValue<uint32_t> stepCount {0}; - DirtyValue<uint8_t> heartbeat {0}; - DirtyValue<bool> heartbeatRunning {false}; - DirtyValue<bool> notificationState {false}; + DirtyValue<int> batteryPercentRemaining {}; + DirtyValue<bool> bleState {}; + DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime{}; + DirtyValue<uint32_t> stepCount {}; + DirtyValue<uint8_t> heartbeat {}; + DirtyValue<bool> heartbeatRunning {}; + DirtyValue<bool> notificationState {}; lv_obj_t* label_time; lv_obj_t* label_date; diff --git a/src/displayapp/screens/Music.cpp b/src/displayapp/screens/Music.cpp index c84d80d..b68f378 100644 --- a/src/displayapp/screens/Music.cpp +++ b/src/displayapp/screens/Music.cpp @@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ #include "Music.h" +#include "Symbols.h" #include <cstdint> #include "../DisplayApp.h" #include "components/ble/MusicService.h" @@ -55,7 +56,7 @@ Music::Music(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::Mus lv_obj_set_size(btnVolDown, LV_HOR_RES / 3, 80); lv_obj_align(btnVolDown, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0); label = lv_label_create(btnVolDown, nullptr); - lv_label_set_text(label, "V-"); + lv_label_set_text(label, Symbols::volumDown); lv_obj_set_hidden(btnVolDown, !displayVolumeButtons); btnVolUp = lv_btn_create(lv_scr_act(), nullptr); @@ -64,7 +65,7 @@ Music::Music(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::Mus lv_obj_set_size(btnVolUp, LV_HOR_RES / 3, 80); lv_obj_align(btnVolUp, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0); label = lv_label_create(btnVolUp, nullptr); - lv_label_set_text(label, "V+"); + lv_label_set_text(label, Symbols::volumUp); lv_obj_set_hidden(btnVolDown, !displayVolumeButtons); btnPrev = lv_btn_create(lv_scr_act(), nullptr); @@ -73,7 +74,7 @@ Music::Music(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::Mus lv_obj_set_size(btnPrev, LV_HOR_RES / 3, 80); lv_obj_align(btnPrev, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0); label = lv_label_create(btnPrev, nullptr); - lv_label_set_text(label, "<<"); + lv_label_set_text(label, Symbols::stepBackward); btnNext = lv_btn_create(lv_scr_act(), nullptr); btnNext->user_data = this; @@ -81,7 +82,7 @@ Music::Music(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::Mus lv_obj_set_size(btnNext, LV_HOR_RES / 3, 80); lv_obj_align(btnNext, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0); label = lv_label_create(btnNext, nullptr); - lv_label_set_text(label, ">>"); + lv_label_set_text(label, Symbols::stepForward); btnPlayPause = lv_btn_create(lv_scr_act(), nullptr); btnPlayPause->user_data = this; @@ -89,7 +90,7 @@ Music::Music(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::Mus lv_obj_set_size(btnPlayPause, LV_HOR_RES / 3, 80); lv_obj_align(btnPlayPause, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, 0); txtPlayPause = lv_label_create(btnPlayPause, nullptr); - lv_label_set_text(txtPlayPause, ">"); + lv_label_set_text(txtPlayPause, Symbols::play); txtTrackDuration = lv_label_create(lv_scr_act(), nullptr); lv_label_set_long_mode(txtTrackDuration, LV_LABEL_LONG_SROLL); @@ -176,7 +177,7 @@ bool Music::Refresh() { } if (playing == Pinetime::Controllers::MusicService::MusicStatus::Playing) { - lv_label_set_text(txtPlayPause, "||"); + lv_label_set_text(txtPlayPause, Symbols::pause); if (xTaskGetTickCount() - 1024 >= lastIncrement) { if (frameB) { @@ -200,7 +201,7 @@ bool Music::Refresh() { UpdateLength(); } } else { - lv_label_set_text(txtPlayPause, ">"); + lv_label_set_text(txtPlayPause, Symbols::play); } return running; diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index d88968f..4219bac 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -1,22 +1,42 @@ #include "Notifications.h" #include <displayapp/DisplayApp.h> +#include "components/ble/MusicService.h" +#include "components/ble/AlertNotificationService.h" +#include "Symbols.h" using namespace Pinetime::Applications::Screens; +extern lv_font_t jetbrains_mono_extrabold_compressed; +extern lv_font_t jetbrains_mono_bold_20; -Notifications::Notifications(DisplayApp *app, Pinetime::Controllers::NotificationManager ¬ificationManager, Modes mode) : - Screen(app), notificationManager{notificationManager}, mode{mode} { +Notifications::Notifications(DisplayApp *app, + Pinetime::Controllers::NotificationManager ¬ificationManager, + Pinetime::Controllers::AlertNotificationService& alertNotificationService, + Modes mode) : + Screen(app), notificationManager{notificationManager}, alertNotificationService{alertNotificationService}, mode{mode} { notificationManager.ClearNewNotificationFlag(); auto notification = notificationManager.GetLastNotification(); if(notification.valid) { currentId = notification.id; - currentItem.reset(new NotificationItem("\nNotification", notification.message.data(), notification.index, notificationManager.NbNotifications(), mode)); + currentItem.reset(new NotificationItem("\nNotification", + notification.message.data(), + notification.index, + notification.category, + notificationManager.NbNotifications(), + mode, + alertNotificationService)); validDisplay = true; } else { - currentItem.reset(new NotificationItem("\nNotification", "No notification to display", 0, notificationManager.NbNotifications(), Modes::Preview)); + currentItem.reset(new NotificationItem("\nNotification", + "No notification to display", + 0, + notification.category, + notificationManager.NbNotifications(), + Modes::Preview, + alertNotificationService)); } if(mode == Modes::Preview) { - + timeoutLine = lv_line_create(lv_scr_act(), nullptr); lv_obj_set_style_local_line_width(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3); @@ -67,7 +87,13 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { currentId = previousNotification.id; currentItem.reset(nullptr); app->SetFullRefresh(DisplayApp::FullRefreshDirections::Up); - currentItem.reset(new NotificationItem("\nNotification", previousNotification.message.data(), previousNotification.index, notificationManager.NbNotifications(), mode)); + currentItem.reset(new NotificationItem("\nNotification", + previousNotification.message.data(), + previousNotification.index, + previousNotification.category, + notificationManager.NbNotifications(), + mode, + alertNotificationService)); } return true; case Pinetime::Applications::TouchEvents::SwipeDown: { @@ -83,9 +109,19 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { currentId = nextNotification.id; currentItem.reset(nullptr); app->SetFullRefresh(DisplayApp::FullRefreshDirections::Down); - currentItem.reset(new NotificationItem("\nNotification", nextNotification.message.data(), nextNotification.index, notificationManager.NbNotifications(), mode)); + currentItem.reset(new NotificationItem("\nNotification", + nextNotification.message.data(), + nextNotification.index, + nextNotification.category, + notificationManager.NbNotifications(), + mode, + alertNotificationService)); } return true; + case Pinetime::Applications::TouchEvents::LongTap: { + notificationManager.ToggleVibrations(); + return true; + } default: return false; } @@ -97,9 +133,31 @@ bool Notifications::OnButtonPushed() { return true; } +namespace { + static void AcceptIncomingCallEventHandler(lv_obj_t* obj, lv_event_t event) { + auto* item = static_cast<Notifications::NotificationItem*>(obj->user_data); + item->OnAcceptIncomingCall(event); + } + + static void MuteIncomingCallEventHandler(lv_obj_t* obj, lv_event_t event) { + auto* item = static_cast<Notifications::NotificationItem*>(obj->user_data); + item->OnMuteIncomingCall(event); + } + + static void RejectIncomingCallEventHandler(lv_obj_t *obj, lv_event_t event) { + auto* item = static_cast<Notifications::NotificationItem *>(obj->user_data); + item->OnRejectIncomingCall(event); + } +} -Notifications::NotificationItem::NotificationItem(const char *title, const char *msg, uint8_t notifNr, uint8_t notifNb, Modes mode) - : notifNr{notifNr}, notifNb{notifNb}, mode{mode} { + Notifications::NotificationItem::NotificationItem(const char *title, + const char *msg, + uint8_t notifNr, + Controllers::NotificationManager::Categories category, + uint8_t notifNb, + Modes mode, + Pinetime::Controllers::AlertNotificationService& alertNotificationService) + : notifNr{notifNr}, notifNb{notifNb}, mode{mode}, alertNotificationService{alertNotificationService} { lv_obj_t* container1 = lv_cont_create(lv_scr_act(), NULL); @@ -111,33 +169,101 @@ Notifications::NotificationItem::NotificationItem(const char *title, const char lv_obj_set_pos(container1, 0, 50); lv_obj_set_width(container1, 240); lv_obj_set_height(container1, 190); - + lv_cont_set_layout(container1, LV_LAYOUT_COLUMN_LEFT); - lv_obj_t* alert_count = lv_label_create(lv_scr_act(), nullptr); + lv_obj_t* alert_count = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_fmt(alert_count, "%i/%i", notifNr, notifNb); lv_obj_align(alert_count, NULL, LV_ALIGN_IN_TOP_RIGHT, 0, 16); lv_obj_t* alert_type = lv_label_create(lv_scr_act(), nullptr); - lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x888888)); + lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x888888)); lv_label_set_text(alert_type, title); - lv_obj_align(alert_type, NULL, LV_ALIGN_IN_TOP_LEFT, 0, -4); + lv_obj_align(alert_type, NULL, LV_ALIGN_IN_TOP_LEFT, 0, -4); + + ///////// + switch(category) { + default: { + lv_obj_t* alert_subject = lv_label_create(container1, nullptr); + lv_obj_set_style_local_text_color(alert_subject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE); + lv_label_set_long_mode(alert_subject, LV_LABEL_LONG_BREAK); + lv_obj_set_width(alert_subject, LV_HOR_RES - 20); + lv_label_set_text(alert_subject, msg); + } + break; + case Controllers::NotificationManager::Categories::IncomingCall: { + lv_obj_t* alert_subject = lv_label_create(container1, nullptr); + lv_obj_set_style_local_text_color(alert_subject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE); + lv_label_set_long_mode(alert_subject, LV_LABEL_LONG_BREAK); + lv_obj_set_width(alert_subject, LV_HOR_RES - 20); + lv_label_set_text(alert_subject, "Incoming call from"); + + lv_obj_t* alert_caller = lv_label_create(container1, nullptr); + lv_obj_align(alert_caller, alert_subject, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0); + lv_label_set_long_mode(alert_caller, LV_LABEL_LONG_BREAK); + lv_obj_set_width(alert_caller, LV_HOR_RES - 20); + lv_label_set_text(alert_caller, msg); + + lv_obj_t* callBtnContainer = lv_cont_create(container1, NULL); + lv_obj_set_width(callBtnContainer, 240); + lv_obj_set_height(callBtnContainer, 90); + lv_cont_set_layout(callBtnContainer, LV_LAYOUT_ROW_MID); - lv_obj_t* alert_subject = lv_label_create(container1, nullptr); - lv_obj_set_style_local_text_color(alert_subject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE); - lv_label_set_long_mode(alert_subject, LV_LABEL_LONG_BREAK); - lv_obj_set_width(alert_subject, LV_HOR_RES - 20); - lv_label_set_text(alert_subject, msg); - //lv_obj_align(alert_subject, NULL, LV_ALIGN_IN_TOP_LEFT, 10, 50); + lv_obj_set_style_local_bg_color(callBtnContainer, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x222222)); + lv_obj_set_style_local_pad_all(callBtnContainer, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0); + lv_obj_set_style_local_margin_top(callBtnContainer, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 40); + lv_obj_set_style_local_margin_left(callBtnContainer, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, -8); + lv_obj_set_style_local_pad_inner(callBtnContainer, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 5); + lv_obj_set_style_local_border_width(callBtnContainer, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0); + + bt_accept = lv_btn_create(callBtnContainer, nullptr); + bt_accept->user_data = this; + lv_obj_set_event_cb(bt_accept, AcceptIncomingCallEventHandler); + lv_obj_set_size(bt_accept, (LV_HOR_RES / 3) - 5, 80); + label_accept = lv_label_create(bt_accept, nullptr); + lv_label_set_text(label_accept, Symbols::phone); + + bt_reject = lv_btn_create(callBtnContainer, nullptr); + bt_reject->user_data = this; + lv_obj_set_event_cb(bt_reject, RejectIncomingCallEventHandler); + lv_obj_set_size(bt_reject, (LV_HOR_RES / 3) - 5, 80); + label_reject = lv_label_create(bt_reject, nullptr); + lv_label_set_text(label_reject, Symbols::phoneSlash); + + bt_mute = lv_btn_create(callBtnContainer, nullptr); + bt_mute->user_data = this; + lv_obj_set_event_cb(bt_mute, MuteIncomingCallEventHandler); + lv_obj_set_size(bt_mute, (LV_HOR_RES / 3) - 5, 80); + label_mute = lv_label_create(bt_mute, nullptr); + lv_label_set_text(label_mute, Symbols::volumMute); + } + break; + } lv_obj_t* backgroundLabel = lv_label_create(lv_scr_act(), nullptr); lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP); lv_obj_set_size(backgroundLabel, 240, 240); lv_obj_set_pos(backgroundLabel, 0, 0); lv_label_set_text(backgroundLabel, ""); - } +void Notifications::NotificationItem::OnAcceptIncomingCall(lv_event_t event) { + if (event != LV_EVENT_CLICKED) return; + + alertNotificationService.AcceptIncomingCall(); +} + +void Notifications::NotificationItem::OnMuteIncomingCall(lv_event_t event) { + if (event != LV_EVENT_CLICKED) return; + + alertNotificationService.MuteIncomingCall(); +} + +void Notifications::NotificationItem::OnRejectIncomingCall(lv_event_t event) { + if (event != LV_EVENT_CLICKED) return; + + alertNotificationService.RejectIncomingCall(); +} Notifications::NotificationItem::~NotificationItem() { lv_obj_clean(lv_scr_act()); diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index f37b180..028a378 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -7,44 +7,62 @@ #include "components/ble/NotificationManager.h" namespace Pinetime { + namespace Controllers { + class AlertNotificationService; + } namespace Applications { namespace Screens { + class Notifications : public Screen { public: enum class Modes {Normal, Preview}; - explicit Notifications(DisplayApp* app, Pinetime::Controllers::NotificationManager& notificationManager, Modes mode); + explicit Notifications(DisplayApp* app, Pinetime::Controllers::NotificationManager& notificationManager, Pinetime::Controllers::AlertNotificationService& alertNotificationService, Modes mode); ~Notifications() override; bool Refresh() override; bool OnButtonPushed() override; bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override; + class NotificationItem { + public: + NotificationItem(const char* title, const char* msg, uint8_t notifNr, Controllers::NotificationManager::Categories, uint8_t notifNb, Modes mode, Pinetime::Controllers::AlertNotificationService& alertNotificationService); + ~NotificationItem(); + bool Refresh() {return false;} + void OnAcceptIncomingCall(lv_event_t event); + void OnMuteIncomingCall(lv_event_t event); + void OnRejectIncomingCall(lv_event_t event); + private: - bool running = true; + uint8_t notifNr = 0; + uint8_t notifNb = 0; + char pageText[4]; - class NotificationItem { - public: - NotificationItem(const char* title, const char* msg, uint8_t notifNr, uint8_t notifNb, Modes mode); - ~NotificationItem(); - bool Refresh() {return false;} - - private: - uint8_t notifNr = 0; - uint8_t notifNb = 0; - char pageText[4]; - - lv_obj_t* container1; - lv_obj_t* t1; - lv_obj_t* l1; - lv_obj_t* bottomPlaceholder; - Modes mode; - }; + lv_obj_t* container1; + lv_obj_t* t1; + lv_obj_t* l1; + lv_obj_t* l2; + lv_obj_t* bt_accept; + lv_obj_t* bt_mute; + lv_obj_t* bt_reject; + lv_obj_t* label_accept; + lv_obj_t* label_mute; + lv_obj_t* label_reject; + lv_obj_t* bottomPlaceholder; + Modes mode; + Pinetime::Controllers::AlertNotificationService& alertNotificationService; + + + }; + + private: + bool running = true; struct NotificationData { const char* title; const char* text; }; Pinetime::Controllers::NotificationManager& notificationManager; + Pinetime::Controllers::AlertNotificationService& alertNotificationService; Modes mode = Modes::Normal; std::unique_ptr<NotificationItem> currentItem; Controllers::NotificationManager::Notification::Id currentId; diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index bd6a0f9..1a6bbd7 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -26,6 +26,16 @@ namespace Pinetime { static constexpr const char* paintbrush = "\xEF\x87\xBC"; static constexpr const char* paddle = "\xEF\x91\x9D"; static constexpr const char* map = "\xEF\x96\xa0"; + static constexpr const char* qrcode = "\xEF\x80\xa9"; + static constexpr const char* phone = "\xEF\x82\x95"; + static constexpr const char* phoneSlash = "\xEF\x8F\x9D"; + static constexpr const char* volumMute = "\xEF\x9A\xA9"; + static constexpr const char* volumUp = "\xEF\x80\xA8"; + static constexpr const char* volumDown = "\xEF\x80\xA7"; + static constexpr const char* stepForward = "\xEF\x81\x91"; + static constexpr const char* stepBackward = "\xEF\x81\x88"; + static constexpr const char* play = "\xEF\x81\x8B"; + static constexpr const char* pause = "\xEF\x81\x8C"; } } } diff --git a/src/displayapp/screens/Tile.h b/src/displayapp/screens/Tile.h index 791745d..55ed45e 100644 --- a/src/displayapp/screens/Tile.h +++ b/src/displayapp/screens/Tile.h @@ -27,7 +27,7 @@ namespace Pinetime { private: lv_obj_t * btnm1; bool running = true; - + const char* btnm_map1[8]; Pinetime::Applications::Apps apps[6]; }; |
