跳转七日留存:新增点击打开用户卡片,新增@用户名颜色

This commit is contained in:
zlzw 2023-09-05 17:59:29 +08:00
parent 84d4423069
commit 0c5ef0befe
3 changed files with 16 additions and 2 deletions

View File

@ -394,10 +394,13 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1); new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
mTextView.setText(bean.getContent()); mTextView.setText(bean.getContent());
} }
} else if (bean.getType() == LiveChatBean.SYSTEM2 || bean.getType()==TYPE_TO_USER_MSG) { } else if (bean.getType() == LiveChatBean.SYSTEM2 ) {
mTextView.setTextColor(Color.parseColor("#ffffff")); mTextView.setTextColor(Color.parseColor("#ffffff"));
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1); new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
mTextView.setText(bean.getContent()); mTextView.setText(bean.getContent());
}else if(bean.getType()==TYPE_TO_USER_MSG){
mTextView.setText(Html.fromHtml("<font color='#FBEABF'>@" + bean.getUserNiceName() + "</font> &nbsp;" + bean.getContent()));
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
} }
// else if (bean.getType() == -1) {//自动消息关注 // else if (bean.getType() == -1) {//自动消息关注
// boolean isContains = false; // boolean isContains = false;

View File

@ -54,6 +54,7 @@ public class LiveChatBean {
private String hot_card; private String hot_card;
private MsgModel msgModel = new MsgModel();//自定义消息体 private MsgModel msgModel = new MsgModel();//自定义消息体
private String giftName; private String giftName;
private String toUid;
public String getGiftName() { public String getGiftName() {
return giftName; return giftName;
@ -64,6 +65,14 @@ public class LiveChatBean {
return this; return this;
} }
public String getToUid() {
return toUid;
}
public void setToUid(String toUid) {
this.toUid = toUid;
}
private AiAutomaticSpeechModel aiAutomaticSpeechModel = new AiAutomaticSpeechModel();//机器人消息体 private AiAutomaticSpeechModel aiAutomaticSpeechModel = new AiAutomaticSpeechModel();//机器人消息体
public AiAutomaticSpeechModel getAiAutomaticSpeechModel() { public AiAutomaticSpeechModel getAiAutomaticSpeechModel() {

View File

@ -839,10 +839,12 @@ public class SocketRyClient {
*/ */
private void sendToUserMsg(JSONObject map) { private void sendToUserMsg(JSONObject map) {
LiveChatBean bean = new LiveChatBean(); LiveChatBean bean = new LiveChatBean();
bean.setId(CommonAppConfig.getInstance().getUid()); bean.setId(map.getString("uid"));
bean.setAtUserID(map.getString("toUserID")); bean.setAtUserID(map.getString("toUserID"));
bean.setContent(map.getString("ct")); bean.setContent(map.getString("ct"));
bean.setType(LiveChatBean.TYPE_TO_USER_MSG); bean.setType(LiveChatBean.TYPE_TO_USER_MSG);
bean.setUserNiceName(map.getString("user_nicename"));
bean.setToUid(CommonAppConfig.getInstance().getUid());
mListener.onChat(bean, 1); mListener.onChat(bean, 1);
} }