From 0093f00df2d0999ac7576a47eedc7ae5a9b8d08d Mon Sep 17 00:00:00 2001 From: Dhruv Kushvaha Date: Mon, 12 Oct 2026 15:02:19 +0530 Subject: [PATCH] docs(android): v6.1.1 NotificationFeed setters and setThreaded (ENG-39335, ENG-39321) ENG-39335: CometChatNotificationFeed (Kotlin XML Views) callbacks are now setters in UI Kit 6.1.1; the properties are private, so `feed.onX = { }` no longer compiles. notification-feed.mdx and campaigns.mdx use setOnItemClick / setOnActionClick / setOnError / setOnBackPress (7 lines). Compose named arguments are unchanged. ENG-39321: document setThreaded(true) / `threaded = true` on CometChatMessageList: a thread view with a missing or invalid parent shows the empty state instead of the whole conversation. Added to the message-list Functionality table and to the threaded-messages guide's thread screen (Views and Compose), where the parent arrives asynchronously. Co-Authored-By: Claude Opus 5.5 --- ui-kit/android/campaigns.mdx | 2 +- ui-kit/android/guide-threaded-messages.mdx | 6 ++++++ ui-kit/android/message-list.mdx | 1 + ui-kit/android/notification-feed.mdx | 12 ++++++------ 4 files changed, 14 insertions(+), 7 deletions(-) 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() } ```