From 5d7370e5dcaf7f5a67ff8f230e608903ea7c7c2b Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 6 Sep 2022 17:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E6=8C=87=E5=AF=BC=E5=91=98=E5=8F=AF=E4=BB=A5=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E8=BF=9B=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/imrongcloud/MessageIMManager.java | 2 +- .../activity/PDLiveConversationActivity.java | 7 ++++--- .../res/layout/rc_conversationlist_item.xml | 16 ++++++++-------- .../PDLiveCustomConversationProvider.java | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/manager/imrongcloud/MessageIMManager.java b/common/src/main/java/com/yunbao/common/manager/imrongcloud/MessageIMManager.java index 37bae9b8b..c5ff92f16 100644 --- a/common/src/main/java/com/yunbao/common/manager/imrongcloud/MessageIMManager.java +++ b/common/src/main/java/com/yunbao/common/manager/imrongcloud/MessageIMManager.java @@ -200,7 +200,7 @@ public class MessageIMManager { if (!TextUtils.isEmpty(userInfo.getExtra())) { IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class); long userId = IMLoginManager.get(context).getUserInfo().getId(); - if (!TextUtils.equals(model.getIsAdmin(), "1") && userId != model.getId()) { + if (userId != model.getId()) { RouteUtil.forwardUserHome(mContext, userInfo.getUserId(), 0); } else if (userId == model.getId()) { RouteUtil.forwardUserHome(mContext, userInfo.getUserId(), 2); diff --git a/live/src/main/java/com/yunbao/live/activity/PDLiveConversationActivity.java b/live/src/main/java/com/yunbao/live/activity/PDLiveConversationActivity.java index 7d1e5a2a8..dafc26dd2 100644 --- a/live/src/main/java/com/yunbao/live/activity/PDLiveConversationActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/PDLiveConversationActivity.java @@ -95,9 +95,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl private void initData() { targetId = getIntent().getStringExtra("targetId"); NoviceInstructorModel model = NoviceInstructorManager.get(this).getNoviceInstructor(); - if (model != null && !TextUtils.isEmpty(model.getMsgZdySendText())) { - inputPanel.setPresetInformation(model.getMsgZdySendText()); - } + //绑定聊天用户id inputPanel.setTargetId(targetId); //获取用户信息 @@ -108,6 +106,9 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl SearchUserBean userBean = GsonUtils.fromJson(userInfo.getExtra(), SearchUserBean.class); //新手指导员 if (!TextUtils.isEmpty(userBean.getIs_admin()) && TextUtils.equals(userBean.getIs_admin(), "1")) { + if (model != null && !TextUtils.isEmpty(model.getMsgZdySendText())) { + inputPanel.setPresetInformation(model.getMsgZdySendText()); + } isAdmin = true; imgMore.setVisibility(View.GONE); AdjustEvent adjustEvent1 = new AdjustEvent("exlgn3"); diff --git a/live/src/main/res/layout/rc_conversationlist_item.xml b/live/src/main/res/layout/rc_conversationlist_item.xml index 331e14de7..3deeab58a 100644 --- a/live/src/main/res/layout/rc_conversationlist_item.xml +++ b/live/src/main/res/layout/rc_conversationlist_item.xml @@ -3,16 +3,16 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/rc_conversation_item" android:layout_width="match_parent" - android:layout_height="123dp"> + android:layout_height="143dp"> + android:visibility="visible"> + android:layout_height="77dp" + android:visibility="gone"> @@ -237,7 +237,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" - android:layout_marginTop="41dp" + android:layout_marginTop="11dp" android:layout_marginEnd="@dimen/rc_margin_size_12" android:text="3 月 22 日" android:textColor="@color/rc_auxiliary_color" diff --git a/main/src/main/java/com/yunbao/main/utils/PDLiveCustomConversationProvider.java b/main/src/main/java/com/yunbao/main/utils/PDLiveCustomConversationProvider.java index 6142d3e55..587d9a42f 100644 --- a/main/src/main/java/com/yunbao/main/utils/PDLiveCustomConversationProvider.java +++ b/main/src/main/java/com/yunbao/main/utils/PDLiveCustomConversationProvider.java @@ -5,10 +5,15 @@ import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.RelativeLayout; + +import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.Glide; import com.google.gson.Gson; import com.yunbao.common.bean.IMLoginModel; +import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.main.R; import java.util.List; @@ -56,6 +61,16 @@ public class PDLiveCustomConversationProvider extends BaseConversationProvider { IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class); //指导员对话逻辑 if (model != null && TextUtils.equals(model.getIsAdmin(), "1")) { + RelativeLayout conversationItem = holder.getView(R.id.rc_conversation_item); + RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) conversationItem.getLayoutParams(); + params.height = DpUtil.dp2px(143); + conversationItem.setLayoutParams(params); + holder.setOnClickListener(R.id.img_administrator, new View.OnClickListener() { + @Override + public void onClick(View v) { + RouteUtil.forwardUserHome(holder.getContext(), targetId, 0); + } + }); holder.setBackgroundRes(R.id.administrator_layout, R.mipmap.img_news_instructor_bg); holder.setBackgroundRes(R.id.rc_conversation_item, R.mipmap.white_bg); holder.setVisible(R.id.rc_conversation_portrait_layout, false); @@ -75,6 +90,10 @@ public class PDLiveCustomConversationProvider extends BaseConversationProvider { holder.setText(R.id.conversation_date, RongDateUtils.getConversationListFormatDate(uiConversation.mCore.getSentTime(), holder.getContext())); } else { + View conversationItem = holder.getConvertView(); + RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) conversationItem.getLayoutParams(); + params.height = DpUtil.dp2px(72); + conversationItem.setLayoutParams(params); //非指导员按照原有视图展示 holder.setVisible(R.id.rc_conversation_portrait_layout, true); holder.setVisible(R.id.administrator_layout, false);