常用的聊天软件都是由聊天窗口、会话列表等几个基本的界面组成。TUIKit 提供一套基本的 UI 实现,简化 IM SDK 的集成过程,只需几行代码即可在项目中使用 IM SDK 提供通信功能。
说明:更多实操教学视频请参见:极速集成 TUIKit(Android)。
会话列表 ConversationLayout 继承自 LinearLayout,其数据的获取、同步、展示以及交互均已在 TUIKit 内部封装,会话列表 UI 的使用与 Android 的普通 View 一样方便。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.tencent.qcloud.tim.uikit.modules.conversation.ConversationLayout
android:id="@+id/conversation_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
// 从布局文件中获取会话列表面板
ConversationLayout conversationLayout = findViewById(R.id.conversation_layout);
// 初始化聊天面板
conversationLayout.initDefault();
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.tencent.qcloud.tim.uikit.modules.chat.ChatLayout
android:id="@+id/chat_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
// 从布局文件中获取聊天面板 ChatLayout chatLayout = findViewById(R.id.chat_layout); // 单聊面板的默认 UI 和交互初始化 chatLayout.initDefault(); // 传入 ChatInfo 的实例,这个实例必须包含必要的聊天信息,一般从调用方传入 // 构造 mChatInfo 可参考 StartC2CChatActivity.java 的方法 startConversation chatLayout.setChatInfo(mChatInfo);
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.tencent.qcloud.tim.uikit.modules.contact.ContactLayout
android:id="@+id/contact_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
// 从布局文件中获取通讯录面板
ContactLayout contactLayout = findViewById(R.id.contact_layout);
// 通讯录面板的默认 UI 和交互初始化
contactLayout.initDefault();
所有系统事件均可以通过云监控配置报警规则,当事件发生时会及时通知您。 前提条...
操作场景 当无需使用VPN网络、需要释放网络资源时,可删除VPN连接。 当购买的VPN...
本文转载自微信公众号「问其」,作者陈少文 。转载本文请联系问其公众号。 1. 去...
免责声明: 本文档可能包含第三方产品信息,该信息仅供参考。阿里云对第三方产品...
Logtail运行时依赖一系列的配置文件并产生部分信息记录文件,本文档介绍常见文件...
问题描述 在连接云手机时,建立SSH隧道报“Permission denied”的错误,具体如 ...
简介 Merkle–Damg?rd结构简称为MD结构 主要用在hash算法中抵御碰撞攻击。这个结...
刚接触大数据一个月,把一些基本知识,总体架构记录一下,感觉坑很多,要学习的...
作者 | EF中国项目组 2021 EdgeX中国挑战赛自7月12日开幕以来 得到各方积极响应 ...
Job和CronJob是负责批量处理短暂的一次性任务(short lived one-off tasks),即...