调整用户卡片的主播判断

This commit is contained in:
zlzw 2022-11-17 16:55:04 +08:00
parent b8ec25c94e
commit 1ee335abf2
2 changed files with 4 additions and 3 deletions

View File

@ -300,9 +300,9 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
boolean isAnchor = false;
private void showData(String data) {
isAnchor = mLiveUid.equals(mToUid);
Log.i(TAG, "showData: " + data);
JSONObject obj = JSON.parseObject(data);
isAnchor = obj.getInteger("is_anchor")==1;
mUserBean = JSON.toJavaObject(obj, UserBean.class);
mToName = obj.getString("user_nicename");
@ -343,7 +343,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
}
mName.setText(obj.getString("user_nicename"));
if (mUserBean.getGoodnum() != null && !mUserBean.getGoodnum().equals("")) {
if(obj.getInteger("level_anchor")==1) {
if(!isAnchor) {
good_nub_ico.setImageResource(R.mipmap.good_nub);
}
good_nub_ico.setVisibility(View.VISIBLE);
@ -354,7 +354,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
}
mSex.setImageResource(CommonIconUtil.getSexIconForUserCard(obj.getIntValue("sex")));
LevelBean levelBean;
if (mLiveUid.equals(mUserBean.getId())) {
if (isAnchor) {
levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor());
userLv.setText("Lv." + mUserBean.getLevelAnchor());
mLvDesc.setText(R.string.live_user_level_anchor);

View File

@ -336,6 +336,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
}
if ("C".equals(u.getUsers_type())) {
Constants.isAnchor = true;
good_nub_ico.setImageResource(R.mipmap.usercard_good_nub);
if (anchorLevelBean != null) {
ImgLoader.display(mContext, CommonAppConfig.getInstance().HOST + anchorLevelBean.getThumb(), mLevel);
ImgLoader.display(mContext, R.mipmap.icon_zhubolv, img_lv_pic);