MessageListViewModel

class MessageListViewModel(    predicate: Predicate<Message>?,     inbox: Inbox = MessageCenter.shared().inbox,     savedStateHandle: SavedStateHandle) : ViewModel

ViewModel for MessageListView.

Constructors

Link copied to clipboard
constructor(predicate: Predicate<Message>?, inbox: Inbox = MessageCenter.shared().inbox, savedStateHandle: SavedStateHandle)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val states: StateFlow<MessageListState>

A Flow of Message List States (data consumed by the view in order to display the message list).

Link copied to clipboard

A LiveData of Message List States (data consumed by the view in order to display the message list).

Functions

Link copied to clipboard
fun deleteMessages(messages: List<Message>)

Deletes the given list of messages.

Link copied to clipboard
fun markMessagesRead(messages: List<Message>)

Marks the given list of messages as read.

Link copied to clipboard
fun refreshInbox(onRefreshed: () -> Unit = {})

Refreshes the inbox.

Link copied to clipboard
fun setHighlighted(message: Message)

Sets the currently highlighted message.

fun setHighlighted(messageId: String?)

Sets the currently highlighted messageId.

Link copied to clipboard
fun setPredicate(predicate: Predicate<Message>?)

Sets the Predicate used to filter messages.

Inherited functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
Link copied to clipboard
protected open fun onCleared()