From cd3feebb94c4510580c65c25dae9b5952c552f14 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 1 Apr 2024 14:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/common/bean/GuardModel.java | 11 +++++++++++ .../java/com/yunbao/live/utils/LiveTextRender.java | 2 +- .../com/yunbao/live/views/PortraitLiveManager.java | 8 ++++---- 3 files changed, 16 insertions(+), 5 deletions(-) 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); }