修复Ranking.getAnchorRankData多次调用问题

This commit is contained in:
zlzw 2023-06-08 15:21:24 +08:00
parent 6603a2dbb5
commit af8052f65b
2 changed files with 11 additions and 4 deletions

View File

@ -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;
@ -2095,9 +2095,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
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;
}
//非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);

View File

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