fix:调整福袋飘屏 多语言文案问题

This commit is contained in:
max
2024-04-22 20:54:35 +08:00
parent 99e85366b3
commit 696dc32234
8 changed files with 27 additions and 14 deletions

View File

@@ -1,7 +1,6 @@
package com.chwl.app.notify.views
import android.content.Context
import android.util.Log
import android.view.LayoutInflater
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
@@ -16,6 +15,7 @@ import com.chwl.core.utils.extension.subAndReplaceDot
import com.example.lib_utils.ktx.getColorById
import com.example.lib_utils.ktx.singleClick
import com.example.lib_utils.spannable.SpannableTextBuilder
import java.text.MessageFormat
class LuckyBagGiftNotify(context: Context) : BaseFloatView(context) {
private val view = TextView(context)
@@ -61,11 +61,17 @@ class LuckyBagGiftNotify(context: Context) : BaseFloatView(context) {
val price = data.goldPrice
val num = data.giftNum.toString()
val message = if (data.giftNum > 1) {
context.getString(R.string.lucky_gift_message_format)
.format(userName, bagName, price, giftName, num)
MessageFormat.format(
context.getString(R.string.gift_message_08), userName, bagName, price, giftName, num
)
} else {
context.getString(R.string.lucky_gift_message_format)
.format(userName, bagName, price, giftName)
MessageFormat.format(
context.getString(R.string.gift_message_07),
userName,
bagName,
price,
giftName
)
}
SpannableTextBuilder(binding.tvMessage).appendText(message)
.setTextStyle(

View File

@@ -537,7 +537,11 @@
android:background="@drawable/bg_magic_dialog_button_send"
android:text="@string/layout_dialog_bottom_gift_010"
android:textColor="@color/white"
android:textSize="@dimen/sp_13" />
android:textSize="@dimen/sp_13"
app:autoSizeMaxTextSize="@dimen/sp_13"
app:autoSizeMinTextSize="@dimen/dp_8"
app:autoSizeStepGranularity="1px"
app:autoSizeTextType="uniform" />
</LinearLayout>
</RelativeLayout>

View File

@@ -45,6 +45,7 @@
tools:src="@drawable/default_avatar" />
<TextView
android:textDirection="locale"
android:id="@+id/tv_message"
android:layout_width="0dp"
android:layout_height="wrap_content"

View File

@@ -49,6 +49,7 @@
android:gravity="center"
android:maxLines="2"
android:textColor="@color/white"
android:textDirection="locale"
android:textSize="@dimen/dp_12"
app:layout_constraintEnd_toStartOf="@id/iv_gift"
app:layout_constraintStart_toEndOf="@id/iv_bag"

View File

@@ -17,6 +17,7 @@
<com.coorchice.library.SuperTextView
android:id="@+id/tv_text"
android:layout_width="0dp"
android:textDirection="locale"
android:layout_height="0dp"
android:layout_gravity="center"
android:ellipsize="end"

View File

@@ -5252,14 +5252,13 @@
<string name="diamonds_01">(نقود)</string>
<string name="total_revenue_01">إجمالي العائدات (نقود)</string>
<string name="all_gift_message_format">%1$s تقديم إلى %2$s %3$s</string>
<string name="lucky_gift_message_format">%1$s الحظ لا يُصدق! تم الحصول على %4$s بقيمة %3$s عملة ذهبية في %2$s</string>
<string name="lucky_gift_message_format2">%1$s الحظ لا يُصدق! تم الحصول على %4$sX%5$s بقيمة %3$s عملة ذهبية في %2$s</string>
<string name="gift_message_01">تقديم</string>
<string name="gift_message_02">إلى</string>
<string name="gift_message_03">قيمة</string>
<string name="gift_message_04">,ظهرت</string>
<string name="gift_message_05">هدية من العملات الذهبية</string>
<string name="gift_message_06">تقديم إلى </string>
<string name="gift_message_07">{0} محظوظ للغاية! تم فتح {3} بقيمة {2} من العملات الذهبية في {1}</string>
<string name="gift_message_08">{0} محظوظ للغاية! تم فتح {4}X{3} بقيمة {2} من العملات الذهبية في {1}</string>
<string name="send_gift_vip_level_tips">أنت لم تصل إلى المستوى الـ VIP المطلوب لإرسال %1$s. المستوى الـ VIP المطلوب: %2$s</string>
</resources>

View File

@@ -5194,8 +5194,6 @@
<string name="total_revenue_01">總收入(金幣)</string>
<string name="slogan">来遇见你的专属声音</string>
<string name="all_gift_message_format">%1$s 送给 %2$s %3$s</string>
<string name="lucky_gift_message_format">%1$s運氣爆表在%2$s中開出了價值%3$s金币的%4$s</string>
<string name="lucky_gift_message_format2">%1$s運氣爆表在%2$s中開出了價值%3$s金币的%4$sX%5$s</string>
<string name="gift_message_01">送出</string>
<string name="gift_message_02"></string>
<string name="gift_message_03">價值</string>
@@ -5203,4 +5201,6 @@
<string name="gift_message_05">金幣的禮物</string>
<string name="gift_message_06">送给</string>
<string name="send_gift_vip_level_tips">尚未達到贈送%1$s所需VIP等級,所需VIP等級:%2$s</string>
<string name="gift_message_07">{0}運氣爆表!在{1}中開出了價值{2}金币的{3}</string>
<string name="gift_message_08">{0}運氣爆表!在{1}中開出了價值{2}金币的{3}X{4}</string>
</resources>

View File

@@ -5229,8 +5229,6 @@
<string name="avroom_widget_messageview_0123">shared room</string>
<string name="im_chat_msgviewholdertext_04">A little heart has been sent to the other party~</string>
<string name="all_gift_message_format">%1$s give to %2$s %3$s</string>
<string name="lucky_gift_message_format">%1$s Luck is off the charts! A %4$s worth %3$s gold coins was obtained in %2$s</string>
<string name="lucky_gift_message_format2">%1$s Luck is off the charts! A %4$sX%5$s worth %3$s gold coins was obtained in %2$s</string>
<string name="gift_message_01">send out</string>
<string name="gift_message_02">give</string>
<string name="gift_message_03">value</string>
@@ -5238,6 +5236,10 @@
<string name="gift_message_05">gift of gold coins</string>
<string name="gift_message_06">give to</string>
<string name="send_gift_vip_level_tips">You have not reached the required VIP level to send %1$s. Required VIP level: %2$s</string>
<string name="gift_message_07">{0} Amazing Luck! Opened a {1} worth {2} Coins in {3}</string>
<string name="gift_message_08">{0} Amazing Luck! Opened a {1} worth {2} Coins in {3} X{4}</string>
</resources>
@@ -5259,6 +5261,5 @@