Package io.rong.imkit.conversation

## Class ConversationViewModel

- All Implemented Interfaces:

      public class ConversationViewModel

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `public class` | `ConversationViewModel.Factory` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `public MediatorLiveData<TypingInfo>` | `typingStatusInfo` |
    `public MediatorLiveData<SubscribeUserOnlineStatus>` | `onlineStatus` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ConversationViewModel(Application application)` |
    `ConversationViewModel(String targetId, ConversationType conversationType, String title, Application application)` |

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `MediatorLiveData<TypingInfo>` | `getTypingStatusInfo()` | 获取正在输入的状态信息
    `MediatorLiveData<SubscribeUserOnlineStatus>` | `getOnlineStatus()` |
    `boolean` | `isOnlineStatus()` |
    `MediatorLiveData<Boolean>` | `getNotify()` |
    `void` | `getUserOnlineStatus(String mTargetId)` |
    `void` | `getNotificationStatus(ConversationType type, String targetId)` |
    `void` | `)>clearMessages(ConversationType conversationType, String targetId, ResultCallback<Boolean> callback)` | 根据会话类型，清空某一会话的所有聊天消息记录,回调方式获取清空是否成功。

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConversationViewModel

          ConversationViewModel(Application application)

    - #### ConversationViewModel

          ConversationViewModel(String targetId, ConversationType conversationType, String title, Application application)

  - ### Method Detail

    - #### getTypingStatusInfo

           MediatorLiveData<TypingInfo> getTypingStatusInfo()

      获取正在输入的状态信息

      Returns:

        输入状态

    - #### getOnlineStatus

           MediatorLiveData<SubscribeUserOnlineStatus> getOnlineStatus()

    - #### isOnlineStatus

           boolean isOnlineStatus()

    - #### getNotify

           MediatorLiveData<Boolean> getNotify()

    - #### getUserOnlineStatus

           void getUserOnlineStatus(String mTargetId)

    - #### getNotificationStatus

           void getNotificationStatus(ConversationType type, String targetId)

    - #### clearMessages

           void )>clearMessages(ConversationType conversationType, String targetId, ResultCallback<Boolean> callback)

      根据会话类型，清空某一会话的所有聊天消息记录,回调方式获取清空是否成功。

      Parameters:
        `conversationType` - 会话类型。不支持传入 ConversationType.
        `targetId` - 目标 Id。根据不同的 conversationType，可能是用户 Id、讨论组 Id、群组 Id。
        `callback` - 清空是否成功的回调。