ChannelViewModelContract

The ViewModel contract for ChannelScreen.

Since

1.0.0

Inheritors

Properties

Link copied to clipboard

The StateFlow of the SimpleSendbirdEventState for the deleteMessage request.

Link copied to clipboard
abstract val hasNext: Boolean

The flag to check if there are more messages to load.

Link copied to clipboard
abstract val hasPrevious: Boolean

The flag to check if there are more messages to load.

Link copied to clipboard
abstract val initialized: StateFlow<Boolean>

The flag to check if the channel is initialized.

Link copied to clipboard

The StateFlow of the SimpleSendbirdEventState for the loadNext request.

Link copied to clipboard

The StateFlow of the SimpleSendbirdEventState for the loadPrevious request.

Link copied to clipboard
abstract val messagesEventState: StateFlow<MessagesEvent>

The StateFlow of the MessagesEvent.

Link copied to clipboard

The StateFlow of the SimpleSendbirdEventState for the resendMessage request.

Link copied to clipboard

The StateFlow of the SimpleSendbirdEventState for the sendFileMessage request.

Link copied to clipboard

The StateFlow of the SimpleSendbirdEventState for the sendUserMessage request.

Link copied to clipboard
abstract val totalMessagesState: StateFlow<List<UikitBaseMessage>>

The StateFlow of the list of UikitBaseMessage to display.

Link copied to clipboard

The StateFlow of the SimpleSendbirdEventState for the updateUserMessage request.

Functions

Link copied to clipboard
abstract fun deleteMessage(message: UikitBaseMessage)

Deletes a message with a given message. Deleting is only allowed for a message with ChatBaseMessage type.

Link copied to clipboard
abstract fun loadInitial(startingPoint: Long = Long.MAX_VALUE)

Loads the initial messages.

Link copied to clipboard
abstract fun loadNext()

Loads the messages to the latest direction to fetch newer messages.

Link copied to clipboard
abstract fun loadPrevious()

Loads the messages to the previous direction to fetch older messages.

Link copied to clipboard

Notifies that the deleteMessage event has been processed to reset deleteMessageEventState to SendbirdEventState.Idle state.

Link copied to clipboard

Notifies that the loadNext event has been processed to reset loadNextEventState to SendbirdEventState.Idle state.

Link copied to clipboard

Notifies that the loadPrevious event has been processed to reset loadPreviousEventState to SendbirdEventState.Idle state.

Link copied to clipboard

Notifies that the resendMessage event has been processed to reset resendMessageEventState to SendbirdEventState.Idle state.

Link copied to clipboard

Notifies that the sendFileMessage event has been processed to reset sendFileMessageEventState to SendbirdEventState.Idle state.

Link copied to clipboard

Notifies that the sendUserMessage event has been processed to reset sendUserMessageEventState to SendbirdEventState.Idle state.

Link copied to clipboard

Notifies that the updateUserMessage event has been processed to reset updateUserMessageEventState to SendbirdEventState.Idle state.

Link copied to clipboard
abstract fun resendMessage(message: UikitBaseMessage)

Resends a message with a given message. Resending is only allowed for a message with ChatBaseMessage type.

Link copied to clipboard
abstract fun sendFileMessage(file: File)

Sends a file message with a given file.

Link copied to clipboard
abstract fun sendUserMessage(message: String)

Sends a user message with a given message.

Link copied to clipboard
abstract fun setTyping(isTyping: Boolean)

Sets the typing status.

Link copied to clipboard
abstract fun updateUserMessage(messageId: Long, message: String)

Updates a message with a given messageId and message.