summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Notifications.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/screens/Notifications.h')
-rw-r--r--src/displayapp/screens/Notifications.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h
index cbb7af6c..f49d3b3a 100644
--- a/src/displayapp/screens/Notifications.h
+++ b/src/displayapp/screens/Notifications.h
@@ -1,11 +1,13 @@
#pragma once
#include <lvgl/lvgl.h>
+#include <FreeRTOS.h>
#include <cstdint>
#include <memory>
#include "displayapp/screens/Screen.h"
#include "components/ble/NotificationManager.h"
#include "components/motor/MotorController.h"
+#include "systemtask/SystemTask.h"
namespace Pinetime {
namespace Controllers {
@@ -21,11 +23,13 @@ namespace Pinetime {
Pinetime::Controllers::NotificationManager& notificationManager,
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
Pinetime::Controllers::MotorController& motorController,
+ System::SystemTask& systemTask,
Modes mode);
~Notifications() override;
void Refresh() override;
bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;
+ void OnPreviewInteraction();
class NotificationItem {
public:
@@ -35,7 +39,8 @@ namespace Pinetime {
Controllers::NotificationManager::Categories,
uint8_t notifNb,
Modes mode,
- Pinetime::Controllers::AlertNotificationService& alertNotificationService);
+ Pinetime::Controllers::AlertNotificationService& alertNotificationService,
+ Pinetime::Controllers::MotorController& motorController);
~NotificationItem();
bool IsRunning() const {
return running;
@@ -52,6 +57,7 @@ namespace Pinetime {
lv_obj_t* label_reject;
Modes mode;
Pinetime::Controllers::AlertNotificationService& alertNotificationService;
+ Pinetime::Controllers::MotorController& motorController;
bool running = true;
};
@@ -62,6 +68,8 @@ namespace Pinetime {
};
Pinetime::Controllers::NotificationManager& notificationManager;
Pinetime::Controllers::AlertNotificationService& alertNotificationService;
+ Pinetime::Controllers::MotorController& motorController;
+ System::SystemTask& systemTask;
Modes mode = Modes::Normal;
std::unique_ptr<NotificationItem> currentItem;
Controllers::NotificationManager::Notification::Id currentId;
@@ -69,8 +77,9 @@ namespace Pinetime {
lv_point_t timeoutLinePoints[2] {{0, 1}, {239, 1}};
lv_obj_t* timeoutLine = nullptr;
- uint32_t timeoutTickCountStart;
- uint32_t timeoutTickCountEnd;
+ TickType_t timeoutTickCountStart;
+ static const TickType_t timeoutLength = pdMS_TO_TICKS(7000);
+ bool interacted = true;
lv_task_t* taskRefresh;
};