发送状态(MessageStatusIndicator)

发送状态:MessageStatusIndicator 是 IDL 定义的跨端 UI 组件,props / events / behaviors 在各平台语义一致。本页给出契约属性、事件、渲染行为、数据源与 Android 端绑定/示例。

契约属性(props)​

属性类型必填说明
status'sending'|'sent'|'delivered'|'read'|'failed'是发送状态:sending / sent / delivered / read / failed
readCountint否已读人数
totalMembersint否群成员总数(n/m 分母)

事件​

该组件未声明事件;交互通过属性和宿主回调完成。

渲染行为​

  • sending 转圈;failed 显示重发;单聊显示已读/未读;群聊显示 n/m

数据源​

未在 IDL 声明 dataSource;由宿主从 IMLib 拉取(getConversationList / getHistoryMessages / MESSAGES / CONVERSATION 事件)。

依赖边界

组件不直连网络与数据库:会话/消息由宿主从 IMLib 拉取后传入,组件只做排序、角标、格式化与渲染。

平台绑定​

项值
公开符号 / 签名io.nipaas.imkit.widget.MessageStatusView — setSendState(state: SendState) / setReadCount(readCount: Int, totalMembers: Int) / ReadCountFormatter.format(readCount: Int, totalMembers: Int): String / onReadReceiptStateClick(context, message): …
导出列表包含—
UI 框架View 体系:Fragment + RecyclerView + XML;Provider 注册表驱动消息气泡渲染

使用示例​

Kotlin
MessageStatusView(context).apply {
    setSendState(SendState.READ)
    setReadCount(8, 12)
}
// 纯函数:ReadCountFormatter.format(readCount, totalMembers)

相关文档​