From b7c0f5d3ec0de31095127517490c8a74f8aeec8d Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Fri, 31 May 2024 10:30:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=88=98=E4=BB=A4=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=94=B9=E4=B8=BA=E9=80=9A=E8=BF=87=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/bean/AnchorRecommendModel.java | 20 +++++++++++++++++++ .../com/yunbao/common/utils/ViewUtils.java | 12 +++++++++++ .../yunbao/main/activity/MainActivity.java | 7 +++++++ .../main/res/layout/view_float_war_order.xml | 6 ++++-- 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/utils/ViewUtils.java diff --git a/common/src/main/java/com/yunbao/common/bean/AnchorRecommendModel.java b/common/src/main/java/com/yunbao/common/bean/AnchorRecommendModel.java index 8129692a6..d64458a2b 100644 --- a/common/src/main/java/com/yunbao/common/bean/AnchorRecommendModel.java +++ b/common/src/main/java/com/yunbao/common/bean/AnchorRecommendModel.java @@ -24,6 +24,10 @@ public class AnchorRecommendModel extends BaseModel { @SerializedName("live_battle_pass_show_status") private int showWarOrder = 0;//是否显示首页戰令 + @SerializedName("live_battle_pass_image_cn") + private String battlePassImageCn; + @SerializedName("live_battle_pass_image_en") + private String battlePassImageEn; //是否支持换一批0=不支持 1=支持 @SerializedName("up_show") @@ -58,6 +62,22 @@ public class AnchorRecommendModel extends BaseModel { return listShow; } + public String getBattlePassImageCn() { + return battlePassImageCn; + } + + public void setBattlePassImageCn(String battlePassImageCn) { + this.battlePassImageCn = battlePassImageCn; + } + + public String getBattlePassImageEn() { + return battlePassImageEn; + } + + public void setBattlePassImageEn(String battlePassImageEn) { + this.battlePassImageEn = battlePassImageEn; + } + public AnchorRecommendModel setListShow(int listShow) { this.listShow = listShow; return this; diff --git a/common/src/main/java/com/yunbao/common/utils/ViewUtils.java b/common/src/main/java/com/yunbao/common/utils/ViewUtils.java new file mode 100644 index 000000000..a36d8d4e4 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/utils/ViewUtils.java @@ -0,0 +1,12 @@ +package com.yunbao.common.utils; + +import android.view.View; + +public class ViewUtils { + public static T findViewById(View view,int id,Class clazz){ + return view.findViewById(id); + } + public static T findViewById(View view,int id){ + return view.findViewById(id); + } +} diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index ad4ebd3f5..4f645e18d 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -50,6 +50,7 @@ import com.tencent.imsdk.v2.V2TIMManager; import com.tencent.imsdk.v2.V2TIMSDKConfig; import com.tencent.imsdk.v2.V2TIMSDKListener; import com.tencent.imsdk.v2.V2TIMUserFullInfo; +import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; @@ -101,6 +102,7 @@ import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.VersionUtil; +import com.yunbao.common.utils.ViewUtils; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.APKUpdateCustomPopup; import com.yunbao.common.views.AbsMainViewHolder; @@ -664,6 +666,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene floatWarOrder.setTag(null); } else { floatWarOrder.setVisibility(View.VISIBLE); + if (WordUtil.isNewZh()) { + ImgLoader.display(mContext, data.getBattlePassImageCn(), ViewUtils.findViewById(floatWarOrder, R.id.battleImage, ImageView.class)); + } else { + ImgLoader.display(mContext, data.getBattlePassImageEn(), ViewUtils.findViewById(floatWarOrder, R.id.battleImage, ImageView.class)); + } floatWarOrder.setTag(data); } diff --git a/main/src/main/res/layout/view_float_war_order.xml b/main/src/main/res/layout/view_float_war_order.xml index 0a867ba7e..196d78132 100644 --- a/main/src/main/res/layout/view_float_war_order.xml +++ b/main/src/main/res/layout/view_float_war_order.xml @@ -2,10 +2,12 @@ + + android:layout_height="61.5dp" + android:src="@mipmap/icon_bp_flot" />