-
public final class MessageListViewModel extends ViewModel
View model class for com.getstream.sdk.chat.view.MessageListView. Responsible for updating the list of messages. Can be bound to the view using MessageListViewModel.bindView function.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMessageListViewModel.Statepublic classMessageListViewModel.Eventpublic classMessageListViewModel.Mode
-
Field Summary
Fields Modifier and Type Field Description private final LiveData<Boolean>loadMoreLiveDataprivate final LiveData<Channel>channelprivate final MutableLiveData<MessageListViewModel.Mode>modeprivate final LiveData<MessageListViewModel.State>stateprivate final UsercurrentUser
-
Constructor Summary
Constructors Constructor Description MessageListViewModel(String cid, ChatDomain domain, ChatClient client)
-
Method Summary
Modifier and Type Method Description final UnitonEvent(MessageListViewModel.Event event)Handles an event coming from the View layer final LiveData<Boolean>getLoadMoreLiveData()final LiveData<Channel>getChannel()final MutableLiveData<MessageListViewModel.Mode>getMode()Whether the user is viewing a thread final LiveData<MessageListViewModel.State>getState()Current message list state final UsergetCurrentUser()-
Methods inherited from class androidx.lifecycle.ViewModel
equals, hashCode, toString -
Methods inherited from class com.getstream.sdk.chat.viewmodel.messages.MessageListViewModel
clear, getTag, onCleared, setTagIfAbsent -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MessageListViewModel
MessageListViewModel(String cid, ChatDomain domain, ChatClient client)
- Parameters:
cid- the full channel id, i.e.domain- entry point for all livedata & offline operationsclient- entry point for all low-level operations
-
-
Method Detail
-
onEvent
final Unit onEvent(MessageListViewModel.Event event)
Handles an event coming from the View layer
-
getLoadMoreLiveData
final LiveData<Boolean> getLoadMoreLiveData()
-
getChannel
final LiveData<Channel> getChannel()
-
getMode
final MutableLiveData<MessageListViewModel.Mode> getMode()
Whether the user is viewing a thread
-
getState
final LiveData<MessageListViewModel.State> getState()
Current message list state
-
getCurrentUser
final User getCurrentUser()
-
-
-
-