From fd038da6d73d7c71630f785053b51625f7f33340 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Fri, 14 Oct 2022 10:35:24 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8DBanner=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=82=B9=E5=87=BB=E4=BC=9A=E8=BF=9B=E5=85=A5=E4=B8=A4?= =?UTF-8?q?=E6=AC=A1=E7=9B=B4=E6=92=AD=E9=97=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/views/MainHomeLiveViewHolder.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index 6e67e6b45..37d175647 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -1,6 +1,7 @@ package com.yunbao.main.views; import android.animation.ObjectAnimator; +import android.app.Dialog; import android.content.Context; import android.graphics.Outline; import android.text.TextUtils; @@ -31,6 +32,7 @@ import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.OnItemClickListener; +import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.CustomViewHolder; @@ -82,6 +84,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement private List new_data; private boolean isHave = false; private Map gotoRoomKey = new HashMap<>(); + private Dialog mShowLoadingDialog; public MainHomeLiveViewHolder(Context context, ViewGroup parentView) { super(context, parentView); @@ -315,7 +318,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement return; } intoIndex = 1; - if (gotoRoomKey.isEmpty()) { + if (gotoRoomKey!=null&&gotoRoomKey.isEmpty()) { gotoRoomKey = null; } LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", gotoRoomKey, 0, liveSdk); @@ -356,9 +359,13 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement ToastUtil.show("暫無法簽到,請稍後再試"); return; } else { + if(gotoRoomKey==null){ + gotoRoomKey=new HashMap<>(); + } gotoRoomKey.put("OPEN", "NEWUSER"); } } + showLoadingDialog(); if (link.contains("http")) { WebViewActivity.forward(mContext, link, true); } else { @@ -372,6 +379,13 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement .start(); } + /** + * Banner双击可能会导致进入两次直播间,点击Banner后需要展示加载中动画 + */ + private void showLoadingDialog(){ + mShowLoadingDialog = DialogUitl.loadingDialog(mContext); + mShowLoadingDialog.show(); + } @Override public void onItemClick(LiveBean bean, int position) { @@ -447,4 +461,13 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement public void onResume() { super.onResume(); } + + @Override + public void onPause() { + super.onPause(); + if(mShowLoadingDialog !=null){ + mShowLoadingDialog.dismiss(); + mShowLoadingDialog =null; + } + } }