界面修改,指导员可以点击头像进主页
This commit is contained in:
parent
ecca0ca854
commit
5d7370e5dc
@ -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);
|
||||||
|
@ -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");
|
||||||
|
@ -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"
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user