This commit is contained in:
18401019693 2022-07-27 13:18:32 +08:00
parent 133e45bc63
commit 838ae0815b
7 changed files with 31 additions and 11 deletions

View File

@ -124,8 +124,7 @@ public class IMLoginManager extends BaseCacheManager {
* 退出登录
*/
public void logout() {
//添加融云连接状态监听
RongcloudIMManager.removeIMStatusListener();
//删除用户登录信息
deleteByKey(KEY_USER_INFO);
//用户对象置空

View File

@ -156,9 +156,6 @@ public class RongcloudIMManager {
RongIM.setConnectionStatusListener(connectionStatusListener);
}
public static void removeIMStatusListener() {
RongIM.setConnectionStatusListener(null);
}
/**
* 监听 IM 连接状态可根据连接状态进行不同业务处理

View File

@ -87,10 +87,10 @@
<ImageView
android:id="@+id/rc_conversation_unread_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerInParent="true"
app:srcCompat="@mipmap/rc_unread_count_bg_normal" />
app:srcCompat="@drawable/rc_unread_count_bg_normal" />
<TextView
android:id="@+id/rc_conversation_unread_count"

View File

@ -24,11 +24,13 @@ import com.yunbao.main.activity.PDLiveConversationListActivity;
import com.yunbao.main.dialog.ConversationPopuwWindow;
import com.yunbao.main.utils.PDLiveCustomConversationProvider;
import com.yunbao.main.utils.PDLiveMessageProcessor;
import com.yunbao.main.utils.PDSightMessageItemProvider;
import io.rong.imkit.RongIM;
import io.rong.imkit.config.ConversationListBehaviorListener;
import io.rong.imkit.config.RongConfigCenter;
import io.rong.imkit.conversation.extension.RongExtensionManager;
import io.rong.imkit.conversation.messgelist.provider.SightMessageItemProvider;
import io.rong.imkit.conversationlist.model.BaseUiConversation;
import io.rong.imkit.conversationlist.provider.PrivateConversationProvider;
import io.rong.imkit.userinfo.RongUserInfoManager;
@ -59,6 +61,8 @@ public class ConversationIMListManager {
providerManager.replaceProvider(PrivateConversationProvider.class, new PDLiveCustomConversationProvider());
//注册小视频模块
RongExtensionManager.getInstance().registerExtensionModule(new SightExtensionModule());
//自定义小视频消息模板
RongConfigCenter.conversationConfig().replaceMessageProvider(SightMessageItemProvider.class, new PDSightMessageItemProvider());
//会话列表监听事件
RongIM.setConversationListBehaviorListener(listener);
}

View File

@ -5,6 +5,8 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.main.R;
import java.util.List;
@ -43,6 +45,10 @@ public class PDLiveCustomConversationProvider extends BaseConversationProvider {
//根据业务需要自定义处理
super.bindViewHolder(holder, uiConversation, position, list, listener);
ImageView readReceipt = holder.itemView.findViewById(com.yunbao.live.R.id.rc_conversation_read_receipt);
ImageView conversationUnread = holder.itemView.findViewById(com.yunbao.live.R.id.rc_conversation_unread_bg);
if (conversationUnread!=null){
Glide.with(holder.getContext()).asDrawable().load(R.mipmap.rc_unread_count_bg_normal).into(conversationUnread);
}
readReceipt.setVisibility(View.VISIBLE);
if (RongConfigCenter.featureConfig().isReadReceiptConversationType(Conversation.ConversationType.PRIVATE) &&

View File

@ -0,0 +1,14 @@
package com.yunbao.main.utils;
import io.rong.imkit.conversation.messgelist.provider.SightMessageItemProvider;
/**
* 自定义小视频消息模板
*/
public class PDSightMessageItemProvider extends SightMessageItemProvider {
public PDSightMessageItemProvider() {
super();
//添加小视频已读回执
mConfig.showReadState = true;
}
}

View File

@ -54,7 +54,7 @@
<TextView
android:id="@+id/red_point"
android:layout_width="23dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_below="@id/time"
android:layout_alignParentRight="true"