From 368b002db67efbff500f67236b85844d68f70f20 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 27 Jun 2023 14:19:34 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E7=9B=B4=E6=92=AD=E9=97=B4=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E8=BF=9B=E5=85=A5=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/views/PortraitLiveManager.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index bcac77b9d..e7d202d4f 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -257,7 +257,14 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void run() { loading.setVisibility(View.GONE); enterRoomLeaveHandler.post(enterRoomLeaveRunnable); - ToastUtil.show(mContext.getString(R.string.net_error) + " :500" );//异常下播,等待加载时间过了后弹出 + } + }; + final Runnable loadTimeoutRunnableGone = new Runnable() { + @Override + public void run() { + loading.setVisibility(View.GONE); + enterRoomLeaveHandler.post(enterRoomLeaveRunnable); + ToastUtil.show(mContext.getString(R.string.net_error) + " :500");//异常下播,等待加载时间过了后弹出 } }; @@ -297,6 +304,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground(); frameAnimation.start(); liveHandler.removeCallbacks(loadRunnableGone); + liveHandler.removeCallbacks(loadTimeoutRunnableGone); if (mLivePlayViewHolder == null) { mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1); mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager()); @@ -310,6 +318,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe @Override public void onPlayer() { liveHandler.postDelayed(loadRunnableGone, 350); + liveHandler.removeCallbacks(loadTimeoutRunnableGone); } }); mLiveRoomViewHolder.subscribeActivityLifeCycle(); @@ -595,7 +604,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } else if (!pkInfo.getString("end_pk_time").equals("0")) { if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.pkHandler = true; - mLiveRoomViewHolder.pkUid=pkUid; + mLiveRoomViewHolder.pkUid = pkUid; mLiveRoomViewHolder.initPkRank(null); } if (mLivePlayViewHolder != null) { @@ -660,7 +669,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel)); } } - liveHandler.postDelayed(loadRunnableGone, 15_000); + liveHandler.postDelayed(loadTimeoutRunnableGone, 15_000); if (TextUtils.equals(data.getEnterRoomInfo().getIsconnection(), "1")) { //通知心愿单位置换地方 EventBus.getDefault().post(new LiveAudienceEvent()