From c42b3db7d2a7c4ef62a670a8edcad5e14ab07ae0 Mon Sep 17 00:00:00 2001 From: ningwenqiang Date: Sun, 29 Sep 2024 10:57:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BC=E7=89=A9=E6=9D=A1=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=A4=B4=20=E8=8B=B1=E6=96=87=E7=9A=84?= =?UTF-8?q?=E6=94=B9=E5=9B=9E=E5=8E=9F=E6=9D=A5=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/layout/view_live_gift_number.xml | 2 +- .../res/layout/view_live_gift_number2.xml | 46 +++++++++++++++++++ .../yunbao/live/adapter/GiftTitleAdapter.java | 15 ++++-- .../yunbao/live/dialog/LiveGiftPopup2.java | 6 +-- live/src/main/res/layout/item_gift_top.xml | 1 + 5 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 common/src/main/res/layout/view_live_gift_number2.xml diff --git a/common/src/main/res/layout/view_live_gift_number.xml b/common/src/main/res/layout/view_live_gift_number.xml index 8d9958c16..ff35975e1 100644 --- a/common/src/main/res/layout/view_live_gift_number.xml +++ b/common/src/main/res/layout/view_live_gift_number.xml @@ -6,7 +6,7 @@ android:background="@color/transparent" android:orientation="vertical" tools:ignore="MissingDefaultResource"> - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java b/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java index f45ffb195..53b2baea7 100644 --- a/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java @@ -8,6 +8,7 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.live.R; import com.yunbao.live.bean.GiftTopBean; import com.yunbao.live.views.GiftTitleViewHolder; @@ -16,6 +17,7 @@ import net.lucode.hackware.magicindicator.buildins.UIUtil; import java.util.ArrayList; import java.util.List; +import java.util.Locale; /** * @@ -38,10 +40,15 @@ public class GiftTitleAdapter extends RecyclerView.Adapter { @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { - View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_top_new, parent, false); - ViewGroup.LayoutParams layoutParams = herdView.getLayoutParams(); - layoutParams.width=getItemWidth(parent.getContext()); - herdView.setLayoutParams(layoutParams); + View herdView; + if (IMLoginManager.get(parent.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { + herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_top_new, parent, false); + ViewGroup.LayoutParams layoutParams = herdView.getLayoutParams(); + layoutParams.width = getItemWidth(parent.getContext()); + herdView.setLayoutParams(layoutParams); + } else { + herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_top, parent, false); + } return new GiftTitleViewHolder(herdView); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java index b453a10b5..dae0f6b05 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java @@ -998,17 +998,17 @@ public class LiveGiftPopup2 extends AbsDialogFragment { BigDecimal maxLeve = new BigDecimal(coinModel.getUserLevelUpgrades()).add(new BigDecimal(coinModel.getUserLevelCurrentConsumption())); try { String leveNext = String.valueOf(nextLeve); - String userNextLevel = coinModel.getUserLevelUpgrades(); + String userNextLevel = String.valueOf(Integer.parseInt(coinModel.getUserLevel())+1); StringBuffer stringBuffer = new StringBuffer(); if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { stringBuffer.append("升至Lv") - .append(coinModel.getUserLevel()+1) + .append(userNextLevel) .append("還需") .append(leveNext) .append("經驗值"); } else { stringBuffer.append("Up to Lv") - .append(coinModel.getUserLevel()+1) + .append(userNextLevel) .append("need") .append(leveNext) .append("experience"); diff --git a/live/src/main/res/layout/item_gift_top.xml b/live/src/main/res/layout/item_gift_top.xml index 11bf252d8..76237629d 100644 --- a/live/src/main/res/layout/item_gift_top.xml +++ b/live/src/main/res/layout/item_gift_top.xml @@ -12,6 +12,7 @@ android:paddingLeft="20dp" android:paddingRight="10dp" android:text="@string/live_wrap" + android:textStyle="bold" android:textColor="@color/white" android:textSize="14sp" />