Class MessageListHeaderViewModel

    • Constructor Detail

      • MessageListHeaderViewModel

        MessageListHeaderViewModel(String cid, ChatClient chatClient, ClientState clientState, String messageId)
        Parameters:
        cid - The CID of the current channel.
        chatClient - An instance of the low level chat client.
        clientState - Client state of SDK that contains information such as the current user and connection state.
        messageId - The id of a message we wish to scroll to in messages list.
    • Method Detail

      • getChannel

         final LiveData<Channel> getChannel()

        The current Channel created from ChannelState. It emits new data either when channel data or the list of members in ChannelState updates.

        Combining the two is important because members changing online status does not result in channel events being received.

      • getOnline

         final LiveData<ConnectionState> getOnline()

        Current user's online status.

      • getActiveThread

         final LiveData<Message> getActiveThread()

        Signals that we are currently in thread mode if the value is non-null. If the value is null we are in normal mode.

      • setActiveThread

         final Unit setActiveThread(Message message)

        Sets thread mode.

        Parameters:
        message - The original message on which the thread is based on.
      • resetThread

         final Unit resetThread()

        Switches to normal (non-thread) mode.