ChatComponentFactory
Factory for creating stateless components that are used by default throughout the Chat UI.
Example of a custom ChatComponentFactory implementation that changes the default UI of the trailing content of the channel list header element:
ChatTheme(
componentFactory = object : ChatComponentFactory() {
@Composable
override fun RowScope.ChannelListHeaderTrailingContent(
onHeaderActionClick: () -> Unit,
) {
IconButton(onClick = onHeaderActionClick) {
Icon(
imageVector = Icons.Default.Add,
contentDescription = "Add",
)
}
}
}
) {
// Your Chat screens
}
ChatComponentFactory can also be extended in a separate class and passed to the ChatTheme as shown:
class MyChatComponentFactory : ChatComponentFactory {
@Composable
override fun RowScope.ChannelListHeaderTrailingContent(onHeaderActionClick: () -> Unit) {
IconButton(onClick = onHeaderActionClick) {
Icon(
imageVector = Icons.Default.Add,
contentDescription = "Add",
)
}
}
}
ChatTheme(
componentFactory = MyComponentFactory()
) {
// Your Chat screens
}
Functions
The default 'Send' button in the attachments picker. Shown as ">" icon in the attachments picker header, enabled when there is at least one selected attachment.
The default avatar, which renders an image from the provided image URL. In case the image URL is empty or there is an error loading the image, it falls back to an image with initials.
The default avatar for a channel. It renders the Channel avatar that's shown when browsing channels or when you open the messages screen. Based on the state of the Channel and the number of members, it might use Avatar, UserAvatar, or GroupAvatar to show different types of images.
The default center content of the channel item. Usually the name of the channel and the last message.
The default leading content of the channel item. Usually the avatar that holds an image of the channel or its members.
The default read status indicator in the channel item, weather the last message is sent, pending or read.
The default trailing content of the channel item. Usually information about the last message such as its read state, timestamp, and the number of unread messages.
The default unread count indicator in the channel item.
The default divider between channel items.
The default empty content of the channel list.
The default empty search content of the channel list, when there are no matching search results.
The default header shown above the channel list. Usually contains the current user's avatar, a title or the connected status, and an action button.
The default center content of the channel list header. Usually shows the title if connectionState is ConnectionState.Connected, a Disconnected
text if connectionState is offline, or NetworkLoadingIndicator otherwise.
The default leading content of the channel list header. Usually the avatar of the current user if it's available.
The default trailing content of the channel list header. Usually an action button.
The default helper content of the channel list. It's empty by default and can be used to implement a scroll to top feature.
The default channel list item content.
The default loading indicator of the channel list, when the initial data is loading.
The default loading more item, when the next page of the channel list is loading.
Factory method for creating the full content of the SelectedChannelMenu.
Factory method for creating the center content of the SelectedChannelMenu.
Factory method for creating the header content of the SelectedChannelMenu.
Factory method for creating the options content of the SelectedChannelMenu.
Factory method for creating the footer content of the SelectedChannelMenu.
Factory method for creating the leading icon of the Channel options menu item.
Factory method for creating the header content of the SelectedReactionsMenu.
Factory method for creating the center content of the reactions menu.
The default empty placeholder that is displayed when the mention list is empty.
The default content of a mention list item.
The default loading indicator that is displayed during the initial loading of the mention list.
The default loading indicator that is displayed on the bottom of the list when there are more mentions loading.
The default pull-to-refresh indicator for the mention list.
Factory method for creating a generic menu option item.
The default appearance of the message bubble.
The default message composer that contains the message input, attachments, commands, recording actions, integrations, and the send button.
The default attachments button of the message composer.
The default "Audio record (voice message)" button of the message composer.
Default composable used for displaying audio recording information while audio recording is in progress.
The default commands button of the message composer.
The default instant commands popup content of the message composer. Shown when the user types '/' in the composer, and there are available commands that can be used, or when the user click the "Commands" button.
The default command suggestion item of the message composer.
The default center content of the command suggestion item of the message composer.
The default leading content of the command suggestion item of the message composer.
The default cooldown indicator of the message composer. Shown when the user is prevented from sending messages due to a cooldown.
The default footer content of the message composer. When replying to a thread, it provides the checkbox to also send the message to the channel.
The default header content of the message composer. Shown on top of the composer and contains additional info/context, and is shown during editing/replying to a message, or when there is a link pasted in the composer.
The default input content of the message composer.
The default integrations of the message composer. Provides the "Attachments" and "Commands" buttons shown before the composer.
The default label of the message composer.
Shows a preview of the link that the user has entered in the message composer. Shows the link image preview, the title of the link and its description.
The default mentions popup content of the message composer. Shown when the user types '@' in the composer, and there are available users that can be mentioned.
The default mention suggestion item of the message composer.
The default center content of the mention suggestion item of the message composer.
The default leading content of the mention suggestion item of the message composer.
The default trailing content of the mention suggestion item of the message composer.
The default options header for the message input component. It is based on the currently active message action - io.getstream.chat.android.ui.common.state.messages.Reply or io.getstream.chat.android.ui.common.state.messages.Edit. It shows a heading based on the action and a cancel button to cancel the action.
The default appearance of a quoted message in the message composer. Shown when the user quotes (replies to) a message in the composer.
The default "Send" button of the message composer.
The default trailing content of the message composer. Contains the "Send" button, and "Audio record" button (if enabled).
The default content of a deleted message.
Icon shown at the bottom-end of a Message when it failed to send.
The default footer content. Usually contains either MessageThreadFooter or the default footer, which holds the sender name and the timestamp.
The default content of the only-visible-to-you footer message.
The default read status indicator in the message footer, weather the message is sent, pending or read.
The default uploading content of the message footer. Usually shows how many items have been uploaded and the total number of items.
The default Giphy message content.
The default center content of the message item. Usually a message bubble with attachments or emoji stickers if the message contains only emoji.
The default footer content of the message item. Usually showing some of the following UI elements: upload status, thread participants, message timestamp.
The default header content of the message item. Usually shown if the message is pinned and a list of reactions for the message.
The default leading content of the message item. Usually the avatar of the user if the message doesn't belong to the current user.
The default trailing content of the message item. Usually an extra spacing at the end of the message item if the author is the current user.
The default date separator item content of the message list.
The default empty content of the message list, when the message list is empty.
The default empty thread placeholder item content of the message list.
The default header of the message list. Usually a back button as a leading content, the channel title in the top center, the channel information or the connection status in the bottom center, and the channel avatar as the trailing content.
The default center content of the message list header. Usually shows the channel title in the top and the channel information or the connection status in the bottom.
The default leading content of the message list header, which is the back button.
The default trailing content of the message list header, which is the channel avatar.
The default helper content of the message list. It handles the scroll-to-bottom and scroll-to-focused message features.
The default message list item container, which renders each MessageListItemState's subtype.
The default item content of a regular message.
The default message list item modifier for styling.
The default loading indicator of the message list, when the initial message list is loading.
The default loading more item of the message list, when the next page of messages is loading.
The default moderated message content of the message list.
The default start of the channel item content of the message list.
The default system message content of the message list.
The default thread date separator item content of the message list.
The default typing indicator content of the message list.
The default unread separator item content of the message list.
Factory method for creating the full content of the SelectedMessageMenu. This is the menu that appears when a message is long-pressed.
Factory method for creating the center content of the SelectedMessageMenu.
Factory method for creating the header content of the SelectedMessageMenu.
Shows the default message options.
Factory method for creating the options content of the SelectedMessageMenu.
Factory method for creating the leading icon of the Message options menu item. This is the icon that appears on the left side of the message option.
Factory method for creating the reactions menu more option.
Factory method for creating the center content of the reaction picker.
Factory method for creating the header content of the reaction picker.
The default content of a regular message that can contain attachments and text.
The default empty placeholder that is displayed when there are no pinned messages.
The default content of the pinned message list item.
The default loading content of the pinned message list. Shows the message sender name and the message content.
The default divider appended after each pinned message.
The default loading content of the pinned message list. Shows an avatar of the user who sent the pinned message.
The default loading content of the pinned message list. Shows the message timestamp.
The default loading content that is displayed during the initial loading of the pinned messages.
The default content shown on the bottom of the list during the loading of more pinned messages.
Factory method for creating the header content of the SelectedReactionsMenu.
Factory method for the reaction options in the menu.
Factory method for creating the reactions menu more option.
Factory method for creating the full content of the SelectedReactionsMenu.
Factory method for creating the center content of the reactions menu.
Factory method for creating the header content of the SelectedReactionsMenu.
The default scroll-to-bottom button shown when the user scrolls away from the bottom of the list.
The default clear button of the search input.
The default label of the search input.
The default leading icon of the search input.
The default center content of a search result item. Shows information about the message and by who and where it was sent.
The default search result item of the channel list.
The default leading content of a search result item. Shows the avatar of the user who sent the message.
The default trailing content of a search result item. Shows the message timestamp.
The default content shown when swiping to reply to a message.
The default empty placeholder that is displayed when there are no threads.
The default thread list item. Shows information about the Thread title, parent message, last reply and number of unread replies.
Default representation of the latest reply content in a thread. Shows a preview of the last message in the thread.
Default representation of the parent message preview in a thread.
Default representation of the thread title.
Default representation of the unread count badge. Not shown if unreadCount == 0.
The default loading content that is displayed during the initial loading of the threads.
The default content shown on the bottom of the list during the loading of more threads.
The default "Unread threads" banner. Shows the number of unread threads in the "ThreadList".
The default user avatar content. It renders the User avatar that's shown on the messages screen or in headers of direct messages. If showOnlineIndicator is true
and the user is online, it uses Avatar to shows an image or their initials.