fix:礼物名称 动态适配多语言

This commit is contained in:
max
2024-07-11 11:24:18 +08:00
parent e7b73a2961
commit bc48cc86a9
9 changed files with 44 additions and 10 deletions

View File

@@ -2286,7 +2286,7 @@ public class MessageView extends FrameLayout {
})
.append(ResUtil.getString(R.string.gift_message_01), new ForegroundColorSpan(getResources().getColor(R.color.white)));
text.append(luckyGiftInfo.getGiftName() + ResUtil.getString(R.string.gift_message_02), new ForegroundColorSpan(getResources().getColor(R.color.white)))
text.append(luckyGiftInfo.getFirstGiftName() + ResUtil.getString(R.string.gift_message_02), new ForegroundColorSpan(getResources().getColor(R.color.white)))
.append(luckyGiftInfo.getUser().getNick(), new ForegroundColorSpan(roomTipNickColor), new OriginalDrawStatusClickSpan() {
@Override
public void onClick(@NonNull View widget) {
@@ -2341,7 +2341,7 @@ public class MessageView extends FrameLayout {
})
.append(ResUtil.getString(R.string.gift_message_01), new ForegroundColorSpan(getResources().getColor(R.color.white)));
text.append(luckyGiftInfo.getGiftName() + ResUtil.getString(R.string.gift_message_02), new ForegroundColorSpan(getResources().getColor(R.color.white)))
text.append(luckyGiftInfo.getFirstGiftName() + ResUtil.getString(R.string.gift_message_02), new ForegroundColorSpan(getResources().getColor(R.color.white)))
.append(luckyGiftInfo.getUser().getNick(), new ForegroundColorSpan(roomTipNickColor), new OriginalDrawStatusClickSpan() {
@Override
public void onClick(@NonNull View widget) {

View File

@@ -71,6 +71,11 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
*/
public boolean isSuperLuckyGift;
/**
* 礼物名称
*/
public String giftName;
public GiftInfoVm(Context context, GiftInfo data, boolean select, boolean isKnap) {
super(context, data);
this.isSelect.set(select);
@@ -110,6 +115,7 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
SimpleVipInfo vipInfo = data.getGiftVipInfo();
isLocked = vipInfo != null && VipHelper.getMyVipLevel() < vipInfo.getVipLevel();
vipIcon = vipInfo == null ? "" : vipInfo.getVipIcon();
giftName = data.getFirstGiftName();
}
@Override

View File

@@ -54,7 +54,7 @@
android:layout_below="@id/gift_image"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:text="@{item.data().giftName}"
android:text="@{item.giftName}"
android:textColor="@{item.isSelect ? @color/color_ffb606 : @color/white}"
android:textSize="@dimen/dp_10"
android:maxLines="2"