測試問題修改

This commit is contained in:
18401019693 2022-09-07 13:21:25 +08:00
parent 12221c3ddc
commit f0e1e8d995
5 changed files with 14 additions and 18 deletions

View File

@ -7,6 +7,16 @@ import com.yunbao.common.bean.BaseModel;
*/ */
public class MessageIMEvent extends BaseModel { public class MessageIMEvent extends BaseModel {
private int number = 0; private int number = 0;
private int message = 0;
public int getMessage() {
return message;
}
public MessageIMEvent setMessage(int message) {
this.message = message;
return this;
}
public int getNumber() { public int getNumber() {
return number; return number;

View File

@ -181,7 +181,7 @@ public class MessageIMManager {
//整合未读消息数目并且发送出去 //整合未读消息数目并且发送出去
private final Runnable essagesRunnable = () -> { private final Runnable essagesRunnable = () -> {
number = imNumber + systemNumber; number = imNumber + systemNumber;
EventBus.getDefault().post(new MessageIMEvent().setNumber(number)); EventBus.getDefault().post(new MessageIMEvent().setNumber(number).setMessage(imNumber));
}; };
/** /**

View File

@ -146,7 +146,7 @@
<string name="im_type_voide">[語音]</string> <string name="im_type_voide">[語音]</string>
<string name="im_type_location">[位置]</string> <string name="im_type_location">[位置]</string>
<string name="im_msg">消息</string> <string name="im_msg">消息</string>
<string name="message">息中心</string> <string name="message">息中心</string>
<string name="im_msg_ignore_unread">忽略未讀</string> <string name="im_msg_ignore_unread">忽略未讀</string>
<string name="im_msg_ignore_unread_2">已忽略未讀消息</string> <string name="im_msg_ignore_unread_2">已忽略未讀消息</string>
<string name="im_msg_send_failed">消息發送失敗</string> <string name="im_msg_send_failed">消息發送失敗</string>

View File

@ -109,21 +109,7 @@ public class PDLIiveChatActivity extends FragmentActivity {
*/ */
private void initData() { private void initData() {
IMLoginManager.get(mContext).checkInstructor(); IMLoginManager.get(mContext).checkInstructor();
// //获取系统消息列表
// ImHttpUtil.getImUserInfo("", new HttpCallback() {
// @Override
// public void onSuccess(int code, String msg, String[] info) {
// if (code == 0) {
// container.post(new Runnable() {
// @Override
// public void run() {
// List<ImUserBean> listUserBean = JSON.parseArray(Arrays.toString(info), ImUserBean.class);
// addSystemMessagesView(listUserBean);
// }
// });
// }
// }
// });
//刷新列表内用户信息 //刷新列表内用户信息
addUserInfoProvider(); addUserInfoProvider();

View File

@ -439,7 +439,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true) @Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void onMessageIMEvent(MessageIMEvent event) { public void onMessageIMEvent(MessageIMEvent event) {
//判断消息中心红点是否已经展示如果已经展示并且未读消息大于0则不再执行之后的逻辑 //判断消息中心红点是否已经展示如果已经展示并且未读消息大于0则不再执行之后的逻辑
int number = event.getNumber(); int number = event.getMessage();
if (v_msg_redpoint.getVisibility() == View.VISIBLE && number > 0 || SpUtil.getInstance().getBooleanValue("private_chat_message_switch")) return; if (v_msg_redpoint.getVisibility() == View.VISIBLE && number > 0 || SpUtil.getInstance().getBooleanValue("private_chat_message_switch")) return;
if (number > 0) { if (number > 0) {
v_msg_redpoint.setVisibility(View.VISIBLE); v_msg_redpoint.setVisibility(View.VISIBLE);