Quick Reference
Quick Reference
| Field | Value |
|---|---|
| Packages | com.cometchat:chatuikit-kotlin-android · com.cometchat:chatuikit-compose-android |
| Key components | CometChatSearch, CometChatMessageList, CometChatMessageComposer, CometChatMessageHeader |
| Purpose | Full-text message search across conversations with result routing and navigation |
| Sample app | GitHub |
| Related | Search Component, All Guides |
Components
| Component / Class | Role |
|---|---|
CometChatSearch | Main search interface with filter chips and result lists |
CometChatMessageList | Displays messages in the selected conversation |
CometChatMessageComposer | Message input for the selected conversation |
CometChatMessageHeader | Header bar showing conversation context |
Integration Steps
1. Add CometChatSearch to your layout
- Kotlin (XML Views)
- Jetpack Compose
activity_search.xml
2. Handle conversation result clicks
When a user taps a conversation result, navigate to the message view for that conversation.- Kotlin (XML Views)
- Jetpack Compose
SearchActivity.kt
3. Handle message result clicks
When a user taps a message result, navigate to the conversation and scroll to that message.- Kotlin (XML Views)
- Jetpack Compose
SearchActivity.kt
4. Scope search to a specific conversation (optional)
Restrict search results to a single user or group conversation.- Kotlin (XML Views)
- Jetpack Compose
5. Configure search filters (optional)
Control which filter chips appear.- Kotlin (XML Views)
- Jetpack Compose
Feature Matrix
| Feature | Kotlin (XML Views) | Jetpack Compose |
|---|---|---|
| Search interface | CometChatSearch XML element | CometChatSearch() composable |
| Conversation results | setOnConversationClicked | onConversationClick lambda |
| Message results | setOnMessageClicked | onMessageClick lambda |
| Scoped search | setUid() / setGuid() | uid / guid parameters |
| Filter chips | setSearchFilters() | searchFilters parameter |
| Custom views | setEmptyView(), setErrorView() | emptyView, errorView composable slots |
Next Steps
Search
The search component reference
Message List
Display messages in a conversation
All Guides
Browse all feature and formatter guides
Sample App
Full working sample application on GitHub