修改测试问题,shouye ytuijian

This commit is contained in:
18401019693 2022-08-10 15:29:41 +08:00
parent 8c6b04685a
commit 7bb3f2d5f7
3 changed files with 8 additions and 8 deletions

View File

@ -149,6 +149,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
String number = bean.getNum(); String number = bean.getNum();
if (TextUtils.equals(type, bean.getType())) { if (TextUtils.equals(type, bean.getType())) {
number = null; number = null;
bean.setNum(null);
} }
//未读消息不为空并且大于0 //未读消息不为空并且大于0
try { try {
@ -160,6 +161,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
} }
} }
type = null; type = null;
notifyDataSetChanged();
MessageIMManager.get(mContext).setSystemNumber(systemNumber); MessageIMManager.get(mContext).setSystemNumber(systemNumber);
} }
} }

View File

@ -93,10 +93,11 @@ public class SearchResultsItemAdapter extends RecyclerView.Adapter {
if (mLists.size() > 1) { if (mLists.size() > 1) {
isAll = true; isAll = true;
if (mLists.get(0).size() == 0) { if (mLists.get(0).size() == 0) {
this.type = ANCHOR; this.type = USER;
} }
if (mLists.get(1).size() == 0) { if (mLists.get(1).size() == 0) {
this.type = USER; this.type = ANCHOR;
} }
} else { } else {
isAll = false; isAll = false;

View File

@ -39,7 +39,6 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
protected Activity mContext; protected Activity mContext;
protected LayoutInflater mInflater; protected LayoutInflater mInflater;
private Handler netHandler = new Handler(); private Handler netHandler = new Handler();
private int mPosition = -1;
private String type = ""; private String type = "";
public SystemMessageAdapter(Activity mContext) { public SystemMessageAdapter(Activity mContext) {
@ -88,7 +87,6 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
//系统消息的跳转 //系统消息的跳转
messageViewHolder.setViewHolderOnClickListener((view, model1) -> { messageViewHolder.setViewHolderOnClickListener((view, model1) -> {
type = model1.getType(); type = model1.getType();
mPosition = position;
netHandler.post(updataRunable); netHandler.post(updataRunable);
if (model1.getTitle().equals("在線客服")) { if (model1.getTitle().equals("在線客服")) {
FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null); FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null);
@ -143,18 +141,16 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
//倒序展示 //倒序展示
Collections.reverse(mlistUserBean); Collections.reverse(mlistUserBean);
listUserBean.clear(); listUserBean.clear();
if (mPosition > 0) {
mlistUserBean.get(mPosition).setNum("");
}
listUserBean.addAll(mlistUserBean); listUserBean.addAll(mlistUserBean);
notifyDataSetChanged(); notifyDataSetChanged();
mPosition = -1;
int systemNumber = 0; int systemNumber = 0;
for (ImUserBean bean : listUserBean) { for (ImUserBean bean : listUserBean) {
//未读消息数 //未读消息数
String number = bean.getNum(); String number = bean.getNum();
if (TextUtils.equals(type, bean.getType())) { if (TextUtils.equals(type, bean.getType())) {
number = null; number = null;
bean.setNum(null);
} }
//未读消息不为空并且大于0 //未读消息不为空并且大于0
try { try {
@ -166,6 +162,7 @@ public class SystemMessageAdapter extends RecyclerView.Adapter {
} }
} }
type = null; type = null;
notifyDataSetChanged();
MessageIMManager.get(mContext).setSystemNumber(systemNumber); MessageIMManager.get(mContext).setSystemNumber(systemNumber);
} }