From af8052f65b07e603c894e7b6c833966ab0a4dc26 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 8 Jun 2023 15:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DRanking.getAnchorRankData?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E8=B0=83=E7=94=A8=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/LiveRoomViewHolder.java | 14 ++++++++++---- .../com/yunbao/live/views/PortraitLiveManager.java | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index eed4c69ac..9d1b73c82 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -341,7 +341,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private TextView mPkRankText; private ImageView mPkRankTopIcon; private TextView mRedVal, mBlueVal; - private String pkUid = ""; + public String pkUid = ""; //接口整合新加参数 private GuardUserModel guardUserModel; @@ -2092,13 +2092,19 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis initPkRank(null); } - private String pkUidTmp =""; + private String pkUidTmp = ""; public void initPkRank(String isLadders) { - if (pkUidTmp.equals(pkUid)) { + //PK状态下,pkuid不能为空 + if (((LiveAudienceActivity) mContext).isPkStatus() && pkUidTmp.equals(pkUid) && !StringUtil.isEmpty(pkUid)) { return; } - pkUidTmp=pkUid; + //非PK状态下,第一次调用通过 + if (pkRankLayout.getTag() != null && pkRankLayout.getTag().equals(mLiveUid)) { + return; + } + pkRankLayout.setTag(mLiveUid); + pkUidTmp = pkUid; pkRankLayout.setVisibility(View.GONE); new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveRankPk2, "rectangle_new.png", 1); mRedVal.setVisibility(View.GONE); 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 13d5fe08b..2c7b5fd27 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -594,6 +594,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.initPkRank(null); } if (mLivePlayViewHolder != null) {