From 0787496aa4eb3dbd0d20f6899f9a3368f9d9951c Mon Sep 17 00:00:00 2001 From: anschrammh Date: Mon, 18 Dec 2023 21:19:52 +0100 Subject: [PATCH] Updated the notification state callback to pass the handle to the registered callback function --- src/W800_SDK_v1.00.10/app/gfx/notification_screen.c | 6 +++--- src/W800_SDK_v1.00.10/app/gfx/notification_screen.h | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/W800_SDK_v1.00.10/app/gfx/notification_screen.c b/src/W800_SDK_v1.00.10/app/gfx/notification_screen.c index a1f4883..c2daec9 100644 --- a/src/W800_SDK_v1.00.10/app/gfx/notification_screen.c +++ b/src/W800_SDK_v1.00.10/app/gfx/notification_screen.c @@ -38,7 +38,7 @@ static void notification_scrolled_event_cb(lv_event_t *e) _notification_popup_destroy(notificationScreen); notificationScreen->new_notification_available = false; notification->read = true; - if(notificationScreen->notificationOnStateChangeCb) notificationScreen->notificationOnStateChangeCb(NOTIFICATION_STATE_CLEARED); + if(notificationScreen->notificationOnStateChangeCb) notificationScreen->notificationOnStateChangeCb(NOTIFICATION_STATE_CLEARED, notification->handle); } } @@ -120,7 +120,7 @@ void notification_screen_notify(NotificationScreen_t * const notificationScreen, case NOTIFICATION_TYPE_CALL: break; default: - if(notificationScreen->notificationOnStateChangeCb) notificationScreen->notificationOnStateChangeCb(NOTIFICATION_STATE_DISPLAYED); + if(notificationScreen->notificationOnStateChangeCb) notificationScreen->notificationOnStateChangeCb(NOTIFICATION_STATE_DISPLAYED, notification->handle); _display_message_notification(notificationScreen, notification); } } @@ -309,7 +309,7 @@ void _display_message_notification(NotificationScreen_t * const notificationScre lv_label_set_long_mode(notificationScreen->type_label, LV_LABEL_LONG_SCROLL_CIRCULAR); lv_obj_set_style_anim_speed(notificationScreen->type_label, 10, LV_PART_MAIN); lv_obj_set_width(notificationScreen->type_label, lv_pct(27)); - lv_label_set_text(notificationScreen->type_label, _notification_type_to_char(notification->type)); + lv_label_set_text_static(notificationScreen->type_label, _notification_type_to_char(notification->type)); if(notificationScreen->title_label) { diff --git a/src/W800_SDK_v1.00.10/app/gfx/notification_screen.h b/src/W800_SDK_v1.00.10/app/gfx/notification_screen.h index 2bdd078..3fc8d2e 100644 --- a/src/W800_SDK_v1.00.10/app/gfx/notification_screen.h +++ b/src/W800_SDK_v1.00.10/app/gfx/notification_screen.h @@ -38,7 +38,7 @@ typedef struct NotificationData } NotificationData_t, *NotificationDataList_t; -typedef void (*NotificationOnStateChangeCb_t)(NotificationState_e notificationState); +typedef void (*NotificationOnStateChangeCb_t)(NotificationState_e notificationState, uint32_t notification_handle); typedef struct NotificationScreen { @@ -59,7 +59,6 @@ typedef struct NotificationScreen // Miscellaneous bool new_notification_available : 1; bool notification_hour_24H_format : 1; - } NotificationScreen_t; void notification_screen_init(NotificationScreen_t * const notificationScreen);