Improvements

This commit is contained in:
Riku Isokoski
2021-08-01 13:05:48 +03:00
parent 5bdef365f2
commit e6dcb3009f
8 changed files with 70 additions and 131 deletions

View File

@@ -5,7 +5,6 @@
#include <memory>
#include "Screen.h"
#include "components/ble/NotificationManager.h"
#include "components/motor/MotorController.h"
namespace Pinetime {
namespace Controllers {
@@ -20,7 +19,6 @@ namespace Pinetime {
explicit Notifications(DisplayApp* app,
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
Controllers::MotorController& motorController,
Modes mode);
~Notifications() override;
@@ -35,22 +33,14 @@ namespace Pinetime {
Controllers::NotificationManager::Categories,
uint8_t notifNb,
Modes mode,
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
Controllers::MotorController& motorController,
uint32_t* timeoutEnd,
uint32_t* timeoutStart);
Pinetime::Controllers::AlertNotificationService& alertNotificationService);
~NotificationItem();
bool Refresh() {
return false;
bool IsRunning() const {
return running;
}
void OnAcceptIncomingCall(lv_event_t event);
void OnMuteIncomingCall(lv_event_t event);
void OnRejectIncomingCall(lv_event_t event);
bool timeoutOnHold = false;
void OnCallButtonEvent(lv_obj_t*, lv_event_t event);
private:
void callPreviewInteraction();
uint8_t notifNr = 0;
uint8_t notifNb = 0;
char pageText[4];
@@ -66,11 +56,9 @@ namespace Pinetime {
lv_obj_t* label_mute;
lv_obj_t* label_reject;
lv_obj_t* bottomPlaceholder;
uint32_t* timeoutEnd;
uint32_t* timeoutStart;
Modes mode;
Pinetime::Controllers::AlertNotificationService& alertNotificationService;
Controllers::MotorController& motorController;
bool running = true;
};
private:
@@ -83,11 +71,10 @@ namespace Pinetime {
Modes mode = Modes::Normal;
std::unique_ptr<NotificationItem> currentItem;
Controllers::NotificationManager::Notification::Id currentId;
Controllers::MotorController& motorController;
bool validDisplay = false;
lv_point_t timeoutLinePoints[2] {{0, 1}, {239, 1}};
lv_obj_t* timeoutLine;
lv_obj_t* timeoutLine = nullptr;
uint32_t timeoutTickCountStart;
uint32_t timeoutTickCountEnd;
};