diff --git a/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java b/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java index f1d68d54a..c4657ca60 100644 --- a/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java @@ -149,6 +149,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter { String number = bean.getNum(); if (TextUtils.equals(type, bean.getType())) { number = null; + bean.setNum(null); } //未读消息不为空并且大于0 try { @@ -160,6 +161,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter { } } type = null; + notifyDataSetChanged(); MessageIMManager.get(mContext).setSystemNumber(systemNumber); } } \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/adapter/SearchResultsItemAdapter.java b/main/src/main/java/com/yunbao/main/adapter/SearchResultsItemAdapter.java index b8dbd9492..e85447739 100644 --- a/main/src/main/java/com/yunbao/main/adapter/SearchResultsItemAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/SearchResultsItemAdapter.java @@ -93,10 +93,11 @@ public class SearchResultsItemAdapter extends RecyclerView.Adapter { if (mLists.size() > 1) { isAll = true; if (mLists.get(0).size() == 0) { - this.type = ANCHOR; + this.type = USER; + } if (mLists.get(1).size() == 0) { - this.type = USER; + this.type = ANCHOR; } } else { isAll = false; diff --git a/main/src/main/java/com/yunbao/main/adapter/SystemMessageAdapter.java b/main/src/main/java/com/yunbao/main/adapter/SystemMessageAdapter.java index 2f16fd288..aef0a9a83 100644 --- a/main/src/main/java/com/yunbao/main/adapter/SystemMessageAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/SystemMessageAdapter.java @@ -39,7 +39,6 @@ public class SystemMessageAdapter extends RecyclerView.Adapter { protected Activity mContext; protected LayoutInflater mInflater; private Handler netHandler = new Handler(); - private int mPosition = -1; private String type = ""; public SystemMessageAdapter(Activity mContext) { @@ -88,7 +87,6 @@ public class SystemMessageAdapter extends RecyclerView.Adapter { //系统消息的跳转 messageViewHolder.setViewHolderOnClickListener((view, model1) -> { type = model1.getType(); - mPosition = position; netHandler.post(updataRunable); if (model1.getTitle().equals("在線客服")) { FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null); @@ -143,18 +141,16 @@ public class SystemMessageAdapter extends RecyclerView.Adapter { //倒序展示 Collections.reverse(mlistUserBean); listUserBean.clear(); - if (mPosition > 0) { - mlistUserBean.get(mPosition).setNum(""); - } + listUserBean.addAll(mlistUserBean); notifyDataSetChanged(); - mPosition = -1; int systemNumber = 0; for (ImUserBean bean : listUserBean) { //未读消息数 String number = bean.getNum(); if (TextUtils.equals(type, bean.getType())) { number = null; + bean.setNum(null); } //未读消息不为空并且大于0 try { @@ -166,6 +162,7 @@ public class SystemMessageAdapter extends RecyclerView.Adapter { } } type = null; + notifyDataSetChanged(); MessageIMManager.get(mContext).setSystemNumber(systemNumber); }