From 3445ee2a565969cad471f3526c6ce9c779300348 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 5 Jan 2024 13:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BF=A1=E4=BB=B6=E6=9C=AA?= =?UTF-8?q?=E8=AF=BB=E6=B6=88=E6=81=AF=E8=AF=B7=E6=B1=82=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/views/LiveRoomViewHolder.java | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 5e71701ad..11e356875 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1823,7 +1823,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * 重置数据 */ public void resetView() { - contactMsgPage = -1; svgaImageViewHashMap.clear(); pa_pao_layout.removeAllViews(); timeHandler.removeCallbacks(timeRunnable); @@ -4103,7 +4102,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void clearData() { - contactMsgPage = -1; svgaImageViewHashMap.clear(); pa_pao_layout.removeAllViews(); timeHandler.removeCallbacks(timeRunnable); @@ -5504,7 +5502,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void initTopBanner() { - contactMsgPage = 1; checkNewLetter(); if (mTopBannerList == null) { mTopBannerList = new ArrayList<>(); @@ -5706,36 +5703,31 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis }); } - private int contactMsgPage = 1; private synchronized void checkNewLetter() { - if (contactMsgPage > 0) { - LiveNetManager.get(mContext).getContactMsg(contactMsgPage, new com.yunbao.common.http.base.HttpCallback>() { - @Override - public void onSuccess(List data) { - if (data.size() > 0 && data != null) { - for (LiveUserMailBoxModel model : data) { - if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) { - ((LiveAudienceActivity) mContext).showMsgRed(0); - return; - } + + LiveNetManager.get(mContext).getContactMsg(1, new com.yunbao.common.http.base.HttpCallback>() { + @Override + public void onSuccess(List data) { + if (data.size() > 0 && data != null) { + for (LiveUserMailBoxModel model : data) { + if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) { + ((LiveAudienceActivity) mContext).showMsgRed(0); + return; } - contactMsgPage = contactMsgPage + 1; - checkNewLetter(); - } else { - ((LiveAudienceActivity) mContext).showMsgRed(-1); - contactMsgPage = 1; } - - + } else { + ((LiveAudienceActivity) mContext).showMsgRed(-1); } - @Override - public void onError(String error) { - contactMsgPage = 1; - } - }); - } + + } + + @Override + public void onError(String error) { + } + }); + }