Package io.rong.imlib.typingmessage
Class TypingMessageManager
-
- All Implemented Interfaces:
public class TypingMessageManager
-
-
Method Summary
Modifier and Type Method Description static TypingMessageManagergetInstance()voidinit(Context context)booleanisShowMessageTyping()synchronized Collection<TypingStatus>getTypingUserListFromConversation(ConversationType conversationType, String targetId, String channelId)根据 conversationType 和 targetId 获取当前会话正在输入的用户列表 voidsendTypingMessage(ConversationType conversationType, String targetId, String channelId, String typingContentType)发送 TypingStatusMessage 为保证产品体验和网络优化,在当前用户的每个会话中,该消息发送之后, DISAPPEAR_INTERVAL时间间隔内不会再重复发送。 voidsetTypingEnd(ConversationType conversationType, String targetId, String channelId)输入状态终止 voidsetTypingMessageStatusListener(IRongCoreListener.TypingStatusListener listener)设置输入状态监听器。当输入状态发生变化时,会回调onTypingStatusChanged 对于单聊而言,当对方正在输入时,监听会触发一次;当对方不处于输入状态时,该监听还会触发一次,但是回调里上来的输入用户列表为空 voidsetConversationChannelTypingStatusListener(IConversationChannelListener.ConversationChannelTypingStatusListener listener)设置输入状态监听器。 当输入状态发生变化时,回调 onTypingStatusChanged (Conversation. booleanonReceiveMessage(Message message, boolean isPersisted)收到输入状态消息,显示正在输入 收到其它类型消息,取消正在输入的显示 -
-
Method Detail
-
getInstance
static TypingMessageManager getInstance()
-
init
void init(Context context)
-
isShowMessageTyping
boolean isShowMessageTyping()
-
getTypingUserListFromConversation
synchronized Collection<TypingStatus> getTypingUserListFromConversation(ConversationType conversationType, String targetId, String channelId)
根据 conversationType 和 targetId 获取当前会话正在输入的用户列表
- Parameters:
conversationType- 会话类型targetId- 会话 idchannelId- 消息所属会话的业务标识- Returns:
当前会话正在输入的用户列表
-
sendTypingMessage
void sendTypingMessage(ConversationType conversationType, String targetId, String channelId, String typingContentType)
发送 TypingStatusMessage 为保证产品体验和网络优化,在当前用户的每个会话中,该消息发送之后, DISAPPEAR_INTERVAL时间间隔内不会再重复发送。
- Parameters:
conversationType- 会话类型targetId- 会话 idchannelId- 消息所属会话的业务标识typingContentType- message 的 objectName
-
setTypingEnd
void setTypingEnd(ConversationType conversationType, String targetId, String channelId)
输入状态终止
- Parameters:
conversationType- 会话类型targetId- 会话 idchannelId- 消息所属会话的业务标识
-
setTypingMessageStatusListener
void setTypingMessageStatusListener(IRongCoreListener.TypingStatusListener listener)
设置输入状态监听器。当输入状态发生变化时,会回调onTypingStatusChanged 对于单聊而言,当对方正在输入时,监听会触发一次;当对方不处于输入状态时,该监听还会触发一次,但是回调里上来的输入用户列表为空
- Parameters:
listener- 输入状态监听器
-
setConversationChannelTypingStatusListener
void setConversationChannelTypingStatusListener(IConversationChannelListener.ConversationChannelTypingStatusListener listener)
设置输入状态监听器。
当输入状态发生变化时,回调 onTypingStatusChanged (Conversation.ConversationType, String, String, Collection)} 对于单聊而言,当对方正在输入时,监听会触发一次;当对方不处于输入状态时,该监听还会触发一次,但回调里输入用户列表为空。
- Parameters:
listener- 输入状态监听器
-
onReceiveMessage
boolean onReceiveMessage(Message message, boolean isPersisted)
收到输入状态消息,显示正在输入 收到其它类型消息,取消正在输入的显示
- Parameters:
message- 收到的消息- Returns:
返回 true 表明是 TypingMessage,RongCoreClient 里不需要再做进一步处理 返回 false 表明是其它类型消息,RongCoreClient 里还需要下一步处理
-
-
-
-