diff options
| author | JF <JF002@users.noreply.github.com> | 2022-01-26 20:38:07 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-26 20:38:07 (GMT) |
| commit | 458f5b8eb8f165f90717d804c0b0be23d6bc5240 (patch) | |
| tree | b707a9b67219f7408146841523852edd656ebc49 /src/displayapp/screens/Notifications.h | |
| parent | bbb823b170b2a775f0b14a7d0e39516283a3c9d0 (diff) | |
| parent | 5e6868d9eb0957eeaaeb34269a7614a0a3f417e8 (diff) | |
Merge pull request #903 from Riksu9000/improved_notif_timeout
Improved notification timeout
Diffstat (limited to 'src/displayapp/screens/Notifications.h')
| -rw-r--r-- | src/displayapp/screens/Notifications.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index cbb7af6..2f444c7 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: @@ -62,6 +66,7 @@ namespace Pinetime { }; Pinetime::Controllers::NotificationManager& notificationManager; Pinetime::Controllers::AlertNotificationService& alertNotificationService; + System::SystemTask& systemTask; Modes mode = Modes::Normal; std::unique_ptr<NotificationItem> currentItem; Controllers::NotificationManager::Notification::Id currentId; @@ -69,8 +74,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; }; |
