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)