diff --git a/app/src/main/assets/svga/all_fairy_ar.svga b/app/src/main/assets/svga/all_fairy_ar.svga new file mode 100644 index 000000000..fe0035411 Binary files /dev/null and b/app/src/main/assets/svga/all_fairy_ar.svga differ diff --git a/app/src/main/assets/svga/all_fairy_en.svga b/app/src/main/assets/svga/all_fairy_en.svga new file mode 100644 index 000000000..526baa5a1 Binary files /dev/null and b/app/src/main/assets/svga/all_fairy_en.svga differ diff --git a/app/src/main/assets/svga/all_fairy_in.svga b/app/src/main/assets/svga/all_fairy_in.svga new file mode 100644 index 000000000..a86425fac Binary files /dev/null and b/app/src/main/assets/svga/all_fairy_in.svga differ diff --git a/app/src/main/assets/svga/all_fairy_tr.svga b/app/src/main/assets/svga/all_fairy_tr.svga new file mode 100644 index 000000000..56bd22a29 Binary files /dev/null and b/app/src/main/assets/svga/all_fairy_tr.svga differ diff --git a/app/src/main/assets/svga/lucky_gift_notify_ar.svga b/app/src/main/assets/svga/lucky_gift_notify_ar.svga new file mode 100644 index 000000000..4e93e1150 Binary files /dev/null and b/app/src/main/assets/svga/lucky_gift_notify_ar.svga differ diff --git a/app/src/main/assets/svga/lucky_gift_notify_en.svga b/app/src/main/assets/svga/lucky_gift_notify_en.svga new file mode 100644 index 000000000..c80631707 Binary files /dev/null and b/app/src/main/assets/svga/lucky_gift_notify_en.svga differ diff --git a/app/src/main/assets/svga/lucky_gift_notify_in.svga b/app/src/main/assets/svga/lucky_gift_notify_in.svga new file mode 100644 index 000000000..49a55213f Binary files /dev/null and b/app/src/main/assets/svga/lucky_gift_notify_in.svga differ diff --git a/app/src/main/assets/svga/lucky_gift_notify_tr.svga b/app/src/main/assets/svga/lucky_gift_notify_tr.svga new file mode 100644 index 000000000..a78d8c18a Binary files /dev/null and b/app/src/main/assets/svga/lucky_gift_notify_tr.svga differ diff --git a/app/src/main/java/com/yizhuan/erban/avroom/widget/RoomEffectView.kt b/app/src/main/java/com/yizhuan/erban/avroom/widget/RoomEffectView.kt index 57a020683..cb0ad0f90 100644 --- a/app/src/main/java/com/yizhuan/erban/avroom/widget/RoomEffectView.kt +++ b/app/src/main/java/com/yizhuan/erban/avroom/widget/RoomEffectView.kt @@ -62,6 +62,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable import java.net.MalformedURLException import java.net.URL +import java.util.* import java.util.concurrent.TimeUnit /** @@ -249,7 +250,7 @@ class RoomEffectView @JvmOverloads constructor( } /** - * 幸运池飘屏 + * 夺宝精灵飘屏 * * @param chatRoomMessage */ @@ -270,6 +271,9 @@ class RoomEffectView @JvmOverloads constructor( } } + /** + * 夺宝精灵SVGA + */ private fun showFairyNotify(pair: Pair) { val attachment = pair.second.attachment as FairyMsgAttachment when (pair.first) { @@ -291,13 +295,38 @@ class RoomEffectView @JvmOverloads constructor( } RoomEvent.FAIRY_DRAW_GIFT_L5, RoomEvent.FAIRY_CONVERT_L3 -> { - showFairyNotifyBySVGA(pair) + when (Locale.getDefault().language) { + "ar" -> { + showFairyNotifyBySVGA(pair, "svga/all_fairy_ar.svga") + } + "en" -> { + showFairyNotifyBySVGA(pair, "svga/all_fairy_en.svga") + } + "in" -> { + showFairyNotifyBySVGA(pair, "svga/all_fairy_in.svga") + } + "tr" -> { + showFairyNotifyBySVGA(pair, "svga/all_fairy_tr.svga") + } + "zh" ->{ + showFairyNotifyBySVGA(pair, "svga/all_fairy.svga") + } + "zh-rTW" ->{ + showFairyNotifyBySVGA(pair, "svga/all_fairy.svga") + } + else -> { + showFairyNotifyBySVGA(pair, "svga/all_fairy_en.svga") + } + } } } } - private fun showFairyNotifyBySVGA(pair: Pair) { + /** + * 夺宝精灵SVGA + */ + private fun showFairyNotifyBySVGA(pair: Pair, svgaName: String) { val attachment = pair.second.attachment as FairyMsgAttachment val text = MsgBuilder.buildFairyMsg(pair.first, attachment) val svgaImageView = SVGAImageView(mContext) @@ -316,7 +345,7 @@ class RoomEffectView @JvmOverloads constructor( } binding.flFairyNotify.addView(svgaImageView) shareParser().decodeFromAssets( - "svga/all_fairy.svga", + svgaName, object : SVGAParser.ParseCompletion { override fun onComplete(videoItem: SVGAVideoEntity) { val dynamicEntity = SVGADynamicEntity() @@ -442,14 +471,34 @@ class RoomEffectView @JvmOverloads constructor( .observeOn(AndroidSchedulers.mainThread()) .takeWhile { messagesLuckyGift.size > 0 } .subscribe { - showLuckyBagNotify( - messagesLuckyGift.removeAt(0) - ) + when (Locale.getDefault().language) { + "ar" -> { + showLuckyBagNotify(messagesLuckyGift.removeAt(0),"svga/lucky_gift_notify_ar.svga") + } + "en" -> { + showLuckyBagNotify(messagesLuckyGift.removeAt(0),"svga/lucky_gift_notify_en.svga") + } + "in" -> { + showLuckyBagNotify(messagesLuckyGift.removeAt(0),"svga/lucky_gift_notify_in.svga") + } + "tr" -> { + showLuckyBagNotify(messagesLuckyGift.removeAt(0),"svga/lucky_gift_notify_tr.svga") + } + "zh" ->{ + showLuckyBagNotify(messagesLuckyGift.removeAt(0),"svga/lucky_gift_notify.svga") + } + "zh-rTW" ->{ + showLuckyBagNotify(messagesLuckyGift.removeAt(0),"svga/lucky_gift_notify.svga") + } + else -> { + showLuckyBagNotify(messagesLuckyGift.removeAt(0),"svga/lucky_gift_notify_en.svga") + } + } } } } - private fun showLuckyBagNotify(message: ChatRoomMessage?) { + private fun showLuckyBagNotify(message: ChatRoomMessage?, svgaName: String) { val attachment = message?.attachment as? RoomReceivedLuckyGiftAttachment ?: return val noticeInfo = attachment.luckyBagNoticeInfo ?: return val text = SpannableBuilder() @@ -490,7 +539,7 @@ class RoomEffectView @JvmOverloads constructor( svgaImageView.loops = 1 svgaImageView.clearsAfterStop = true shareParser().decodeFromAssets( - "svga/lucky_gift_notify.svga", + svgaName, object : SVGAParser.ParseCompletion { override fun onComplete(videoItem: SVGAVideoEntity) { binding.flLuckyGiftNotify.addView(svgaImageView) @@ -1654,7 +1703,10 @@ class RoomEffectView @JvmOverloads constructor( ResUtil.getString(R.string.avroom_widget_roomeffectview_025), ForegroundColorSpan(Color.WHITE) ) - .append("「${msgBean.title}」${ResUtil.getString(R.string.room)}", ForegroundColorSpan(Color.parseColor("#FFFC4C"))) + .append( + "「${msgBean.title}」${ResUtil.getString(R.string.room)}", + ForegroundColorSpan(Color.parseColor("#FFFC4C")) + ) .append(msgBean.desc, ForegroundColorSpan(Color.WHITE)) .append("TOP1", ForegroundColorSpan(Color.parseColor("#FFFC4C"))) textView.text = text.build() diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 41cbc8933..a8e043537 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1500,7 +1500,7 @@ 遊戲中不可以切換遊戲或玩法! 遊戲中不可以切換遊戲或玩法! 請關閉其他模式再切換遊戲! - 交朋友 + 擴列交友 管理員已關閉聊天公屏 禮物特效 收藏成功! diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 41cbc8933..a8e043537 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -1500,7 +1500,7 @@ 遊戲中不可以切換遊戲或玩法! 遊戲中不可以切換遊戲或玩法! 請關閉其他模式再切換遊戲! - 交朋友 + 擴列交友 管理員已關閉聊天公屏 禮物特效 收藏成功!