Skip to content

Commit

Permalink
Update Inbox.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemilla authored Oct 21, 2024
1 parent fd10231 commit fe87a1b
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions Docs/Inbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,37 @@ class CustomInboxFragment: Fragment(R.layout.fragment_custom_inbox) {

// Setup the listener
inboxListener = Courier.shared.addInboxListener(
onInitialLoad = {
..
onLoading = { isRefresh ->
println("Loading... Refresh: $isRefresh")
},
onError = { error ->
..
println("Error occurred: ${error.message}")
},
onMessagesChanged = { messages, unreadMessageCount, totalMessageCount, canPaginate ->
messagesAdapter.messages = messages
messagesAdapter.notifyDataSetChanged()
onUnreadCountChanged = { unreadCount ->
println("Unread count changed: $unreadCount")
},
onFeedChanged = { feed ->
messagesAdapter.addMessages(feed.messages)
recyclerView.NotifyDataSetChanged()
},
onArchiveChanged = { archive ->
println("Archive changed: $archive")
},
onPageAdded = { feed, messageSet ->
messagesAdapter.addMessages(feed.messages)
recyclerView.NotifyDataSetChanged()
},
onMessageChanged = { feed, index, message ->
messagesAdapter.updateMessageAt(index, message)
recyclerView.NotifyDataSetChanged()
},
onMessageAdded = { feed, index, message ->
messagesAdapter.addMessageAt(index, message)
recyclerView.NotifyDataSetChanged()
},
onMessageRemoved = { feed, index, message ->
messagesAdapter.removeMessageAt(index, message)
recyclerView.NotifyDataSetChanged()
}
)

Expand Down

0 comments on commit fe87a1b

Please sign in to comment.