# MessageViewModel

public class MessageViewModel

## Constructors

MessageViewModel
Link copied to clipboard
public void MessageViewModel(Application application)

## Properties

DEFAULT_COUNT
Link copied to clipboard
public final static int DEFAULT_COUNT
DEFAULT_REMOTE_COUNT
Link copied to clipboard
public final static int DEFAULT_REMOTE_COUNT
SHOW_UNREAD_MESSAGE_COUNT
Link copied to clipboard
public final static int SHOW_UNREAD_MESSAGE_COUNT
writePermission
Link copied to clipboard
public static Array<String> writePermission

## Functions

addUnreadNewMessage
Link copied to clipboard
public void addUnreadNewMessage(UiMessage message)
bindConversation
Link copied to clipboard
public void bindConversation(ConversationIdentifier conversationIdentifier, Bundle bundle)
cleanUnreadNewCount
Link copied to clipboard
public void cleanUnreadNewCount()
cleanUnreadStatus
Link copied to clipboard
public void cleanUnreadStatus()
清理未读状态
enterEditState
Link copied to clipboard
public void enterEditState()
启动编辑模式
executePageEvent
Link copied to clipboard
public void executePageEvent(PageEvent pageEvent)
executePostPageEvent
Link copied to clipboard
public void executePostPageEvent(PageEvent pageEvent)
异步线程切换到主线程执行
filterMessageToHideNewMessageBar
Link copied to clipboard
public boolean filterMessageToHideNewMessageBar(UiMessage uiMessage)
过滤只存储不计数消息，使其不显示聊天页面右下角新消息气泡UI.
findPositionByMessageId
Link copied to clipboard
public int findPositionByMessageId(int messageId)
findPositionBySendTime
Link copied to clipboard
public int findPositionBySendTime(long sentTime)
findUIMessage
Link copied to clipboard
public UiMessage findUIMessage(int messageId)
public UiMessage findUIMessage(String messageUId)
forwardMessage
Link copied to clipboard
public void forwardMessage(Intent data)
getConversationIdentifier
Link copied to clipboard
public ConversationIdentifier getConversationIdentifier()
getCurChannelId
Link copied to clipboard
public String getCurChannelId()
getCurConversationType
Link copied to clipboard
public ConversationType getCurConversationType()
getCurTargetId
Link copied to clipboard
public String getCurTargetId()
getFirstUnreadMessage
Link copied to clipboard
public Message getFirstUnreadMessage()
getHistoryMessageUnreadLiveData
Link copied to clipboard
public LiveData<Integer> getHistoryMessageUnreadLiveData()
getLoadMoreSentTime
Link copied to clipboard
public long getLoadMoreSentTime()
getMessageReadReceiptInfoV5
Link copied to clipboard
public void getMessageReadReceiptInfoV5(List<Message> messages)
查询消息的已读回执V5信息，查询后绑定到UIMessage再刷新一次。
getNewMentionMessageUnreadLiveData
Link copied to clipboard
public LiveData<Integer> getNewMentionMessageUnreadLiveData()
getNewMessageUnreadLiveData
Link copied to clipboard
public MediatorLiveData<Integer> getNewMessageUnreadLiveData()
getNewUnReadMentionMessages
Link copied to clipboard
public List<Message> getNewUnReadMentionMessages()
getNewUnReadMessages
Link copied to clipboard
public List<UiMessage> getNewUnReadMessages()
getPageEventLiveData
Link copied to clipboard
public MediatorLiveData<PageEvent> getPageEventLiveData()
getRefreshMessageId
Link copied to clipboard
public int getRefreshMessageId()
getRefreshSentTime
Link copied to clipboard
public long getRefreshSentTime()
getSelectedUiMessages
Link copied to clipboard
public List<UiMessage> getSelectedUiMessages()
getUiMessageLiveData
Link copied to clipboard
public LiveData<List<UiMessage>> getUiMessageLiveData()
getUiMessages
Link copied to clipboard
public List<UiMessage> getUiMessages()
hideHistoryBar
Link copied to clipboard
public void hideHistoryBar()
hideNewMentionMessageBar
Link copied to clipboard
public void hideNewMentionMessageBar()
initTranslationListener
Link copied to clipboard
public void initTranslationListener()
IsEditStatusLiveData
Link copied to clipboard
public MediatorLiveData<Boolean> IsEditStatusLiveData()
isForegroundActivity
Link copied to clipboard
public boolean isForegroundActivity()
isHistoryState
Link copied to clipboard
public boolean isHistoryState()
isInitMentionedMessageFinish
Link copied to clipboard
public boolean isInitMentionedMessageFinish()
isInitUnreadMessageFinish
Link copied to clipboard
public boolean isInitUnreadMessageFinish()
isNormalState
Link copied to clipboard
public boolean isNormalState()
isRemoteMessageLoadFinish
Link copied to clipboard
public boolean isRemoteMessageLoadFinish()
isScrollToBottom
Link copied to clipboard
public boolean isScrollToBottom()
mapUIMessage
Link copied to clipboard
public UiMessage mapUIMessage(Message message)
newMentionMessageBarClick
Link copied to clipboard
public void newMentionMessageBarClick()
newMessageBarClick
Link copied to clipboard
public void newMessageBarClick()
onAudioClick
Link copied to clipboard
public void onAudioClick(UiMessage uiMessage)
onBackPressed
Link copied to clipboard
public boolean onBackPressed()
onClearMessages
Link copied to clipboard
public void onClearMessages(ClearEvent event)
onDeleteMessage
Link copied to clipboard
public void onDeleteMessage(DeleteEvent event)
onDestroy
Link copied to clipboard
public void onDestroy()
onDownloadMessage
Link copied to clipboard
public void onDownloadMessage(DownloadEvent event)
onExistUnreadMessage
Link copied to clipboard
public void onExistUnreadMessage(Conversation conversation, int unreadMessageCount)
onGetHistoryMessage
Link copied to clipboard
public void onGetHistoryMessage(List<Message> messages)
public void onGetHistoryMessage(List<Message> messages, boolean isHasMoreMsg)
初始化加载本地消息 下拉加载历史消息
onGroupUpdate
Link copied to clipboard
public void onGroupUpdate(Group group)
onGroupUserInfoUpdate
Link copied to clipboard
public void onGroupUserInfoUpdate(GroupUserInfo groupUserInfo)
onInsertMessage
Link copied to clipboard
public void onInsertMessage(InsertEvent event)
onItemClick
Link copied to clipboard
public void onItemClick(UiMessage uiMessage)
onItemLongClick
Link copied to clipboard
public boolean onItemLongClick(UiMessage uiMessage)
onItemViewVisible
Link copied to clipboard
public void onItemViewVisible(boolean visible, UiMessage data)
消息Item曝光，发送已读回执
onLoadMore
Link copied to clipboard
public void onLoadMore()
onLoadMoreMessage
Link copied to clipboard
public void onLoadMoreMessage(List<Message> messages)
上拉加载更多消息
onPause
Link copied to clipboard
public void onPause()
onReadReceiptRequestClick
Link copied to clipboard
public void onReadReceiptRequestClick(UiMessage uiMessage)
onReadReceiptStateClick
Link copied to clipboard
public void onReadReceiptStateClick(UiMessage uiMessage)
onRecallEvent
Link copied to clipboard
public void onRecallEvent(RecallEvent event)
onReEditClick
Link copied to clipboard
public void onReEditClick(UiMessage uiMessage)
onRefresh
Link copied to clipboard
public void onRefresh()
onRefreshEvent
Link copied to clipboard
public void onRefreshEvent(RefreshEvent event)
onReloadMessage
Link copied to clipboard
public void onReloadMessage(List<Message> messages)
normal状态点击历史消息bar history状态点击新消息bar
onResume
Link copied to clipboard
public void onResume()
onScrolled
Link copied to clipboard
public void onScrolled(RecyclerView recyclerView, int dx, int dy, int headerCount, int footerCount)
onSendMediaMessage
Link copied to clipboard
public void onSendMediaMessage(SendMediaEvent event)
onSendMessage
Link copied to clipboard
public void onSendMessage(SendEvent event)
onStop
Link copied to clipboard
public void onStop()
onTranslationResult
Link copied to clipboard
public void onTranslationResult(int code, RCTranslationResultWrapper result)
onUserPortraitClick
Link copied to clipboard
public void onUserPortraitClick(Context context, ConversationType conversationType, UserInfo userInfo, String targetId)
onUserPortraitLongClick
Link copied to clipboard
public boolean onUserPortraitLongClick(Context context, ConversationType conversationType, UserInfo userInfo, String targetId)
onUserUpdate
Link copied to clipboard
public void onUserUpdate(UserInfo user)
onViewClick
Link copied to clipboard
public void onViewClick(int clickType, UiMessage data)
onViewLongClick
Link copied to clipboard
public boolean onViewLongClick(int clickType, UiMessage data)
onWarnClick
Link copied to clipboard
public void onWarnClick(UiMessage uiMessage)
processHistoryDividerMessage
Link copied to clipboard
public void processHistoryDividerMessage()
processNewMessageUnread
Link copied to clipboard
public void processNewMessageUnread(boolean isMainThread)
quitEditMode
Link copied to clipboard
public void quitEditMode()
退出编辑模式
refreshAllMessage
Link copied to clipboard
public void refreshAllMessage()
public void refreshAllMessage(boolean force)
refreshSingleMessage
Link copied to clipboard
public void refreshSingleMessage(UiMessage uiMessage)
removeUIMessage
Link copied to clipboard
public void removeUIMessage(int messageId)
reSendMessage
Link copied to clipboard
public void reSendMessage(Message message)
setFirstUnreadMessage
Link copied to clipboard
public void setFirstUnreadMessage(Message firstUnreadMessage)
setInitMentionedMessageFinish
Link copied to clipboard
public void setInitMentionedMessageFinish(boolean initMentionedMessageFinish)
setInitUnreadMessageFinish
Link copied to clipboard
public void setInitUnreadMessageFinish(boolean initUnreadMessageFinish)
setNewUnReadMentionMessages
Link copied to clipboard
public void setNewUnReadMentionMessages(List<Message> newUnReadMentionMessages)
setRemoteMessageLoadFinish
Link copied to clipboard
public void setRemoteMessageLoadFinish(boolean remoteMessageLoadFinish)
setScrollToBottom
Link copied to clipboard
public void setScrollToBottom(boolean scrollToBottom)
showHistoryBar
Link copied to clipboard
public void showHistoryBar(int unreadMessageCount)
showNewMentionMessageBar
Link copied to clipboard
public void showNewMentionMessageBar(int unreadMessageCount)
stopPlay
Link copied to clipboard
public void stopPlay()
unInitTranslationListener
Link copied to clipboard
public void unInitTranslationListener()
unreadBarClick
Link copied to clipboard
public void unreadBarClick()
updateMentionMessage
Link copied to clipboard
public void updateMentionMessage(Message message)
updateNewMentionMessageUnreadBar
Link copied to clipboard
public void updateNewMentionMessageUnreadBar()