From 28137615df3ed5272c4b195d1401efb11e0562b2 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 19 Oct 2022 16:36:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=9B=B4=E6=92=AD=E9=97=B4=E4=BE=A7?= =?UTF-8?q?=E8=BE=B9=E6=8E=A8=E8=8D=90Banner=E5=A4=9A=E6=AC=A1=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=8F=AF=E8=83=BD=E5=AF=BC=E8=87=B4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E7=9B=B4=E6=92=AD=E9=97=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/views/SidebarViewHoler.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java b/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java index dbc88476a..a20442623 100644 --- a/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java +++ b/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java @@ -1,6 +1,7 @@ package com.yunbao.live.views; import android.app.Activity; +import android.app.Dialog; import android.view.View; import androidx.annotation.NonNull; @@ -11,6 +12,7 @@ import com.ms.banner.Banner; import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.bean.SlideInfoModel; import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.views.SlideInBannerViewHolder; import com.yunbao.live.R; @@ -26,11 +28,13 @@ import java.util.Map; public class SidebarViewHoler extends RecyclerView.ViewHolder { //侧边栏轮播 private Banner mBanner; + private Dialog mShowLoadingDialog; public SidebarViewHoler(@NonNull View itemView) { super(itemView); //侧边栏轮播 mBanner = itemView.findViewById(R.id.banner); + mShowLoadingDialog = DialogUitl.loadingDialog(itemView.getContext()); } @@ -52,6 +56,7 @@ public class SidebarViewHoler extends RecyclerView.ViewHolder { if (p >= 0 && p < data.size()) { SlideInfoModel bean = data.get(p); if (bean != null) { + showLoadingDialog(); String link = bean.getSlideUrl(); if (link.contains("http")) { WebViewActivity.forward(itemView.getContext(), link, true); @@ -76,6 +81,7 @@ public class SidebarViewHoler extends RecyclerView.ViewHolder { LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(itemView.getContext(), (liveBean1, liveType, liveTypeVal, liveSdk) -> { if (liveBean1 == null) { + mShowLoadingDialog.dismiss(); return; } Map map = null; @@ -84,15 +90,23 @@ public class SidebarViewHoler extends RecyclerView.ViewHolder { map.put("OPEN", "NEWUSER"); } LiveAudienceActivity.forward(itemView.getContext(), liveBean1, liveType, liveTypeVal, "", map, 0, liveSdk); + mShowLoadingDialog.dismiss(); ((Activity) itemView.getContext()).finish(); }); mCheckLivePresenter.checkLive(liveBean); } else { + mShowLoadingDialog.dismiss(); RouteUtil.forwardUserHome(itemView.getContext(), liveId, 0); ((Activity) itemView.getContext()).finish(); } } }); } + /** + * Banner双击可能会导致进入两次直播间,点击Banner后需要展示加载中动画 + */ + private void showLoadingDialog(){ + mShowLoadingDialog.show(); + } }