CometChatUsers
+ CometChatGroups
), providing a seamless flow from your conversation list to a specific chat.
build.gradle
.ConversationActivity
→ NewChatActivity
→ MessagesActivity
.AndroidManifest.xml
.Component / Class | Role |
---|---|
ConversationActivity | Entry point; hosts “+” icon to launch New Chat screen. |
NewChatActivity | Displays tabbed Users/Groups lists. |
activity_new_chat.xml | Layout defining TabLayout , CometChatUsers , CometChatGroups . |
CometChatUsers | Lists and searches users; exposes setOnItemClick() . |
CometChatGroups | Lists and searches groups; exposes setOnItemClick() . |
UsersRequestBuilder | Configures user query filters (e.g. pagination). |
GroupsRequestBuilder | Configures group query filters (e.g. pagination). |
MessagesActivity | Chat UI for the selected user or group. |
activity_messages.xml | Layout for the chat header, message list, and composer. |
NewChatActivity
.
NewChatActivity.java
Layout reference:activity_new_chat.xml
Initializes tabs and loads CometChatUsers
/ CometChatGroups
fragments.
MessagesActivity
when an item is tapped.
NewChatActivity.java
Routes selection to the chat interface with proper context.
MessagesActivity.java
Layout reference:activity_messages.xml
Binds the selected conversation context to the UI Kit components.
NewChatActivity
launches.MessagesActivity
with JSON payload.cometchatTheme
attributes to TabLayout
and list items.UsersRequestBuilder
/ GroupsRequestBuilder
(e.g., hideBlockedUsers(true)
).MessagesActivity
with a custom screen.android:fitsSystemWindows="true"
to avoid overlap.CometChatUsers
and CometChatGroups
.Snackbar
messages.CometChatUsers
/ CometChatGroups
to handle failures.Feature | Component / Method | File(s) |
---|---|---|
Launch New Chat screen | Menu item click in ConversationActivity | ConversationActivity.java |
Tabbed lists | TabLayout + ViewPager2 | activity_new_chat.xml |
List/search users | CometChatUsers + UsersRequestBuilder | activity_new_chat.xml |
List/search groups | CometChatGroups + GroupsRequestBuilder | activity_new_chat.xml |
Selection handling | setOnItemClick() | NewChatActivity.java |
Initialize chat | messageHeader , messageList , composer | MessagesActivity.java , activity_messages.xml |