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 if the message we want to scroll to is in a thread. If the message we want to scroll to is not in a thread, you can pass in a null value.

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.