ChannelsViewModel

class ChannelsViewModel(repository: ChannelsScreenResourceRepository, savedStateHandle: SavedStateHandle) : ViewModel, ChannelsViewModelContract

The ViewModel class for ChannelsScreen.

Since

1.0.0-beta.1

Constructors

Link copied to clipboard
constructor(repository: ChannelsScreenResourceRepository, savedStateHandle: SavedStateHandle)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val channelsEventState: StateFlow<ChannelsEvent>

The StateFlow of the ChannelsEvent.

Link copied to clipboard
open override val leaveChannelEventState: StateFlow<SimpleSendbirdEventState>

The StateFlow of the SimpleSendbirdEventState for the leaveChannel request.

Link copied to clipboard
open override val loadMoreEventState: StateFlow<SimpleSendbirdEventState>

The StateFlow of the SimpleSendbirdEventState for the loadMore request.

Link copied to clipboard

The StateFlow of the SimpleSendbirdEventState for the setMyPushTriggerOption request.

Link copied to clipboard
open override val totalChannelsState: StateFlow<List<UikitGroupChannel>>

The StateFlow of the list of UikitGroupChannel.

Link copied to clipboard
open override val uiState: StateFlow<SendbirdScreenUiState>

The StateFlow of the SendbirdScreenUiState.

Functions

Link copied to clipboard
open override fun leaveChannel(url: String)

Requests to leave the channel. The result will be notified by leaveChannelEventState.

Link copied to clipboard
open override fun loadMore()

Requests to load more channels. This should be called when the user scrolls to the end of the list.

Link copied to clipboard

Notifies that the leaveChannel event has been processed to reset leaveChannelEventState to SendbirdEventState.Idle state.

Link copied to clipboard
open override fun notifyLoadMoreEventProcessed()

Notifies that the loadMore event has been processed to reset loadMoreEventState to SendbirdEventState.Idle state.

Notifies that the setMyPushTriggerOption event has been processed to reset setMyPushTriggerOptionEventState to SendbirdEventState.Idle state.

Link copied to clipboard
protected open override fun onCleared()
Link copied to clipboard
open override fun prepare()

The preparation process required for the screen. This contains the Chat SDK's connection by SendbirdChat.connect and getting the channel object ready if necessary.

Link copied to clipboard
open override fun setMyPushTriggerOption(url: String, option: GroupChannel.PushTriggerOption)

Requests to set the push trigger option for the current user for a specific channel.