Merge remote-tracking branch 'origin/master'

This commit is contained in:
18142669586 2022-09-06 17:55:40 +08:00
commit 927e95383a
6 changed files with 43 additions and 22 deletions

View File

@ -200,7 +200,7 @@ public class MessageIMManager {
if (!TextUtils.isEmpty(userInfo.getExtra())) { if (!TextUtils.isEmpty(userInfo.getExtra())) {
IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class); IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class);
long userId = IMLoginManager.get(context).getUserInfo().getId(); 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); RouteUtil.forwardUserHome(mContext, userInfo.getUserId(), 0);
} else if (userId == model.getId()) { } else if (userId == model.getId()) {
RouteUtil.forwardUserHome(mContext, userInfo.getUserId(), 2); RouteUtil.forwardUserHome(mContext, userInfo.getUserId(), 2);

View File

@ -195,6 +195,7 @@ public class PDLIiveChatActivity extends FragmentActivity {
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
EventBus.getDefault().post(new io.rong.imlib.model.Message());
Bus.getOff(this); Bus.getOff(this);
} }

View File

@ -95,9 +95,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
private void initData() { private void initData() {
targetId = getIntent().getStringExtra("targetId"); targetId = getIntent().getStringExtra("targetId");
NoviceInstructorModel model = NoviceInstructorManager.get(this).getNoviceInstructor(); NoviceInstructorModel model = NoviceInstructorManager.get(this).getNoviceInstructor();
if (model != null && !TextUtils.isEmpty(model.getMsgZdySendText())) {
inputPanel.setPresetInformation(model.getMsgZdySendText());
}
//绑定聊天用户id //绑定聊天用户id
inputPanel.setTargetId(targetId); inputPanel.setTargetId(targetId);
//获取用户信息 //获取用户信息
@ -108,6 +106,9 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
SearchUserBean userBean = GsonUtils.fromJson(userInfo.getExtra(), SearchUserBean.class); SearchUserBean userBean = GsonUtils.fromJson(userInfo.getExtra(), SearchUserBean.class);
//新手指导员 //新手指导员
if (!TextUtils.isEmpty(userBean.getIs_admin()) && TextUtils.equals(userBean.getIs_admin(), "1")) { 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; isAdmin = true;
imgMore.setVisibility(View.GONE); imgMore.setVisibility(View.GONE);
AdjustEvent adjustEvent1 = new AdjustEvent("exlgn3"); AdjustEvent adjustEvent1 = new AdjustEvent("exlgn3");

View File

@ -1009,7 +1009,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
changeMsgView(msg2, msg);
reloadIM(); reloadIM();
} }
@ -1704,11 +1703,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} else if (i == R.id.user_guard) { } else if (i == R.id.user_guard) {
// ((LiveActivity) mContext).openUserMoreListWindow(2, true); // ((LiveActivity) mContext).openUserMoreListWindow(2, true);
((LiveActivity) mContext).openNewGuardListWindow(); ((LiveActivity) mContext).openNewGuardListWindow();
} else if (i == R.id.room_msg) { } if (i == R.id.lt_trickery) {
changeMsgView(msg, msg2);
} else if (i == R.id.room_msg_user) {
changeMsgView(msg2, msg);
} else if (i == R.id.lt_trickery) {
showTrickeryDialog(); showTrickeryDialog();
} }
@ -1799,12 +1794,17 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
@Override @Override
public void onSuccess(List<Conversation> conversations) { public void onSuccess(List<Conversation> conversations) {
if (conversations != null && !conversations.isEmpty()) { if (conversations != null && !conversations.isEmpty()) {
Conversation conversation = conversations.get(0); for (Conversation conversation : conversations) {
UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(conversation.getTargetId()); if(conversation.getUnreadMessageCount()!=0){
if (userInfo != null) { UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(conversation.getTargetId());
ImgLoader.display(mContext, userInfo.getPortraitUri().toString(), msgUserIcon); if (userInfo != null) {
ImgLoader.display(mContext, userInfo.getPortraitUri().toString(), msgUserIcon);
}
return;
}
} }
} }
changeMsgView(msg2,msg);
} }
@Override @Override

View File

@ -3,16 +3,16 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rc_conversation_item" android:id="@+id/rc_conversation_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="123dp"> android:layout_height="143dp">
<RelativeLayout <RelativeLayout
android:id="@+id/administrator_layout" android:id="@+id/administrator_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="123dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:visibility="gone"> android:visibility="visible">
<RelativeLayout <RelativeLayout
android:id="@+id/img_administrator_layout" android:id="@+id/img_administrator_layout"
@ -132,15 +132,15 @@
<RelativeLayout <RelativeLayout
android:id="@+id/rc_conversation_portrait_layout" android:id="@+id/rc_conversation_portrait_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="77dp"
android:visibility="visible"> android:visibility="gone">
<RelativeLayout <RelativeLayout
android:id="@+id/rc_conversation_portrait_rl" android:id="@+id/rc_conversation_portrait_rl"
android:layout_width="54dp" android:layout_width="54dp"
android:layout_height="54dp" android:layout_height="54dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="39dp" android:layout_marginTop="9dp"
android:layout_marginEnd="15dp"> android:layout_marginEnd="15dp">
<ImageView <ImageView
@ -164,7 +164,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="88dp" android:layout_marginStart="88dp"
android:layout_marginTop="41dp" android:layout_marginTop="11dp"
android:layout_marginEnd="@dimen/rc_margin_size_12" android:layout_marginEnd="@dimen/rc_margin_size_12"
android:gravity="center_vertical"> android:gravity="center_vertical">
@ -237,7 +237,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginTop="41dp" android:layout_marginTop="11dp"
android:layout_marginEnd="@dimen/rc_margin_size_12" android:layout_marginEnd="@dimen/rc_margin_size_12"
android:text="3 月 22 日" android:text="3 月 22 日"
android:textColor="@color/rc_auxiliary_color" android:textColor="@color/rc_auxiliary_color"

View File

@ -5,10 +5,15 @@ 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 android.widget.RelativeLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.main.R; import com.yunbao.main.R;
import java.util.List; import java.util.List;
@ -56,6 +61,16 @@ public class PDLiveCustomConversationProvider extends BaseConversationProvider {
IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class); IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class);
//指导员对话逻辑 //指导员对话逻辑
if (model != null && TextUtils.equals(model.getIsAdmin(), "1")) { 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.administrator_layout, R.mipmap.img_news_instructor_bg);
holder.setBackgroundRes(R.id.rc_conversation_item, R.mipmap.white_bg); holder.setBackgroundRes(R.id.rc_conversation_item, R.mipmap.white_bg);
holder.setVisible(R.id.rc_conversation_portrait_layout, false); 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())); holder.setText(R.id.conversation_date, RongDateUtils.getConversationListFormatDate(uiConversation.mCore.getSentTime(), holder.getContext()));
} else { } 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.rc_conversation_portrait_layout, true);
holder.setVisible(R.id.administrator_layout, false); holder.setVisible(R.id.administrator_layout, false);