Fixes
This commit is contained in:
parent
e6dcb3009f
commit
a618f43b4d
|
@ -336,12 +336,12 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
|
||||||
|
|
||||||
case Apps::Notifications:
|
case Apps::Notifications:
|
||||||
currentScreen = std::make_unique<Screens::Notifications>(
|
currentScreen = std::make_unique<Screens::Notifications>(
|
||||||
this, notificationManager, systemTask->nimble().alertService(), Screens::Notifications::Modes::Normal);
|
this, notificationManager, systemTask->nimble().alertService(), motorController, Screens::Notifications::Modes::Normal);
|
||||||
ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
|
ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
|
||||||
break;
|
break;
|
||||||
case Apps::NotificationsPreview:
|
case Apps::NotificationsPreview:
|
||||||
currentScreen = std::make_unique<Screens::Notifications>(
|
currentScreen = std::make_unique<Screens::Notifications>(
|
||||||
this, notificationManager, systemTask->nimble().alertService(), Screens::Notifications::Modes::Preview);
|
this, notificationManager, systemTask->nimble().alertService(), motorController, Screens::Notifications::Modes::Preview);
|
||||||
ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
|
ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp);
|
||||||
break;
|
break;
|
||||||
case Apps::Timer:
|
case Apps::Timer:
|
||||||
|
|
|
@ -11,6 +11,7 @@ extern lv_font_t jetbrains_mono_bold_20;
|
||||||
Notifications::Notifications(DisplayApp* app,
|
Notifications::Notifications(DisplayApp* app,
|
||||||
Pinetime::Controllers::NotificationManager& notificationManager,
|
Pinetime::Controllers::NotificationManager& notificationManager,
|
||||||
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
|
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
|
||||||
|
Pinetime::Controllers::MotorController& motorController,
|
||||||
Modes mode)
|
Modes mode)
|
||||||
: Screen(app), notificationManager {notificationManager}, alertNotificationService {alertNotificationService}, mode {mode} {
|
: Screen(app), notificationManager {notificationManager}, alertNotificationService {alertNotificationService}, mode {mode} {
|
||||||
notificationManager.ClearNewNotificationFlag();
|
notificationManager.ClearNewNotificationFlag();
|
||||||
|
@ -35,7 +36,11 @@ Notifications::Notifications(DisplayApp* app,
|
||||||
alertNotificationService);
|
alertNotificationService);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == Modes::Preview && notification.category != Controllers::NotificationManager::Categories::IncomingCall) {
|
if (mode == Modes::Preview) {
|
||||||
|
if (notification.category == Controllers::NotificationManager::Categories::IncomingCall) {
|
||||||
|
motorController.StartRinging();
|
||||||
|
} else {
|
||||||
|
motorController.RunForDuration(35);
|
||||||
timeoutLine = lv_line_create(lv_scr_act(), nullptr);
|
timeoutLine = lv_line_create(lv_scr_act(), nullptr);
|
||||||
|
|
||||||
lv_obj_set_style_local_line_width(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
|
lv_obj_set_style_local_line_width(timeoutLine, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||||
|
@ -46,6 +51,7 @@ Notifications::Notifications(DisplayApp* app,
|
||||||
timeoutTickCountStart = xTaskGetTickCount();
|
timeoutTickCountStart = xTaskGetTickCount();
|
||||||
timeoutTickCountEnd = timeoutTickCountStart + (5 * 1024);
|
timeoutTickCountEnd = timeoutTickCountStart + (5 * 1024);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Notifications::~Notifications() {
|
Notifications::~Notifications() {
|
||||||
|
@ -68,8 +74,9 @@ bool Notifications::Refresh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
|
bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
|
||||||
if (mode != Modes::Normal)
|
if (mode != Modes::Normal) {
|
||||||
return true;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case Pinetime::Applications::TouchEvents::SwipeDown: {
|
case Pinetime::Applications::TouchEvents::SwipeDown: {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
#include "components/ble/NotificationManager.h"
|
#include "components/ble/NotificationManager.h"
|
||||||
|
#include "components/motor/MotorController.h"
|
||||||
|
|
||||||
namespace Pinetime {
|
namespace Pinetime {
|
||||||
namespace Controllers {
|
namespace Controllers {
|
||||||
|
@ -19,6 +20,7 @@ namespace Pinetime {
|
||||||
explicit Notifications(DisplayApp* app,
|
explicit Notifications(DisplayApp* app,
|
||||||
Pinetime::Controllers::NotificationManager& notificationManager,
|
Pinetime::Controllers::NotificationManager& notificationManager,
|
||||||
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
|
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
|
||||||
|
Pinetime::Controllers::MotorController& motorController,
|
||||||
Modes mode);
|
Modes mode);
|
||||||
~Notifications() override;
|
~Notifications() override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user