-
public final class ChannelsViewModel extends ViewModel
ViewModel class for com.getstream.sdk.chat.view.channels.ChannelsView. Responsible for keeping the channels list up to date. Can be bound to the view using ChannelsViewModel.bindView function.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classChannelsViewModel.Statepublic final classChannelsViewModel.PaginationStatepublic classChannelsViewModel.Eventpublic classChannelsViewModel.Companion
-
Field Summary
Fields Modifier and Type Field Description private final LiveData<ChannelsViewModel.State>stateprivate final LiveData<TypingEvent>typingEventsprivate final LiveData<ChannelsViewModel.PaginationState>paginationState
-
Constructor Summary
Constructors Constructor Description ChannelsViewModel(ChatDomain chatDomain, FilterObject filter, QuerySort<Channel> sort, Integer limit)
-
Method Summary
Modifier and Type Method Description final UnitonEvent(ChannelsViewModel.Event event)final UnithideChannel(Channel channel)final UnitmarkAllRead()final LiveData<ChannelsViewModel.State>getState()final LiveData<TypingEvent>getTypingEvents()final LiveData<ChannelsViewModel.PaginationState>getPaginationState()-
Methods inherited from class androidx.lifecycle.ViewModel
equals, hashCode, toString -
Methods inherited from class com.getstream.sdk.chat.viewmodel.channels.ChannelsViewModel
clear, getTag, onCleared, setTagIfAbsent -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ChannelsViewModel
ChannelsViewModel(ChatDomain chatDomain, FilterObject filter, QuerySort<Channel> sort, Integer limit)
- Parameters:
chatDomain- entry point for all livedata & offline operationsfilter- filter for querying channels, should never be emptysort- defines the ordering of the channelslimit- the maximum number of channels to fetch
-
-
Method Detail
-
onEvent
final Unit onEvent(ChannelsViewModel.Event event)
-
hideChannel
final Unit hideChannel(Channel channel)
-
markAllRead
final Unit markAllRead()
-
getState
final LiveData<ChannelsViewModel.State> getState()
-
getTypingEvents
final LiveData<TypingEvent> getTypingEvents()
-
getPaginationState
final LiveData<ChannelsViewModel.PaginationState> getPaginationState()
-
-
-
-