ChannelViewModelFactory

constructor(context: Context, channelId: String, messageId: String? = null, parentMessageId: String? = null, autoTranslationEnabled: Boolean = true, chatClient: ChatClient = ChatClient.instance(), clientState: ClientState = chatClient.clientState, mediaRecorder: StreamMediaRecorder = DefaultStreamMediaRecorder(context.applicationContext), userLookupHandler: UserLookupHandler = DefaultUserLookupHandler(chatClient, channelId), fileToUriConverter: (File) -> String = { file -> file.toUri().toString() }, clipboardHandler: ClipboardHandler = ClipboardHandlerImpl( clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager, autoTranslationEnabled = autoTranslationEnabled, getCurrentUser = chatClient::getCurrentUser, ), messageListOptions: MessageListOptions = MessageListOptions(), composerOptions: ComposerOptions = ComposerOptions())

Parameters

context

Android context used to access system services and device storage.

channelId

The current channel ID, to load the messages from.

messageId

The message id to which we want to scroll to when opening the message list.

parentMessageId

The ID of the parent Message to open the screen directly in a thread: the message list is scoped to that thread and the composer starts in thread mode. Pass null to open the channel.

autoTranslationEnabled

Whether auto-translation of messages is enabled.

chatClient

The client to use for API calls.

clientState

The current state of the SDK.

mediaRecorder

The media recorder for async voice messages.

userLookupHandler

Handler used to look up users for mention autocomplete.

fileToUriConverter

Converts a local File to a URI string used as an attachment source.

clipboardHandler

ClipboardHandler used to copy messages.

messageListOptions

Configuration for the message list behavior.

composerOptions

Configuration for the message composer behavior.