From 9ff382e35b658662a95cfc6a3e99845891394821 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 16 Sep 2023 18:22:51 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=8E=92=E4=BD=8D=E8=B5=9B=E4=B8=AD?= =?UTF-8?q?=E8=8B=B1=E6=96=87IM=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/bean/PkRankBean.java | 11 +++++++++++ .../com/yunbao/live/socket/SocketRyClient.java | 1 + .../com/yunbao/live/views/LiveRoomViewHolder.java | 15 ++++++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/bean/PkRankBean.java b/common/src/main/java/com/yunbao/common/bean/PkRankBean.java index dcff7de27..bd70bb03c 100644 --- a/common/src/main/java/com/yunbao/common/bean/PkRankBean.java +++ b/common/src/main/java/com/yunbao/common/bean/PkRankBean.java @@ -23,6 +23,8 @@ public class PkRankBean extends BaseModel { public String clickUrl; @SerializedName("vs_img") public String vsImgUrl; + @SerializedName("new_rank_name_en") + public String newRankNameEn; public int getId() { return id; @@ -94,6 +96,14 @@ public class PkRankBean extends BaseModel { this.vsImgUrl = vsImgUrl; } + public String getNewRankNameEn() { + return newRankNameEn; + } + + public void setNewRankNameEn(String newRankNameEn) { + this.newRankNameEn = newRankNameEn; + } + @Override public String toString() { return "PkRankBean{" + @@ -105,6 +115,7 @@ public class PkRankBean extends BaseModel { ", pkTopImgUrl='" + pkTopImgUrl + '\'' + ", clickUrl='" + clickUrl + '\'' + ", vsImgUrl='" + vsImgUrl + '\'' + + ", newRankNameEn='" + newRankNameEn + '\'' + '}'; } } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 063d23e0d..5adf63ddc 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -650,6 +650,7 @@ public class SocketRyClient { pkRankBean.setId(Integer.parseInt(item.getString("new_rank_id"))); pkRankBean.setName(item.getString("new_rank_name")); pkRankBean.setImg(item.getString("new_rank_img")); + pkRankBean.setNewRankNameEn(item.getString("new_rank_name_en")); EventBus.getDefault().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.PK_RANK_UPDATE) .setObject(pkRankBean)); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 4664a66aa..eb35482d8 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -124,6 +124,7 @@ import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.TimeUtils; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.views.AbsViewHolder; import com.yunbao.common.views.weight.ClipPathCircleImage; @@ -461,7 +462,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } else if ("checkNewLetter".equals(str)) { checkNewLetter(); - }else if("exitFansGroup".equals(str)){ + } else if ("exitFansGroup".equals(str)) { setFansGroup("0"); } } @@ -1817,7 +1818,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } - if (htmlUrl.toString().contains("StarChallenge")){ + if (htmlUrl.toString().contains("StarChallenge")) { Map map_ekv = new HashMap(); map_ekv.put("link", htmlUrl.toString()); MobclickAgent.onEvent(mContext, "live_room_star", map_ekv); @@ -1889,7 +1890,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } - if (htmlUrl.toString().contains("StarChallenge")){ + if (htmlUrl.toString().contains("StarChallenge")) { Map map_ekv = new HashMap(); map_ekv.put("link", htmlUrl.toString()); MobclickAgent.onEvent(mContext, "live_room_star", map_ekv); @@ -2391,7 +2392,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } private void updatePkRank(PkRankBean bean) { - mPkRankText.setText(bean.getName()); + if (WordUtil.isNewZh()) { + mPkRankText.setText(bean.getName()); + } else { + mPkRankText.setText(bean.getNewRankNameEn()); + } ImgLoader.display(mContext, bean.getImg(), mPkRankIcon); } @@ -4159,7 +4164,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onBannerClick(List datas, int p) { - if (TextUtils.equals("特惠首冲", mBannerList4.get(p).getName())){ + if (TextUtils.equals("特惠首冲", mBannerList4.get(p).getName())) { Map map_ekv = new HashMap(); map_ekv.put("link", mBannerList4.get(p).getLink());