Notification title in preview stay fixed for one second then starts

scrolling
This commit is contained in:
jspkay 2022-11-13 20:18:32 +01:00
parent 7bc4234d6f
commit 988a91ef51
3 changed files with 12 additions and 24 deletions

View file

@ -165,18 +165,11 @@ void DisplayApp::Refresh() {
brightnessController.Lower();
vTaskDelay(100);
}
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
state = States::Idle;
break;
case Messages::GoToRunning:
ApplyBrightness();
// reload main display app if we are notifications or quicksettings or app menu
if(currentApp == Apps::Launcher || currentApp == Apps::Notifications || currentApp == Apps::QuickSettings){
LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::Up);
}
state = States::Running;
break;
case Messages::UpdateTimeOut:
@ -309,7 +302,6 @@ void DisplayApp::ReturnApp(Apps app, DisplayApp::FullRefreshDirections direction
}
void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) {
NRF_LOG_INFO("Loading app...")
touchHandler.CancelTap();
ApplyBrightness();
@ -327,7 +319,6 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
break;
case Apps::None:
case Apps::Clock:
NRF_LOG_INFO("Loading clock")
currentScreen = std::make_unique<Screens::Clock>(this,
dateTimeController,
batteryController,
@ -337,7 +328,6 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
heartRateController,
motionController,
filesystem);
ReturnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::Error:
@ -490,7 +480,6 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
currentScreen = std::make_unique<Screens::Steps>(this, motionController, settingsController);
break;
}
NRF_LOG_INFO("DONE")
currentApp = app;
}

View file

@ -80,9 +80,9 @@ void Notifications::Refresh() {
lv_line_set_points(timeoutLine, timeoutLinePoints, 2);
}
if(!this->scrolling && tick >= timeoutTickCountStart + timeoutStartScrolling){
this->scrolling = true;
lv_label_set_long_mode(currentItem->alert_type, LV_LABEL_LONG_SROLL_CIRC);
if(!this->isTitleScrolling && tick >= timeoutTickCountStart + timeoutStartScrolling){
currentItem->StartTitleScroll();
this->isTitleScrolling = true;
}
}
@ -133,20 +133,14 @@ void Notifications::OnPreviewInteraction() {
}
bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
/*if (mode != Modes::Normal) {
if (mode != Modes::Normal) {
if (!interacted && event == TouchEvents::Tap) {
interacted = true;
OnPreviewInteraction();
return true;
}
return false;
}*/
if(mode == Modes::Preview){
interacted=true;
OnPreviewInteraction();
}
switch (event) {
case Pinetime::Applications::TouchEvents::SwipeRight:
if (validDisplay) {
@ -370,3 +364,7 @@ void Notifications::NotificationItem::OnCallButtonEvent(lv_obj_t* obj, lv_event_
Notifications::NotificationItem::~NotificationItem() {
lv_obj_clean(lv_scr_act());
}
void Notifications::NotificationItem::StartTitleScroll(){
lv_label_set_long_mode(this->alert_type, LV_LABEL_LONG_SROLL_CIRC);
}

View file

@ -47,7 +47,7 @@ namespace Pinetime {
return running;
}
void OnCallButtonEvent(lv_obj_t*, lv_event_t event);
lv_obj_t *alert_type;
void StartTitleScroll();
private:
lv_obj_t* container;
@ -58,6 +58,7 @@ namespace Pinetime {
lv_obj_t* label_accept;
lv_obj_t* label_mute;
lv_obj_t* label_reject;
lv_obj_t *alert_type;
Pinetime::Controllers::AlertNotificationService& alertNotificationService;
Pinetime::Controllers::MotorController& motorController;
@ -81,9 +82,9 @@ namespace Pinetime {
TickType_t timeoutTickCountStart;
static const TickType_t timeoutLength = pdMS_TO_TICKS(7000);
static const TickType_t timeoutStartScrolling = pdMS_TO_TICKS(1000);
static const TickType_t timeoutStartTitleScrolling = pdMS_TO_TICKS(1000);
bool interacted = true;
bool scrolling = false;
bool isTitleScrolling = false;
bool dismissingNotification = false;