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