diff --git a/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java b/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java index 18312f81b..9a9c50809 100644 --- a/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java @@ -102,10 +102,16 @@ public class GiftCacheUtil { * 设置下载列表 */ public void setDownloadList(List list) { + downloadCache.clear(); for (LiveGiftBean bean : list) { downloadCache.put(bean.getId(), bean); } } + public void addDownloadList(List list){ + for (LiveGiftBean bean : list) { + downloadCache.put(bean.getId(),bean); + } + } /** * 设置监听回调 @@ -240,7 +246,7 @@ public class GiftCacheUtil { break; } if(downloadCache.isEmpty()){ - downloading = false; + resetStatus(); } }).start(); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java index de0fd975b..41309cb8b 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java @@ -378,6 +378,10 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On JSONObject obj = JSON.parseObject(info[0]); String giftJson = obj.getString("giftlist"); List list = JSON.parseArray(giftJson, LiveGiftBean.class); + GiftCacheUtil.getInstance().addDownloadList(list); + if(!GiftCacheUtil.getInstance().isDownloading()){ + GiftCacheUtil.getInstance().downloadAllGift(); + } int size = list.size(); if (size <= 0) { mVPWrapList.setBackground(getResources().getDrawable(R.mipmap.wrap_empty)); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomClassDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomClassDialogFragment.java index d44e0387c..6bf49ae81 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomClassDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewRoomClassDialogFragment.java @@ -97,7 +97,6 @@ public class LiveNewRoomClassDialogFragment extends AbsDialogFragment implements @Override public void onItemClick(LiveClassBean bean, int position) { - System.out.println("bean = " + bean + ", position = " + position); bean.setChecked(true); if(mCallback!=null){ mCallback.callback(bean);