This commit is contained in:
18401019693 2022-07-27 18:48:22 +08:00
parent 28efafcd44
commit 8b9d10ca92
2 changed files with 43 additions and 15 deletions

View File

@ -28,32 +28,47 @@
</RelativeLayout> </RelativeLayout>
<TextView <LinearLayout
android:id="@+id/rc_conversation_title" android:id="@+id/rc_conversation_linear"
style="@style/TextStyle.Alignment"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginTop="@dimen/rc_margin_size_16" android:layout_marginTop="@dimen/rc_margin_size_16"
android:layout_marginEnd="@dimen/rc_margin_size_12" android:layout_marginEnd="@dimen/rc_margin_size_12"
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_date"
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl"
android:gravity="center_vertical"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/rc_conversation_title"
style="@style/TextStyle.Alignment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:text="张三" android:text="张三"
android:textColor="@color/rc_text_main_color" android:textColor="@color/rc_text_main_color"
android:textSize="16sp" android:textSize="16sp" />
app:layout_constraintEnd_toStartOf="@+id/rc_conversation_date"
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl" <ImageView
app:layout_constraintTop_toTopOf="parent" /> android:id="@+id/img_new"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_marginStart="3dp"
android:visibility="visible" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_marginStart="15dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:gravity="center_vertical" android:gravity="center_vertical"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl" app:layout_constraintStart_toEndOf="@+id/rc_conversation_portrait_rl"
app:layout_constraintTop_toBottomOf="@+id/rc_conversation_title"> app:layout_constraintTop_toBottomOf="@+id/rc_conversation_linear">
<ImageView <ImageView
android:id="@+id/rc_conversation_read_receipt" android:id="@+id/rc_conversation_read_receipt"
@ -129,13 +144,12 @@
app:srcCompat="@drawable/rc_no_disturb" /> app:srcCompat="@drawable/rc_no_disturb" />
<View <View
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="0.5dp" android:layout_height="0.5dp"
android:layout_marginTop="71.5dp" android:layout_marginTop="71.5dp"
android:background="@color/rc_divider_color" android:background="@color/rc_divider_color"
app:layout_constraintStart_toStartOf="@id/rc_conversation_title" app:layout_constraintStart_toStartOf="@id/rc_conversation_linear"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,12 +1,14 @@
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.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.yunbao.common.glide.ImgLoader; import com.google.gson.Gson;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.main.R; import com.yunbao.main.R;
import java.util.List; import java.util.List;
@ -14,11 +16,13 @@ import java.util.List;
import io.rong.imkit.config.RongConfigCenter; 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.userinfo.RongUserInfoManager;
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.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.imlib.model.UserInfo;
import io.rong.message.RecallNotificationMessage; import io.rong.message.RecallNotificationMessage;
/** /**
@ -46,10 +50,20 @@ public class PDLiveCustomConversationProvider extends BaseConversationProvider {
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_conversation_read_receipt); 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); ImageView conversationUnread = holder.itemView.findViewById(com.yunbao.live.R.id.rc_conversation_unread_bg);
if (conversationUnread!=null){ ImageView imgNew = holder.itemView.findViewById(com.yunbao.live.R.id.img_new);
if (conversationUnread != null) {
Glide.with(holder.getContext()).asDrawable().load(R.mipmap.rc_unread_count_bg_normal).into(conversationUnread); Glide.with(holder.getContext()).asDrawable().load(R.mipmap.rc_unread_count_bg_normal).into(conversationUnread);
} }
if (imgNew != null) {
String targetId = uiConversation.mCore.getTargetId();
UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(targetId);
if (userInfo != null && !TextUtils.isEmpty(userInfo.getExtra())) {
IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class);
if (model != null && TextUtils.equals(model.getIsAdmin(), "1"))
Glide.with(holder.getContext()).asDrawable().load("https://qny.shayucm.com/Instructors.png").into(imgNew);
}
}
readReceipt.setVisibility(View.VISIBLE); readReceipt.setVisibility(View.VISIBLE);
if (RongConfigCenter.featureConfig().isReadReceiptConversationType(Conversation.ConversationType.PRIVATE) && if (RongConfigCenter.featureConfig().isReadReceiptConversationType(Conversation.ConversationType.PRIVATE) &&
uiConversation.mCore.getSenderUserId().equals(RongIMClient.getInstance().getCurrentUserId()) && uiConversation.mCore.getSenderUserId().equals(RongIMClient.getInstance().getCurrentUserId()) &&