修复心愿单Banner连点多开问题

This commit is contained in:
zlzw 2022-10-28 15:50:10 +08:00
parent 81933f0ad7
commit f1554f8201

View File

@ -1112,6 +1112,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.setOnBannerClickListener(new OnBannerClickListener() {
@Override
public void onBannerClick(List datas, int p) {
showLoadingDialog();
if (mBannerList2 != null) {
if (p >= 0 && p < mBannerList2.size()) {
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
@ -1168,6 +1169,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.setOnBannerClickListener(new OnBannerClickListener() {
@Override
public void onBannerClick(List datas, int p) {
showLoadingDialog();
if (mBannerList2 != null) {
if (p >= 0 && p < mBannerList2.size()) {
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
@ -1233,6 +1235,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
reloadIM();
}
private void showLoadingDialog() {
final Dialog loadingDialog = DialogUitl.loadingDialog(mContext, WordUtil.getString(R.string.login_wait));
loadingDialog.show();
new Handler(Looper.getMainLooper()).postDelayed(loadingDialog::dismiss, 1000);
}
public void setLiveUid(String liveUid) {
mLiveUid = liveUid;
@ -3007,36 +3014,24 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.setDelayTime(2800)
.setBannerStyle(BannerConfig.NOT_INDICATOR)
.setOnBannerClickListener(new OnBannerClickListener() {
Dialog loadingDialog;
@Override
public void onBannerClick(List datas, int p) {
Log.i("debug", "onBannerClick: " + mBannerList4.get(p).toString());
BannerBean bean = mBannerList4.get(p);
if (loadingDialog == null) {
loadingDialog = DialogUitl.loadingDialog(mContext, WordUtil.getString(R.string.login_wait));
showLoadingDialog();
if (bean.getActivityId() == -1) {//-1写死跳活动弹窗
Bus.get().post(new LiveAudienceEvent()
.setActivity(true)
.setType(LiveAudienceEvent.LiveAudienceType.BOTTOM_COLLECTION));
} else if (bean.getActivityId() == 0) {
openWebDialog(bean.getLink());
} else {
LiveGameDialogFragment fragment = new LiveGameDialogFragment("1".equals(bean.getShow_type()));
fragment.setActivityId(bean.getActivityId());
fragment.setRoomId(mLiveUid);
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGameDialogFragment");
}
loadingDialog.setOnShowListener(dialog -> {
if (bean.getActivityId() == -1) {//-1写死跳活动弹窗
Bus.get().post(new LiveAudienceEvent()
.setActivity(true)
.setType(LiveAudienceEvent.LiveAudienceType.BOTTOM_COLLECTION));
} else if (bean.getActivityId() == 0) {
openWebDialog(bean.getLink());
} else {
LiveGameDialogFragment fragment = new LiveGameDialogFragment("1".equals(bean.getShow_type()));
fragment.setActivityId(bean.getActivityId());
fragment.setRoomId(mLiveUid);
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGameDialogFragment");
}
});
loadingDialog.show();
new Handler(Looper.getMainLooper()).postDelayed(() -> {
if (loadingDialog != null && loadingDialog.isShowing()) {
loadingDialog.dismiss();
}
loadingDialog = null;
}, 300);
}
@ -3060,12 +3055,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
bundle1.putString("url", url);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle1);
liveHDDialogFragment.setShowListener(dialog1 -> {
new Handler(Looper.getMainLooper()).postDelayed(() -> {
loadingDialog.dismiss();
loadingDialog = null;
}, 300);
});
liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}