Skip to content

Commit 12fad74

Browse files
NeroBurnerJF002
authored andcommitted
Notifications: no inTransition screen, simple blackbox is enough
1 parent 2c75e7a commit 12fad74

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

src/displayapp/screens/Notifications.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
157157
}
158158
currentItem.reset(nullptr);
159159
app->SetFullRefresh(DisplayApp::FullRefreshDirections::RightAnim);
160-
// create black "inTransition" screen
161-
currentItem = std::make_unique<NotificationItem>(alertNotificationService, motorController, true);
160+
// create black transition screen to let the notification dismiss to blackness
161+
lv_obj_t* blackBox = lv_obj_create(lv_scr_act(), nullptr);
162+
lv_obj_set_size(blackBox, LV_HOR_RES, LV_VER_RES);
163+
lv_obj_set_style_local_bg_color(blackBox, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
162164
dismissingNotification = true;
163165
return true;
164166
}
@@ -229,16 +231,14 @@ namespace {
229231
}
230232

231233
Notifications::NotificationItem::NotificationItem(Pinetime::Controllers::AlertNotificationService& alertNotificationService,
232-
Pinetime::Controllers::MotorController& motorController,
233-
bool isTransition)
234+
Pinetime::Controllers::MotorController& motorController)
234235
: NotificationItem("Notification",
235236
"No notification to display",
236237
0,
237238
Controllers::NotificationManager::Categories::Unknown,
238239
0,
239240
alertNotificationService,
240-
motorController,
241-
isTransition) {
241+
motorController) {
242242
}
243243

244244
Notifications::NotificationItem::NotificationItem(const char* title,
@@ -247,12 +247,8 @@ Notifications::NotificationItem::NotificationItem(const char* title,
247247
Controllers::NotificationManager::Categories category,
248248
uint8_t notifNb,
249249
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
250-
Pinetime::Controllers::MotorController& motorController,
251-
bool isTransition)
250+
Pinetime::Controllers::MotorController& motorController)
252251
: alertNotificationService {alertNotificationService}, motorController {motorController} {
253-
if (isTransition) {
254-
return; // nothing to do, just a black box
255-
}
256252
container = lv_cont_create(lv_scr_act(), nullptr);
257253
lv_obj_set_size(container, LV_HOR_RES, LV_VER_RES);
258254
lv_obj_set_style_local_bg_color(container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);

src/displayapp/screens/Notifications.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,14 @@ namespace Pinetime {
3434
class NotificationItem {
3535
public:
3636
NotificationItem(Pinetime::Controllers::AlertNotificationService& alertNotificationService,
37-
Pinetime::Controllers::MotorController& motorController,
38-
bool isTransition = false);
37+
Pinetime::Controllers::MotorController& motorController);
3938
NotificationItem(const char* title,
4039
const char* msg,
4140
uint8_t notifNr,
4241
Controllers::NotificationManager::Categories,
4342
uint8_t notifNb,
4443
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
45-
Pinetime::Controllers::MotorController& motorController,
46-
bool isTransition = false);
44+
Pinetime::Controllers::MotorController& motorController);
4745
~NotificationItem();
4846
bool IsRunning() const {
4947
return running;

0 commit comments

Comments
 (0)