This commit is contained in:
18401019693 2022-07-25 15:54:47 +08:00
parent 1007e2ab20
commit b264001a44
5 changed files with 42 additions and 33 deletions

View File

@ -151,10 +151,10 @@ dependencies {
//im //im
api 'com.tencent.imsdk:imsdk-plus:5.4.666' api 'com.tencent.imsdk:imsdk-plus:5.4.666'
api 'com.google.code.gson:gson:2.8.8' api 'com.google.code.gson:gson:2.8.8'
api 'cn.rongcloud.sdk:rtc_lib:5.2.3.2' // api 'cn.rongcloud.sdk:rtc_lib:5.2.0' //
// 5.1.2 // 5.1.2
api 'cn.rongcloud.sdk:im_lib:5.2.3.2' // api 'cn.rongcloud.sdk:im_lib:5.1.3.10' //
api 'cn.rongcloud.sdk:im_kit:5.2.3.2' // UI api 'cn.rongcloud.sdk:im_kit:5.1.3.10' // UI
api 'com.facebook.android:facebook-login:8.2.0' api 'com.facebook.android:facebook-login:8.2.0'
api 'com.facebook.android:facebook-android-sdk:[5,6)' api 'com.facebook.android:facebook-android-sdk:[5,6)'

View File

@ -47,6 +47,7 @@
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_marginStart="@dimen/rc_margin_size_12"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -55,12 +56,11 @@
app:layout_constraintTop_toBottomOf="@+id/rc_conversation_title"> app:layout_constraintTop_toBottomOf="@+id/rc_conversation_title">
<ImageView <ImageView
android:id="@+id/rc_read_receipt_new" android:id="@+id/rc_conversation_read_receipt"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="15dp" android:layout_height="15dp"
android:layout_gravity="bottom" android:layout_marginEnd="4dp"
android:layout_marginStart="15dp" android:visibility="gone" />
android:layout_marginEnd="4dp" />
<TextView <TextView
@ -127,17 +127,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/rc_no_disturb" /> app:srcCompat="@drawable/rc_no_disturb" />
<ImageView
android:id="@+id/rc_conversation_read_receipt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/rc_margin_size_2"
android:layout_marginBottom="@dimen/rc_margin_size_12"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_no_disturb"
app:layout_goneMarginRight="@dimen/rc_margin_size_12"
app:srcCompat="@drawable/rc_read_receipt" />
<View <View
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -65,7 +65,7 @@ public class PDLiveConversationListActivity extends AbsActivity {
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
mContext = this; mContext = this;
initView(); initView();
initData();
} }
/** /**
@ -165,6 +165,7 @@ public class PDLiveConversationListActivity extends AbsActivity {
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
} }
@Override @Override
@ -175,7 +176,7 @@ public class PDLiveConversationListActivity extends AbsActivity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
initData();
} }
@Override @Override
@ -186,7 +187,6 @@ public class PDLiveConversationListActivity extends AbsActivity {
@Override @Override
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
conversationListFragment.onStop();
} }

View File

@ -1,19 +1,25 @@
package com.yunbao.main.utils; package com.yunbao.main.utils;
import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.main.R;
import java.util.List; import java.util.List;
import io.rong.imkit.config.RongConfigCenter;
import io.rong.imkit.conversationlist.model.BaseUiConversation; import io.rong.imkit.conversationlist.model.BaseUiConversation;
import io.rong.imkit.conversationlist.provider.BaseConversationProvider; import io.rong.imkit.conversationlist.provider.BaseConversationProvider;
import io.rong.imkit.widget.adapter.IViewProviderListener; import io.rong.imkit.widget.adapter.IViewProviderListener;
import io.rong.imkit.widget.adapter.ViewHolder; import io.rong.imkit.widget.adapter.ViewHolder;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation; import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.Message; import io.rong.imlib.model.Message;
import io.rong.message.RecallNotificationMessage;
/** /**
* pdlive自定义会话模板 * pdlive自定义会话模板
@ -38,16 +44,29 @@ public class PDLiveCustomConversationProvider extends BaseConversationProvider {
public void bindViewHolder(ViewHolder holder, BaseUiConversation uiConversation, int position, List<BaseUiConversation> list, IViewProviderListener<BaseUiConversation> listener) { public void bindViewHolder(ViewHolder holder, BaseUiConversation uiConversation, int position, List<BaseUiConversation> list, IViewProviderListener<BaseUiConversation> listener) {
//根据业务需要自定义处理 //根据业务需要自定义处理
super.bindViewHolder(holder, uiConversation, position, list, listener); super.bindViewHolder(holder, uiConversation, position, list, listener);
ImageView readReceipt = holder.itemView.findViewById(com.yunbao.live.R.id.rc_read_receipt_new); ImageView readReceipt = holder.itemView.findViewById(com.yunbao.live.R.id.rc_conversation_read_receipt);
if (uiConversation.mCore.getLatestMessageDirection()==Message.MessageDirection.SEND) { // IMLoginModel userInfo = IMLoginManager.get(holder.getContext()).getUserInfo();
Message.SentStatus sentStatus = uiConversation.mCore.getSentStatus(); // if (String.valueOf(userInfo.getId()).equals(uiConversation.mCore.getSenderUserId())) {
if (sentStatus == Message.SentStatus.READ) { // Message.SentStatus sentStatus = uiConversation.mCore.getSentStatus();
readReceipt.setBackgroundResource(com.yunbao.live.R.mipmap.icon_messagelist_read); // if (sentStatus == Message.SentStatus.READ) {
} else { //
readReceipt.setBackgroundResource(com.yunbao.live.R.mipmap.icon_messagelist_unread); // } else {
} //
}else { // }
readReceipt.setVisibility(View.GONE); // } else {
// readReceipt.setVisibility(View.GONE);
// }
readReceipt.setVisibility(View.VISIBLE);
if (RongConfigCenter.featureConfig().isReadReceiptConversationType(Conversation.ConversationType.PRIVATE) &&
uiConversation.mCore.getSenderUserId().equals(RongIMClient.getInstance().getCurrentUserId()) &&
uiConversation.mCore.getSentStatus().getValue() == Message.SentStatus.READ.getValue() &&
!(uiConversation.mCore.getLatestMessage() instanceof RecallNotificationMessage)) {
readReceipt.setBackgroundResource(com.yunbao.live.R.mipmap.icon_messagelist_read);
} else if (uiConversation.mCore.getSenderUserId().equals(RongIMClient.getInstance().getCurrentUserId()) &&
!(uiConversation.mCore.getLatestMessage() instanceof RecallNotificationMessage)) {
readReceipt.setBackgroundResource(com.yunbao.live.R.mipmap.icon_messagelist_unread);
} else {
holder.setVisible(R.id.rc_conversation_read_receipt, false);
} }
} }
} }

View File

@ -86,7 +86,7 @@
android:layout_width="0dp" android:layout_width="0dp"
app:RCStyle="CE" app:RCStyle="CE"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="visible" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"