增加私聊风险提示背景,消息预览改为[风险提示]

(cherry picked from commit ec4172bdef671f727e78051bb326a61eccecb689)
This commit is contained in:
huangjian
2021-04-28 10:27:59 +08:00
parent 217f08a622
commit b51412bcc7
4 changed files with 27 additions and 29 deletions

View File

@@ -2,9 +2,11 @@ package com.yizhuan.tutu.room_chat.fragment;
import android.annotation.SuppressLint;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
@@ -29,6 +31,7 @@ import com.yizhuan.xchat_android_core.auth.AuthModel;
import com.yizhuan.xchat_android_core.auth.event.LoginEvent;
import com.yizhuan.xchat_android_core.im.custom.bean.AssistantAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.CarAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.ChatHintAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.LuckyMoneyTipsAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.NewbieHelloAttachment;
@@ -83,6 +86,7 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS
/**
* 房间内私聊显示用的最近聊天列表
* 发现萌新
*
* @author MadisonRong
*/
public class RoomMsgRecentListFragment extends BaseFragment {
@@ -111,19 +115,19 @@ public class RoomMsgRecentListFragment extends BaseFragment {
boolean isClicked = (boolean) SharedPreferenceUtils.get(share_pref_is_newbie_clicked, false);
flNewbie = mView.findViewById(R.id.fl_newbie);
ivRedPoint = mView.findViewById(R.id.iv_red_point);
ivRedPoint.setVisibility(isClicked?View.GONE:View.VISIBLE);
ivRedPoint.setVisibility(isClicked ? View.GONE : View.VISIBLE);
// 等级限制
setFindNewbieView();
}
@SuppressLint("CheckResult")
private void setFindNewbieView(){
private void setFindNewbieView() {
// 等级限制
UserModel.get().getCurrentUserInfo().subscribe(userInfo -> {
if (userInfo != null) {
UserLevelVo userLevelVo = userInfo.getUserLevelVo();
if (userLevelVo != null) {
flNewbie.setVisibility(userLevelVo.charmLevelSeq >= InitialModel.get().getFindNewbieCharmLevel()?View.VISIBLE:View.GONE);
flNewbie.setVisibility(userLevelVo.charmLevelSeq >= InitialModel.get().getFindNewbieCharmLevel() ? View.VISIBLE : View.GONE);
}
}
});
@@ -140,7 +144,7 @@ public class RoomMsgRecentListFragment extends BaseFragment {
lastClickTime = currTime;
SharedPreferenceUtils.put(share_pref_is_newbie_clicked, true);// 是否第一次点击发现萌新
ivRedPoint.setVisibility(View.GONE);
RoomNewbieActivity.start(getActivity(),true);
RoomNewbieActivity.start(getActivity(), true);
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_ROOM_MESSAGE_FINDNEW_CLICK, "语音房_消息_发现萌新");
});
}
@@ -184,9 +188,9 @@ public class RoomMsgRecentListFragment extends BaseFragment {
public void onSuccess(Integer type) {
if (type == 1) {
NimHallTeamRoomMessageActivity.start(mContext, recent.getContactId());
} else if (type == 0){
} else if (type == 0) {
NimTeamRoomMessageActivity.start(mContext, recent.getContactId());
} else if (type == 2){
} else if (type == 2) {
MWTeamRoomMessageAct.start(mContext, recent.getContactId());
} else {
toast("该版本不支持,请下载最新版本");
@@ -221,9 +225,9 @@ public class RoomMsgRecentListFragment extends BaseFragment {
return ((CarAttachment) attachment).msg;
} else if (customAttachment.getFirst() == CUSTOM_MSG_ASSISTANT_MSG) {
return ((AssistantAttachment) attachment).title;
} else if (customAttachment.getFirst() == CUSTOM_MSG_NEWBIE) {
} else if (customAttachment.getFirst() == CUSTOM_MSG_NEWBIE) {
return ((NewbieHelloAttachment) attachment).getNewbieHelloInfo().message;
}else if (customAttachment.getFirst() == CUSTOM_MSG_HEADER_TYPE_SHARE_IN_APP) {
} else if (customAttachment.getFirst() == CUSTOM_MSG_HEADER_TYPE_SHARE_IN_APP) {
switch (customAttachment.getSecond()) {
case CUSTOM_MSG_SHARE_ROOM:
return "[分享房间]";
@@ -274,6 +278,8 @@ public class RoomMsgRecentListFragment extends BaseFragment {
return "[您收到一条厅消息]";
} else if (customAttachment instanceof SysMsgVoiceAttachment) {
return "[声音瓶子审核消息]";
} else if (customAttachment instanceof ChatHintAttachment) {
return "[风险提示]";
}
} else if (attachment instanceof AudioAttachment) {
return "[语音]";