修复Ranking.getAnchorRankData多次调用问题

This commit is contained in:
zlzw 2023-06-08 14:33:44 +08:00
parent f3a0b4d145
commit 6603a2dbb5

View File

@ -1506,6 +1506,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void resetView() { public void resetView() {
resetViewGone(); resetViewGone();
visibility = false; visibility = false;
pkUidTmp = "";
mBannerList1.clear(); mBannerList1.clear();
mBannerList2.clear(); mBannerList2.clear();
mBannerList3.clear(); mBannerList3.clear();
@ -2091,10 +2092,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
initPkRank(null); initPkRank(null);
} }
private String pkUidTmp ="";
public void initPkRank(String isLadders) { public void initPkRank(String isLadders) {
if(StringUtil.isEmpty(pkUid)){ if (pkUidTmp.equals(pkUid)) {
return; return;
} }
pkUidTmp=pkUid;
pkRankLayout.setVisibility(View.GONE); pkRankLayout.setVisibility(View.GONE);
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveRankPk2, "rectangle_new.png", 1); new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveRankPk2, "rectangle_new.png", 1);
mRedVal.setVisibility(View.GONE); mRedVal.setVisibility(View.GONE);
@ -2140,6 +2144,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
liveRankPk2.setVisibility(View.VISIBLE); liveRankPk2.setVisibility(View.VISIBLE);
mPkRankText.setText(bean.getName()); mPkRankText.setText(bean.getName());
ImgLoader.display(mContext, bean.getImg(), mPkRankIcon); ImgLoader.display(mContext, bean.getImg(), mPkRankIcon);
pkUidTmp = "";
if (StringUtil.isEmpty(bean.getPkTopImgUrl())) { if (StringUtil.isEmpty(bean.getPkTopImgUrl())) {
return; return;
} }
@ -2162,6 +2167,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
@Override @Override
public void onError(String error) { public void onError(String error) {
ToastUtil.show(R.string.net_error); ToastUtil.show(R.string.net_error);
pkUidTmp = "";
} }
}); });