build.gradle
.<uses-permission android:name="android.permission.INTERNET"/>
in AndroidManifest.xml
.CometChat.login()
.MessagesActivity
using CometChatMessageList
.Component | Role |
---|---|
activity_thread_message.xml | Defines thread UI: header, message list, composer, unblock. |
ThreadMessageActivity | Hosts thread screen; initializes UI & ViewModel. |
ThreadMessageViewModel | Fetches parent message & thread replies; manages state. |
CometChatMessageList | Displays threaded replies when given parent message ID. |
CometChatMessageComposer | Composes and sends replies with parentMessageId . |
CometChatMessageOption | Defines “Message Privately” in message context menus. |
UserDetailActivity | Handles blocked-user UI; hides composer & shows unblock. |
res/layout/activity_thread_message.xml
:
activity_thread_message.xml
ThreadMessageActivity.java
ThreadMessageViewModel.java
MessagesActivity.java
, capture thread icon taps:
MessagesActivity.java
Intent
launches ThreadMessageActivity
with message_id
.MessageList
render parent + replies.threadHeader.setMaxHeight(...)
.threadHeader.setReactionVisibility(View.GONE)
.UserDetailActivity
, detect and toggle UI:
UserDetailActivity.java
Scenario | Behavior |
---|---|
ReceiverType.USER | Direct replies allowed if not blocked. |
ReceiverType.GROUP | Checks membership before thread access. |
Blocked User | Composer hidden; unblock layout shown. |
Not in Group | Show option to join group first. |
Feature | Component / Method |
---|---|
Show thread option | setOnThreadRepliesClick() |
Display thread messages | messageList.setParentMessage(messageId) |
Show parent message | header.setMessage(parentMessage) |
Compose reply | composer.setParentMessageId(messageId) |
Handle blocked users | isBlockedByMe() , hide composer + show unblock UI |