From 7bb3f2d5f7e259c07775300f0335bbc30d782f5d Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 10 Aug 2022 15:29:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98,shouye=20ytuijian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/adapter/SystemChatMessageAdapter.java | 2 ++ .../yunbao/main/adapter/SearchResultsItemAdapter.java | 5 +++-- .../com/yunbao/main/adapter/SystemMessageAdapter.java | 9 +++------ 3 files changed, 8 insertions(+), 8 deletions(-) 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); }