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) {