Class UltraGroupConversationListViewModel
-
- All Implemented Interfaces:
-
io.rong.imkit.userinfo.RongUserInfoManager.UserDataObserver
public class UltraGroupConversationListViewModel extends ConversationListViewModel
-
-
Field Summary
Fields Modifier and Type Field Description protected Array<Conversation.ConversationType>mSupportedTypesprotected intmSizePerPageprotected longmLastSyncTimeprotected ApplicationmApplicationprotected CopyOnWriteArrayList<BaseUiConversation>mUiConversationListprotected MediatorLiveData<List<BaseUiConversation>>mConversationListLiveDataprotected DataProcessor<Conversation>mDataFilterprotected HandlermHandlerprotected Array<Conversation.ConversationType>mSupportedTypesprotected intmSizePerPageprotected intmPageLimitprotected booleanmTopPriorityprotected ApplicationmApplicationprotected CopyOnWriteArrayList<BaseUiConversation>mUiConversationListprotected MediatorLiveData<List<BaseUiConversation>>mConversationListLiveDataprotected DataProcessor<Conversation>mDataFilterprotected final HandlerThreadworkThreadprotected final HandlermHandler
-
Constructor Summary
Constructors Constructor Description UltraGroupConversationListViewModel(Application application)
-
Method Summary
Modifier and Type Method Description voidgetConversationList(boolean loadMore, boolean isEventManual)从本地数据库获取会话列表。 此处借鉴前端的函数节流思想,在 REFRESH_INTERVAL 时间内,丢弃掉其它触发,只做一次执行。 以便提高接受大量消息时的刷新性能。 BaseUiConversationfindConversationFromList(Conversation.ConversationType conversationType, String targetId, String channelId, boolean isGathered)BaseUiConversationfindConversationFromList(Conversation.ConversationType conversationType, String targetId, boolean isGathered)voidsort()voidupdateByConversation(Conversation conversation)booleanisSupported(Conversation.ConversationType type)voidonCleared()MediatorLiveData<List<BaseUiConversation>>getConversationListLiveData()LiveData<NoticeContent>getNoticeContentLiveData()获取连接状态通知内容 LiveData<Event.RefreshEvent>getRefreshEventLiveData()获取刷新事件 LiveData voidclearAllNotification()voidsetChannelId(String channelId)-
Methods inherited from class io.rong.imkit.conversationlist.viewmodel.ConversationListViewModel
getConversationList, getOnlineStatusUserIds, isTopPriority, onGroupUpdate, onGroupUserInfoUpdate, onResume, onUserUpdate, refreshConversationList, sendRefreshEvent -
Methods inherited from class androidx.lifecycle.AndroidViewModel
getApplication -
Methods inherited from class io.rong.imkit.userinfo.RongUserInfoManager.UserDataObserver
onGroupUpdate -
Methods inherited from class androidx.lifecycle.ViewModel
onCleared -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getConversationList
void getConversationList(boolean loadMore, boolean isEventManual)
从本地数据库获取会话列表。 此处借鉴前端的函数节流思想,在 REFRESH_INTERVAL 时间内,丢弃掉其它触发,只做一次执行。 以便提高接受大量消息时的刷新性能。
- Parameters:
loadMore- 是否根据上次同步的时间戳拉取更多会话。 false: 从数据库拉取最新 N 条会话。true: 根据 UI 上最后一条会话的时间戳,继续拉取之前的 N 条会话。isEventManual- 是否是用还手动触发的刷新获取,手动触发的需要主动关闭下
-
findConversationFromList
BaseUiConversation findConversationFromList(Conversation.ConversationType conversationType, String targetId, String channelId, boolean isGathered)
-
findConversationFromList
BaseUiConversation findConversationFromList(Conversation.ConversationType conversationType, String targetId, boolean isGathered)
-
sort
void sort()
-
updateByConversation
void updateByConversation(Conversation conversation)
-
isSupported
boolean isSupported(Conversation.ConversationType type)
-
onCleared
void onCleared()
-
getConversationListLiveData
MediatorLiveData<List<BaseUiConversation>> getConversationListLiveData()
-
getNoticeContentLiveData
LiveData<NoticeContent> getNoticeContentLiveData()
获取连接状态通知内容
-
getRefreshEventLiveData
LiveData<Event.RefreshEvent> getRefreshEventLiveData()
获取刷新事件 LiveData
- Returns:
刷新事件
-
clearAllNotification
void clearAllNotification()
-
setChannelId
void setChannelId(String channelId)
-
-
-
-