update 直播间超时进入的提示

This commit is contained in:
zlzw 2023-06-27 14:19:34 +08:00
parent 501a7b482b
commit 368b002db6

View File

@ -257,7 +257,14 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
public void run() { public void run() {
loading.setVisibility(View.GONE); loading.setVisibility(View.GONE);
enterRoomLeaveHandler.post(enterRoomLeaveRunnable); 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(); AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
frameAnimation.start(); frameAnimation.start();
liveHandler.removeCallbacks(loadRunnableGone); liveHandler.removeCallbacks(loadRunnableGone);
liveHandler.removeCallbacks(loadTimeoutRunnableGone);
if (mLivePlayViewHolder == null) { if (mLivePlayViewHolder == null) {
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1); 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()); 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 @Override
public void onPlayer() { public void onPlayer() {
liveHandler.postDelayed(loadRunnableGone, 350); liveHandler.postDelayed(loadRunnableGone, 350);
liveHandler.removeCallbacks(loadTimeoutRunnableGone);
} }
}); });
mLiveRoomViewHolder.subscribeActivityLifeCycle(); mLiveRoomViewHolder.subscribeActivityLifeCycle();
@ -595,7 +604,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} else if (!pkInfo.getString("end_pk_time").equals("0")) { } else if (!pkInfo.getString("end_pk_time").equals("0")) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.pkHandler = true; mLiveRoomViewHolder.pkHandler = true;
mLiveRoomViewHolder.pkUid=pkUid; mLiveRoomViewHolder.pkUid = pkUid;
mLiveRoomViewHolder.initPkRank(null); mLiveRoomViewHolder.initPkRank(null);
} }
if (mLivePlayViewHolder != null) { if (mLivePlayViewHolder != null) {
@ -660,7 +669,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel)); mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel));
} }
} }
liveHandler.postDelayed(loadRunnableGone, 15_000); liveHandler.postDelayed(loadTimeoutRunnableGone, 15_000);
if (TextUtils.equals(data.getEnterRoomInfo().getIsconnection(), "1")) { if (TextUtils.equals(data.getEnterRoomInfo().getIsconnection(), "1")) {
//通知心愿单位置换地方 //通知心愿单位置换地方
EventBus.getDefault().post(new LiveAudienceEvent() EventBus.getDefault().post(new LiveAudienceEvent()