Class ReferenceManager
-
- All Implemented Interfaces:
public class ReferenceManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceReferenceManager.ReferenceStatusListener
-
Constructor Summary
Constructors Constructor Description ReferenceManager()
-
Method Summary
Modifier and Type Method Description static ReferenceManagergetInstance()voidsetReferenceStatusListener(ReferenceManager.ReferenceStatusListener listener)voidremoveReferenceStatusListener(ReferenceManager.ReferenceStatusListener listener)voidonInit(Context context, String appKey)voidonAttachedToExtension(Fragment fragment, RongExtension extension)voidonDetachedFromExtension()voidonReceivedMessage(Message message)List<IPluginModule>getPluginModules(ChannelType channelType)List<IEmoticonTab>getEmoticonTabs()voidonDisconnect()voidonTextChanged(Context context, ChannelType type, String targetId, int cursorPos, int count, String text)voidonSendToggleClick(Message message)MessageContentapplyReference(TextMessage textMessage)Merges the pending TextMessage with the current reference. voidonDestroy(ChannelType type, String targetId)booleanshowReferenceView(Context context, UiMessage uiMessage)Shows the reference message bar. booleanshowReferenceViewInEditMode(Context context, UiMessage uiMessage)booleanshowReferenceView(Context context, UiMessage uiMessage, boolean showKeyBoard)Shows the reference message bar. voidhideReferenceView()voidonDeleteClick(ChannelType type, String targetId, EditText editText, int cursorPos)UiMessagegetUiMessage()-
-
Method Detail
-
getInstance
static ReferenceManager getInstance()
-
setReferenceStatusListener
void setReferenceStatusListener(ReferenceManager.ReferenceStatusListener listener)
-
removeReferenceStatusListener
void removeReferenceStatusListener(ReferenceManager.ReferenceStatusListener listener)
-
onInit
void onInit(Context context, String appKey)
-
onAttachedToExtension
void onAttachedToExtension(Fragment fragment, RongExtension extension)
-
onDetachedFromExtension
void onDetachedFromExtension()
-
onReceivedMessage
void onReceivedMessage(Message message)
-
getPluginModules
List<IPluginModule> getPluginModules(ChannelType channelType)
-
getEmoticonTabs
List<IEmoticonTab> getEmoticonTabs()
-
onDisconnect
void onDisconnect()
-
onTextChanged
void onTextChanged(Context context, ChannelType type, String targetId, int cursorPos, int count, String text)
-
onSendToggleClick
void onSendToggleClick(Message message)
-
applyReference
MessageContent applyReference(TextMessage textMessage)
Merges the pending TextMessage with the current reference.
If a reference message exists (reference bar shown above the input), fills the text and MentionedInfo from textMessage into ReferenceMessage, hides the reference bar, and returns the ReferenceMessage; otherwise returns textMessage as-is.
- Parameters:
textMessage- the plain text message constructed from the input field- Returns:
a ReferenceMessage with the reference, or the original textMessage if none
-
onDestroy
void onDestroy(ChannelType type, String targetId)
-
showReferenceView
boolean showReferenceView(Context context, UiMessage uiMessage)
Shows the reference message bar.
- Parameters:
context- the contextuiMessage- the message entity- Returns:
whether the display was successful
-
showReferenceViewInEditMode
boolean showReferenceViewInEditMode(Context context, UiMessage uiMessage)
-
showReferenceView
boolean showReferenceView(Context context, UiMessage uiMessage, boolean showKeyBoard)
Shows the reference message bar.
- Parameters:
context- the contextuiMessage- the message entity- Returns:
whether the display was successful
-
hideReferenceView
void hideReferenceView()
-
onDeleteClick
void onDeleteClick(ChannelType type, String targetId, EditText editText, int cursorPos)
-
getUiMessage
UiMessage getUiMessage()
-
-
-
-