diff --git a/common/src/main/java/com/yunbao/common/bean/GuardModel.java b/common/src/main/java/com/yunbao/common/bean/GuardModel.java index c89531dcf..a13949fff 100644 --- a/common/src/main/java/com/yunbao/common/bean/GuardModel.java +++ b/common/src/main/java/com/yunbao/common/bean/GuardModel.java @@ -8,6 +8,17 @@ public class GuardModel extends BaseModel { private String type; @SerializedName("endtime") private String endtime; + @SerializedName("guard_type") + private String guardType; + + public String getGuardType() { + return guardType; + } + + public GuardModel setGuardType(String guardType) { + this.guardType = guardType; + return this; + } public String getType() { return type; diff --git a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java index d7fa2ed03..b220d8f07 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java @@ -316,7 +316,7 @@ public class LiveTextRender { } if (drawable != null) { builder.append(" "); - drawable.setBounds(0, 0, DpUtil.dp2px(35), DpUtil.dp2px(17)); + drawable.setBounds(0, 0, DpUtil.dp2px(34), DpUtil.dp2px(17)); builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); index = builder.length(); } 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 87b56ad96..6973e3f49 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -696,12 +696,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time")); } - if (data.getGuardUserAvatar() != null) { + if (data.getEnterRoomInfo().getGuard() != null) { if (mLiveRoomViewHolder != null) { - if (TextUtils.isEmpty(data.getGuardUserAvatar().getGuardType())) { - mLiveRoomViewHolder.setGuardType(0); + if (TextUtils.isEmpty(data.getEnterRoomInfo().getGuard().getGuardType())) { + IMLoginManager.get(mContext).setGuardType(0); } else { - int guardType = Integer.parseInt(data.getGuardUserAvatar().getGuardType()); + int guardType = Integer.parseInt(data.getEnterRoomInfo().getGuard().getGuardType()); IMLoginManager.get(mContext).setGuardType(guardType); }