Package-level declarations

Types

Link copied to clipboard

ViewModel responsible for handling the composing and sending of messages.

Link copied to clipboard

A binder class responsible for binding the MessageComposerViewModel with the user interface components. It provides flexibility by allowing custom listeners for various message composer events.

Link copied to clipboard
class MessageListHeaderViewModel(cid: String, chatClient: ChatClient = ChatClient.instance(), clientState: ClientState = chatClient.clientState, messageId: String? = null) : ViewModel

ViewModel class for MessageListHeaderView.

Link copied to clipboard
class MessageListViewModel(messageListController: MessageListController, chatClient: ChatClient = ChatClient.instance()) : ViewModel

View model class for MessageListView. Responsible for updating the list of messages. Can be bound to the view using MessageListViewModel.bindView function.

Link copied to clipboard
class MessageListViewModelFactory @JvmOverloads constructor(context: Context, cid: String, messageId: String? = null, parentMessageId: String? = null, chatClient: ChatClient = ChatClient.instance(), clientState: ClientState = chatClient.clientState, mediaRecorder: StreamMediaRecorder = DefaultStreamMediaRecorder(context.applicationContext), userLookupHandler: UserLookupHandler = DefaultUserLookupHandler(chatClient, cid), fileToUri: (File) -> String = { file -> file.toUri().toString() }, messageLimit: Int = MessageListController.DEFAULT_MESSAGES_LIMIT, enforceUniqueReactions: Boolean = true, maxAttachmentCount: Int = AttachmentConstants.MAX_ATTACHMENTS_COUNT, showSystemMessages: Boolean = true, deletedMessageVisibility: DeletedMessageVisibility = DeletedMessageVisibility.ALWAYS_VISIBLE, messageFooterVisibility: MessageFooterVisibility = MessageFooterVisibility.WithTimeDifference(), dateSeparatorHandler: DateSeparatorHandler = DateSeparatorHandler.getDefaultDateSeparatorHandler(), threadDateSeparatorHandler: DateSeparatorHandler = DateSeparatorHandler.getDefaultThreadDateSeparatorHandler(), messagePositionHandler: MessagePositionHandler = MessagePositionHandler.defaultHandler(), showDateSeparatorInEmptyThread: Boolean = false, showThreadSeparatorInEmptyThread: Boolean = false, threadLoadOlderToNewer: Boolean = false) : ViewModelProvider.Factory

A ViewModel factory for MessageListViewModel, MessageListHeaderViewModel and MessageComposerViewModel.

Inherited functions

Link copied to clipboard

Binds MessageListHeaderView with MessageListHeaderViewModel, updating the view's state based on data provided by the ViewModel.

@JvmName(name = "bind")
fun MessageListViewModel.bindView(view: MessageListView, lifecycleOwner: LifecycleOwner)

Binds MessageListView with MessageListViewModel, updating the view's state based on data provided by the ViewModel, and forwarding View events to the ViewModel.

@JvmName(name = "bind")
fun MessageComposerViewModel.bindView(view: MessageComposerView, lifecycleOwner: LifecycleOwner, messageBuilder: () -> Message = { buildNewMessage() }, sendMessageButtonClickListener: (Message) -> Unit = this.sendMessageButtonClickListener, textInputChangeListener: (String) -> Unit = this.textInputChangeListener, attachmentSelectionListener: (List<Attachment>) -> Unit = this.attachmentSelectionListener, attachmentRemovalListener: (Attachment) -> Unit = this.attachmentRemovalListener, pollSubmissionListener: (PollConfig) -> Unit = this.pollSubmissionListener, mentionSelectionListener: (User) -> Unit = this.mentionSelectionListener, commandSelectionListener: (Command) -> Unit = this.commandSelectionListener, alsoSendToChannelSelectionListener: (Boolean) -> Unit = this.alsoSendToChannelSelectionListener, dismissActionClickListener: () -> Unit = this.dismissActionClickListener, commandsButtonClickListener: () -> Unit = this.commandsButtonClickListener, dismissSuggestionsListener: () -> Unit = this.dismissSuggestionsListener, audioRecordButtonHoldListener: () -> Unit = this.audioRecordButtonHoldListener, audioRecordButtonLockListener: () -> Unit = this.audioRecordButtonLockListener, audioRecordButtonCancelListener: () -> Unit = this.audioRecordButtonCancelListener, audioRecordButtonReleaseListener: () -> Unit = this.audioRecordButtonReleaseListener, audioDeleteButtonClickListener: () -> Unit = this.audioDeleteButtonClickListener, audioStopButtonClickListener: () -> Unit = this.audioStopButtonClickListener, audioPlaybackButtonClickListener: () -> Unit = this.audioPlaybackButtonClickListener, audioCompleteButtonClickListener: () -> Unit = this.audioCompleteButtonClickListener, audioSliderDragStartListener: (Float) -> Unit = this.audioSliderDragStartListener, audioSliderDragStopListener: (Float) -> Unit = this.audioSliderDragStopListener)

Function which connects MessageComposerView to MessageComposerViewModel. As a result the view renders the state delivered by the ViewModel, and the ViewModel intercepts the user's actions automatically.

Link copied to clipboard
@JvmName(name = "bindDefaults")
fun MessageComposerViewModel.bindViewDefaults(view: MessageComposerView, lifecycleOwner: LifecycleOwner, messageBuilder: () -> Message = { buildNewMessage() }, sendMessageButtonClickListener: (Message) -> Unit? = null, textInputChangeListener: (String) -> Unit? = null, attachmentSelectionListener: (List<Attachment>) -> Unit? = null, attachmentRemovalListener: (Attachment) -> Unit? = null, pollSubmissionListener: (PollConfig) -> Unit? = null, mentionSelectionListener: (User) -> Unit? = null, commandSelectionListener: (Command) -> Unit? = null, alsoSendToChannelSelectionListener: (Boolean) -> Unit? = null, dismissActionClickListener: () -> Unit? = null, commandsButtonClickListener: () -> Unit? = null, dismissSuggestionsListener: () -> Unit? = null, audioRecordButtonHoldListener: () -> Unit? = null, audioRecordButtonLockListener: () -> Unit? = null, audioRecordButtonCancelListener: () -> Unit? = null, audioRecordButtonReleaseListener: () -> Unit? = null, audioDeleteButtonClickListener: () -> Unit? = null, audioStopButtonClickListener: () -> Unit? = null, audioPlaybackButtonClickListener: () -> Unit? = null, audioCompleteButtonClickListener: () -> Unit? = null, audioSliderDragStartListener: (Float) -> Unit? = null, audioSliderDragStopListener: (Float) -> Unit? = null)

Function which connects MessageComposerView to MessageComposerViewModel. As a result the view renders the state delivered by the ViewModel, and the ViewModel intercepts the user's actions automatically. The main difference with bindView is that listeners in this function do not override the default behaviour.