How to inject and render custom data in the Conversation List #85
elliot-choic
announced in
Conversation List
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Versions
Summary
This guide explains how to inject a custom data at the conversation list and customize its appearance by creating a custom repository, adapter, and view.
Guide & Snippet
iOS
Header
Android
Steps to Customize the Header
This guide demonstrates how to insert custom data at the top of the conversation list.
1. Extend the Repository to Add Custom Items
To include custom data (e.g., a system notice, a pinned info card, or a static banner), override the DefaultConversationListRepository and manually prepend the item to the list before rendering.
Then, register the repository:
AIAgentRepositoryProviders.conversationList =
ConversationListRepositoryProvider { aiAgentId ->
CustomConversationListRepository(aiAgentId)
}
2. Customize the Adapter to Handle Custom Items
To render your custom item, override getItemViewType() and onCreateViewHolder() in your adapter:
Register your adapter:
JS
Header
// code block
Reference
No response
Screenshots
No response
Beta Was this translation helpful? Give feedback.
All reactions