Package 

Class PinnedMessageListViewModel


  • 
    public final class PinnedMessageListViewModel
    extends ViewModel
                        

    ViewModel responsible for providing pinned messages in the channel. Pinned messages are provided in a descending order based on Message.pinnedAt. Can be bound to the view using PinnedMessageListViewModel.bindView function.

    • Method Summary

      Modifier and Type Method Description
      final LiveData<PinnedMessageListState> getState() The current pinned messages' state.
      final LiveData<Event<Unit>> getErrorEvents() One shot error events when a query fails.
      final Unit loadMore() Loads more data when requested.
      • Methods inherited from class io.getstream.chat.android.ui.viewmodel.pinned.PinnedMessageListViewModel

        addCloseable, addCloseable, addCloseable, getCloseable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PinnedMessageListViewModel

        PinnedMessageListViewModel(PinnedMessageListController controller)
        Parameters:
        controller - the PinnedMessageListController handling the business logic and the state management for the pinned message list.
    • Method Detail

      • getState

         final LiveData<PinnedMessageListState> getState()

        The current pinned messages' state.

      • loadMore

         final Unit loadMore()

        Loads more data when requested.

        Does nothing if the end of the list has already been reached or loading is already in progress.