Updated the notification state callback to pass the handle to the registered callback function

This commit is contained in:
anschrammh 2023-12-18 21:19:52 +01:00
parent 83b1571067
commit 0787496aa4
2 changed files with 4 additions and 5 deletions

View File

@ -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)
{

View File

@ -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);