Class UltraGroupConversationListViewModel
-
- All Implemented Interfaces:
public class UltraGroupConversationListViewModel
-
-
Constructor Summary
Constructors Constructor Description UltraGroupConversationListViewModel(Application application)
-
Method Summary
Modifier and Type Method Description voidgetConversationList(boolean loadMore, boolean isEventManual)从本地数据库获取会话列表。 此处借鉴前端的函数节流思想,在 REFRESH_INTERVAL 时间内,丢弃掉其它触发,只做一次执行。 以便提高接受大量消息时的刷新性能。 MediatorLiveData<List<BaseUiConversation>>getConversationListLiveData()LiveData<NoticeContent>getNoticeContentLiveData()获取连接状态通知内容 LiveData<RefreshEvent>getRefreshEventLiveData()获取刷新事件 LiveData voidclearAllNotification()voidsetChannelId(String channelId)-
-
Method Detail
-
getConversationList
void getConversationList(boolean loadMore, boolean isEventManual)
从本地数据库获取会话列表。 此处借鉴前端的函数节流思想,在 REFRESH_INTERVAL 时间内,丢弃掉其它触发,只做一次执行。 以便提高接受大量消息时的刷新性能。
- Parameters:
loadMore- 是否根据上次同步的时间戳拉取更多会话。 false: 从数据库拉取最新 N 条会话。true: 根据 UI 上最后一条会话的时间戳,继续拉取之前的 N 条会话。isEventManual- 是否是用还手动触发的刷新获取,手动触发的需要主动关闭下
-
getConversationListLiveData
MediatorLiveData<List<BaseUiConversation>> getConversationListLiveData()
-
getNoticeContentLiveData
LiveData<NoticeContent> getNoticeContentLiveData()
获取连接状态通知内容
-
getRefreshEventLiveData
LiveData<RefreshEvent> getRefreshEventLiveData()
获取刷新事件 LiveData
- Returns:
刷新事件
-
clearAllNotification
void clearAllNotification()
-
setChannelId
void setChannelId(String channelId)
-
-
-
-