public class RichContentMessageItemProvider extends BaseMessageItemProvider<RichContentMessage>
BaseMessageItemProvider.MessageViewHolder
mConfig
Constructor and Description |
---|
RichContentMessageItemProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
bindMessageContentViewHolder(ViewHolder holder,
ViewHolder parentHolder,
RichContentMessage richContentMessage,
UiMessage uiMessage,
int position,
java.util.List<UiMessage> list,
IViewProviderListener<UiMessage> listener)
设置消息视图里各 view 的值
|
android.text.Spannable |
getSummarySpannable(android.content.Context context,
RichContentMessage richContentMessage)
在会话列表页某条会话最后一条消息为该类型消息时,会话里需要展示的内容。
比如: 图片消息在会话里需要展示为"图片",那返回对应的字符串资源即可。
|
protected boolean |
isMessageViewType(MessageContent messageContent)
根据消息内容,判断是否为本模板需要展示的消息类型
|
protected ViewHolder |
onCreateMessageContentViewHolder(android.view.ViewGroup parent,
int viewType)
创建 ViewHolder
|
protected boolean |
onItemClick(ViewHolder holder,
RichContentMessage richContentMessage,
UiMessage uiMessage,
int position,
java.util.List<UiMessage> list,
IViewProviderListener<UiMessage> listener) |
bindViewHolder, isItemViewType, isSummaryType, onCreateViewHolder, onItemLongClick, showReadReceiptRequest, showSummaryWithName
protected ViewHolder onCreateMessageContentViewHolder(android.view.ViewGroup parent, int viewType)
BaseMessageItemProvider
onCreateMessageContentViewHolder
in class BaseMessageItemProvider<RichContentMessage>
parent
- 父 ViewGroupviewType
- 视图类型protected void bindMessageContentViewHolder(ViewHolder holder, ViewHolder parentHolder, RichContentMessage richContentMessage, UiMessage uiMessage, int position, java.util.List<UiMessage> list, IViewProviderListener<UiMessage> listener)
BaseMessageItemProvider
bindMessageContentViewHolder
in class BaseMessageItemProvider<RichContentMessage>
holder
- ViewHolderparentHolder
- 父布局的 ViewHolderrichContentMessage
- 此展示模板对应的消息uiMessage
- UiMessage
position
- 消息位置list
- 列表listener
- ViewModel 的点击事件监听器。如果某个子 view 的点击事件需要 ViewModel 处理,可通过此监听器回调。protected boolean onItemClick(ViewHolder holder, RichContentMessage richContentMessage, UiMessage uiMessage, int position, java.util.List<UiMessage> list, IViewProviderListener<UiMessage> listener)
onItemClick
in class BaseMessageItemProvider<RichContentMessage>
holder
- ViewHolderrichContentMessage
- 自定义消息uiMessage
- UiMessage
position
- 位置list
- 列表数据listener
- ViewModel 的点击事件监听器。如果某个子 view 的点击事件需要 ViewModel 处理,可通过此监听器回调。protected boolean isMessageViewType(MessageContent messageContent)
BaseMessageItemProvider
isMessageViewType
in class BaseMessageItemProvider<RichContentMessage>
messageContent
- 消息内容public android.text.Spannable getSummarySpannable(android.content.Context context, RichContentMessage richContentMessage)
IConversationSummaryProvider
context
- 上下文richContentMessage
- 消息内容