public class TypingMessageManager
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
static TypingMessageManager |
getInstance() |
java.util.Collection<TypingStatus> |
getTypingUserListFromConversation(Conversation.ConversationType conversationType,
java.lang.String targetId)
根据 conversationType 和 targetId 获取当前会话正在输入的用户列表
|
void |
init(android.content.Context context) |
boolean |
isShowMessageTyping() |
boolean |
onReceiveMessage(Message message)
收到输入状态消息,显示正在输入
收到其它类型消息,取消正在输入的显示
|
void |
sendTypingMessage(Conversation.ConversationType conversationType,
java.lang.String targetId,
java.lang.String typingContentType)
发送 TypingStatusMessage
为保证产品体验和网络优化,在当前用户的每个会话中,该消息发送之后,
DISAPPEAR_INTERVAL 时间间隔内不会再重复发送。 |
void |
setTypingEnd(Conversation.ConversationType conversationType,
java.lang.String targetId)
输入状态终止
|
void |
setTypingMessageStatusListener(RongIMClient.TypingStatusListener listener)
设置输入状态监听器。
|
public static TypingMessageManager getInstance()
public void init(android.content.Context context)
public boolean isShowMessageTyping()
public java.util.Collection<TypingStatus> getTypingUserListFromConversation(Conversation.ConversationType conversationType, java.lang.String targetId)
conversationType
- 会话类型targetId
- 会话 idpublic void sendTypingMessage(Conversation.ConversationType conversationType, java.lang.String targetId, java.lang.String typingContentType)
DISAPPEAR_INTERVAL
时间间隔内不会再重复发送。conversationType
- 会话类型targetId
- 会话 idtypingContentType
- message 的 objectNamepublic void setTypingEnd(Conversation.ConversationType conversationType, java.lang.String targetId)
conversationType
- 会话类型targetId
- 会话 idpublic void setTypingMessageStatusListener(RongIMClient.TypingStatusListener listener)
RongIMClient.TypingStatusListener.onTypingStatusChanged(Conversation.ConversationType, String, Collection)
对于单聊而言,当对方正在输入时,监听会触发一次;当对方不处于输入状态时,该监听还会触发一次,但是回调里上来的输入用户列表为空listener
- 输入状态监听器public boolean onReceiveMessage(Message message)
message
- 收到的消息