diff --git a/ui-kit/android/campaigns.mdx b/ui-kit/android/campaigns.mdx index 784e9db09..99c9f6c8c 100644 --- a/ui-kit/android/campaigns.mdx +++ b/ui-kit/android/campaigns.mdx @@ -211,7 +211,7 @@ fun NotificationsScreen() { ```kotlin val feed = findViewById(R.id.notificationFeed) feed.init(this) // Pass ViewModelStoreOwner -feed.onItemClick = { item -> /* handle tap */ } +feed.setOnItemClick { item -> /* handle tap */ } ``` diff --git a/ui-kit/android/guide-threaded-messages.mdx b/ui-kit/android/guide-threaded-messages.mdx index c5c2addcd..85fccb27c 100644 --- a/ui-kit/android/guide-threaded-messages.mdx +++ b/ui-kit/android/guide-threaded-messages.mdx @@ -113,6 +113,9 @@ class ThreadMessageActivity : AppCompatActivity() { val messageList = findViewById(R.id.threadMessageList) val composer = findViewById(R.id.threadComposer) val unblock = findViewById(R.id.unblockLayout) + // A thread view: until the parent message arrives (below), the list shows its empty state + // instead of the whole conversation. From UI Kit v6.1.1. + messageList.setThreaded(true) val rawMessage = intent.getStringExtra("raw_json") // The thread screen needs the conversation TARGET as well as the parent id — carry the @@ -174,6 +177,9 @@ fun ThreadMessageScreen( CometChatMessageList( parentMessageId = parentMessage.id, + // A thread view: a missing or invalid parent shows the empty state instead of the + // whole conversation. From UI Kit v6.1.1. + threaded = true, // Required. With only the parent id there is no recipient, so replies silently // never send. user = user, diff --git a/ui-kit/android/message-list.mdx b/ui-kit/android/message-list.mdx index 6b02412e5..850bc3e3c 100644 --- a/ui-kit/android/message-list.mdx +++ b/ui-kit/android/message-list.mdx @@ -278,6 +278,7 @@ The component listens to SDK message events internally. No manual setup needed. | `setMessagesRequestBuilder(builder)` | `messagesRequestBuilder = builder` | Custom message request builder | | `setBubbleFactories(list)` | `bubbleFactories = list` | Set custom bubble factories for message types | | `setOnThreadRepliesClick { }` | `onThreadRepliesClick = { }` | Thread reply tap callback | +| `setThreaded(true)` | `threaded = true` | Mark the list as a thread view: a missing or invalid parent message shows the empty state instead of the whole conversation. A valid `setParentMessageId` / `setParentMessage` marks it threaded automatically (from v6.1.1) | | `setEnableMultipleAttachments(true)` | `enableMultipleAttachments = true` | Render multi-attachment messages with per-type bubbles and batch grouping (default `true`). See [Multiple Attachments](#multiple-attachments) | --- diff --git a/ui-kit/android/notification-feed.mdx b/ui-kit/android/notification-feed.mdx index db9e397b0..93c4343cd 100644 --- a/ui-kit/android/notification-feed.mdx +++ b/ui-kit/android/notification-feed.mdx @@ -42,8 +42,8 @@ fun NotificationsScreen(onBack: () -> Unit) { ```kotlin val feed = findViewById(R.id.notificationFeed) feed.init(this) // Pass Activity or Fragment — needed to create the ViewModel -feed.onItemClick = { item -> /* navigate */ } -feed.onBackPress = { finish() } +feed.setOnItemClick { item -> /* navigate */ } +feed.setOnBackPress { finish() } ``` @@ -145,7 +145,7 @@ CometChatNotificationFeed( ```kotlin -feed.onItemClick = { item -> +feed.setOnItemClick { item -> // Handle item tap } ``` @@ -173,7 +173,7 @@ CometChatNotificationFeed( ```kotlin -feed.onActionClick = { item, actionMap -> +feed.setOnActionClick { item, actionMap -> val actionType = actionMap["type"] as? String // Handle action } @@ -197,7 +197,7 @@ CometChatNotificationFeed( ```kotlin -feed.onError = { exception -> +feed.setOnError { exception -> Log.e("Feed", "Error: ${exception.message}") } ``` @@ -220,7 +220,7 @@ CometChatNotificationFeed( ```kotlin feed.setShowBackButton(true) -feed.onBackPress = { finish() } +feed.setOnBackPress { finish() } ```