From fd687ab2d54de3dbb9594f175d15d13e8a1144cc Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Fri, 28 Oct 2022 16:03:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DBanner=E8=BF=9E=E7=82=B9?= =?UTF-8?q?=E5=A4=9A=E5=BC=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/views/LiveRoomViewHolder.java | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 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 c226d8f74..2b2514d04 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1112,7 +1112,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .setOnBannerClickListener(new OnBannerClickListener() { @Override public void onBannerClick(List datas, int p) { - showLoadingDialog(); + if (showLoadingDialog()) { + return; + } if (mBannerList2 != null) { if (p >= 0 && p < mBannerList2.size()) { IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); @@ -1169,7 +1171,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .setOnBannerClickListener(new OnBannerClickListener() { @Override public void onBannerClick(List datas, int p) { - showLoadingDialog(); + if (showLoadingDialog()) { + return; + } if (mBannerList2 != null) { if (p >= 0 && p < mBannerList2.size()) { IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); @@ -1235,10 +1239,21 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis reloadIM(); } - private void showLoadingDialog() { - final Dialog loadingDialog = DialogUitl.loadingDialog(mContext, WordUtil.getString(R.string.login_wait)); + Dialog loadingDialog = null; + + private boolean showLoadingDialog() { + if (loadingDialog != null && loadingDialog.isShowing()) { + return true; + } + loadingDialog = DialogUitl.loadingDialog(mContext, WordUtil.getString(R.string.login_wait)); loadingDialog.show(); - new Handler(Looper.getMainLooper()).postDelayed(loadingDialog::dismiss, 1000); + new Handler(Looper.getMainLooper()).postDelayed(() -> { + if (loadingDialog != null) { + loadingDialog.dismiss(); + } + loadingDialog = null; + }, 1000); + return false; } public void setLiveUid(String liveUid) { @@ -3019,7 +3034,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void onBannerClick(List datas, int p) { Log.i("debug", "onBannerClick: " + mBannerList4.get(p).toString()); BannerBean bean = mBannerList4.get(p); - showLoadingDialog(); + if (showLoadingDialog()) { + return; + } if (bean.getActivityId() == -1) {//-1写死跳活动弹窗 Bus.get().post(new LiveAudienceEvent() .setActivity(true)