fix:欢乐砸蛋公屏文案调整(1.寻爱之旅换欢乐砸蛋2.欢乐砸蛋暂时不需要翻译)
This commit is contained in:
@@ -2001,15 +2001,15 @@ public class MessageView extends FrameLayout {
|
||||
RoomBoxPrizeAttachment attachment = (RoomBoxPrizeAttachment) chatRoomMessage.getAttachment();
|
||||
// 內容
|
||||
SpannableBuilder text = new SpannableBuilder(tvContent)
|
||||
.append(ResUtil.getString(R.string.avroom_widget_messageview_093), new ForegroundColorSpan(greyColor))
|
||||
.append("厲害了 ", new ForegroundColorSpan(greyColor))
|
||||
.append(attachment.getNick() + " ", new ForegroundColorSpan(roomTipColor))
|
||||
.append(ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString(R.string.avroom_widget_messageview_095), new ForegroundColorSpan(greyColor))
|
||||
.append("通過歡樂砸蛋" + "獲得 ", new ForegroundColorSpan(greyColor))
|
||||
.append(attachment.getPrizeName(), new ForegroundColorSpan(Color.WHITE));
|
||||
if (attachment.getPrizeNum() > 1) {
|
||||
text.append(" x" + attachment.getPrizeNum() + " ", new ForegroundColorSpan(roomTipColor));
|
||||
}
|
||||
if (attachment.getSecond() == CUSTOM_MSG_SUB_BOX_ME) {
|
||||
text.append(ResUtil.getString(R.string.avroom_widget_messageview_096), new ForegroundColorSpan(Color.WHITE));
|
||||
text.append("(僅自己可見)", new ForegroundColorSpan(Color.WHITE));
|
||||
}
|
||||
tvContent.setText(text.build());
|
||||
}
|
||||
|
@@ -305,143 +305,143 @@ class RoomEffectBoxView @JvmOverloads constructor(
|
||||
*
|
||||
* @param chatRoomMessage
|
||||
*/
|
||||
private fun addBoxNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
if (binding.clNotify.visibility == GONE) {
|
||||
binding.clNotify.visibility = VISIBLE
|
||||
}
|
||||
messagesBox.add(chatRoomMessage)
|
||||
if (boxDisposable == null || messagesBox.size == 1) {
|
||||
boxDisposable = Observable.interval(0, PERIOD.toLong(), TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.takeWhile { messagesBox.size > 0 && !mContext.isDestroyed() }
|
||||
.subscribe {
|
||||
if (binding.flBoxNotify.childCount == 0) {
|
||||
val msg = messagesBox.removeAt(0)
|
||||
val attachment = msg.attachment
|
||||
if (attachment is CustomAttachment) {
|
||||
if (attachment.second == CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY) {
|
||||
showBoxNotify(msg)
|
||||
} else if(attachment.second == CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA) {
|
||||
showBoxNotifyBySVGA(msg)
|
||||
}
|
||||
// private fun addBoxNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
// if (binding.clNotify.visibility == GONE) {
|
||||
// binding.clNotify.visibility = VISIBLE
|
||||
// }
|
||||
// messagesBox.add(chatRoomMessage)
|
||||
// if (boxDisposable == null || messagesBox.size == 1) {
|
||||
// boxDisposable = Observable.interval(0, PERIOD.toLong(), TimeUnit.MILLISECONDS)
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .takeWhile { messagesBox.size > 0 && !mContext.isDestroyed() }
|
||||
// .subscribe {
|
||||
// if (binding.flBoxNotify.childCount == 0) {
|
||||
// val msg = messagesBox.removeAt(0)
|
||||
// val attachment = msg.attachment
|
||||
// if (attachment is CustomAttachment) {
|
||||
// if (attachment.second == CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY) {
|
||||
// showBoxNotify(msg)
|
||||
// } else if(attachment.second == CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA) {
|
||||
// showBoxNotifyBySVGA(msg)
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// private fun showBoxNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
// val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment
|
||||
// val textView =
|
||||
// LayoutInflater.from(mContext).inflate(R.layout.layout_room_box_notify, null) as TextView
|
||||
// val text = SpannableBuilder()
|
||||
// .append(
|
||||
// ResUtil.getString(R.string.avroom_widget_roomeffectview_08),
|
||||
// ForegroundColorSpan(Color.WHITE)
|
||||
// )
|
||||
// .append(
|
||||
// attachment.nick.subAndReplaceDot(8),
|
||||
// ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
// )
|
||||
// .append(
|
||||
// ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString(
|
||||
// R.string.avroom_widget_roomeffectview_010
|
||||
// ), ForegroundColorSpan(Color.WHITE)
|
||||
// )
|
||||
// .append(
|
||||
// attachment.prizeName,
|
||||
// ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
// )
|
||||
// if (attachment.prizeNum > 1) {
|
||||
// text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
|
||||
// }
|
||||
// textView.text = text.build()
|
||||
// animationBox = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
// binding.flBoxNotify.addView(textView)
|
||||
// textView.startAnimation(animationBox)
|
||||
// binding.flBoxNotify.postDelayed(
|
||||
// {
|
||||
// animationBox = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
// textView.startAnimation(animationBox)
|
||||
// },
|
||||
// SHOW_TIME.toLong()
|
||||
// )
|
||||
// binding.flBoxNotify.postDelayed({
|
||||
// binding.flBoxNotify.removeView(textView)
|
||||
// }, CLOSE_TIME.toLong())
|
||||
// }
|
||||
|
||||
private fun showBoxNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment
|
||||
val textView =
|
||||
LayoutInflater.from(mContext).inflate(R.layout.layout_room_box_notify, null) as TextView
|
||||
val text = SpannableBuilder()
|
||||
.append(
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_08),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
attachment.nick.subAndReplaceDot(8),
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString(
|
||||
R.string.avroom_widget_roomeffectview_010
|
||||
), ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
attachment.prizeName,
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
if (attachment.prizeNum > 1) {
|
||||
text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
|
||||
}
|
||||
textView.text = text.build()
|
||||
animationBox = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
binding.flBoxNotify.addView(textView)
|
||||
textView.startAnimation(animationBox)
|
||||
binding.flBoxNotify.postDelayed(
|
||||
{
|
||||
animationBox = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
textView.startAnimation(animationBox)
|
||||
},
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
binding.flBoxNotify.postDelayed({
|
||||
binding.flBoxNotify.removeView(textView)
|
||||
}, CLOSE_TIME.toLong())
|
||||
}
|
||||
|
||||
private fun showBoxNotifyBySVGA(chatRoomMessage: ChatRoomMessage) {
|
||||
val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment
|
||||
val text = SpannableBuilder()
|
||||
.append(
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_011),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
StringUtils.abbreviate(attachment.nick, 8) + " ",
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString(
|
||||
R.string.avroom_widget_roomeffectview_013
|
||||
), ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
attachment.prizeName,
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
if (attachment.prizeNum > 1) {
|
||||
text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
|
||||
}
|
||||
val svgaImageView = SVGAImageView(mContext)
|
||||
svgaImageView.loops = 1
|
||||
svgaImageView.clearsAfterDetached = true
|
||||
val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
||||
svgaImageView.layoutParams = params
|
||||
svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
override fun onFinished() {
|
||||
animationBox = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
animationBox!!.setAnimationListener(object : SimpleAnimationListener() {
|
||||
override fun onAnimationEnd(animation: Animation?) {
|
||||
binding.flBoxNotify.removeView(svgaImageView)
|
||||
}
|
||||
})
|
||||
binding.flBoxNotify.startAnimation(animationBox)
|
||||
}
|
||||
}
|
||||
animationBox = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
binding.flBoxNotify.addView(svgaImageView)
|
||||
binding.flBoxNotify.startAnimation(animationBox)
|
||||
|
||||
shareParser().decodeFromAssets("svga/box_notify.svga", object : SVGAParser.ParseCompletion {
|
||||
override fun onComplete(videoItem: SVGAVideoEntity) {
|
||||
val dynamicEntity = SVGADynamicEntity()
|
||||
val textPaint = TextPaint()
|
||||
textPaint.color = Color.WHITE //字體顏色
|
||||
textPaint.textSize = 24f //字體大小
|
||||
dynamicEntity.setDynamicText(
|
||||
StaticLayout(
|
||||
text.build(),
|
||||
0,
|
||||
text.build().length,
|
||||
textPaint,
|
||||
0,
|
||||
Layout.Alignment.ALIGN_CENTER,
|
||||
1.0f,
|
||||
0.0f,
|
||||
false
|
||||
), "bg"
|
||||
)
|
||||
val drawable = SVGADrawable(videoItem, dynamicEntity)
|
||||
svgaImageView.setImageDrawable(drawable)
|
||||
svgaImageView.stepToFrame(0, true)
|
||||
}
|
||||
|
||||
override fun onError() {}
|
||||
}, null)
|
||||
}
|
||||
// private fun showBoxNotifyBySVGA(chatRoomMessage: ChatRoomMessage) {
|
||||
// val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment
|
||||
// val text = SpannableBuilder()
|
||||
// .append(
|
||||
// ResUtil.getString(R.string.avroom_widget_roomeffectview_011),
|
||||
// ForegroundColorSpan(Color.WHITE)
|
||||
// )
|
||||
// .append(
|
||||
// StringUtils.abbreviate(attachment.nick, 8) + " ",
|
||||
// ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
// )
|
||||
// .append(
|
||||
// ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString(
|
||||
// R.string.avroom_widget_roomeffectview_013
|
||||
// ), ForegroundColorSpan(Color.WHITE)
|
||||
// )
|
||||
// .append(
|
||||
// attachment.prizeName,
|
||||
// ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
// )
|
||||
// if (attachment.prizeNum > 1) {
|
||||
// text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
|
||||
// }
|
||||
// val svgaImageView = SVGAImageView(mContext)
|
||||
// svgaImageView.loops = 1
|
||||
// svgaImageView.clearsAfterDetached = true
|
||||
// val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
||||
// svgaImageView.layoutParams = params
|
||||
// svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
// override fun onFinished() {
|
||||
// animationBox = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
// animationBox!!.setAnimationListener(object : SimpleAnimationListener() {
|
||||
// override fun onAnimationEnd(animation: Animation?) {
|
||||
// binding.flBoxNotify.removeView(svgaImageView)
|
||||
// }
|
||||
// })
|
||||
// binding.flBoxNotify.startAnimation(animationBox)
|
||||
// }
|
||||
// }
|
||||
// animationBox = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
// binding.flBoxNotify.addView(svgaImageView)
|
||||
// binding.flBoxNotify.startAnimation(animationBox)
|
||||
//
|
||||
// shareParser().decodeFromAssets("svga/box_notify.svga", object : SVGAParser.ParseCompletion {
|
||||
// override fun onComplete(videoItem: SVGAVideoEntity) {
|
||||
// val dynamicEntity = SVGADynamicEntity()
|
||||
// val textPaint = TextPaint()
|
||||
// textPaint.color = Color.WHITE //字體顏色
|
||||
// textPaint.textSize = 24f //字體大小
|
||||
// dynamicEntity.setDynamicText(
|
||||
// StaticLayout(
|
||||
// text.build(),
|
||||
// 0,
|
||||
// text.build().length,
|
||||
// textPaint,
|
||||
// 0,
|
||||
// Layout.Alignment.ALIGN_CENTER,
|
||||
// 1.0f,
|
||||
// 0.0f,
|
||||
// false
|
||||
// ), "bg"
|
||||
// )
|
||||
// val drawable = SVGADrawable(videoItem, dynamicEntity)
|
||||
// svgaImageView.setImageDrawable(drawable)
|
||||
// svgaImageView.stepToFrame(0, true)
|
||||
// }
|
||||
//
|
||||
// override fun onError() {}
|
||||
// }, null)
|
||||
// }
|
||||
|
||||
/**
|
||||
* 幸運池飄屏
|
||||
|
@@ -287,57 +287,57 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
when (messagesPlay[0].event) {
|
||||
RoomEvent.BOX_NOTIFY -> {//寻爱
|
||||
if ((mContext as AVRoomActivity).isTopActivity) {
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 180.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
} else {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 60.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
}
|
||||
showBoxNotify(
|
||||
messagesPlay.removeAt(0)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
RoomEvent.BOX_NOTIFY_SVGA -> {//寻爱
|
||||
if ((mContext as AVRoomActivity).isTopActivity) {
|
||||
isPlayAnim = true
|
||||
val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
if (isPlay) {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 180.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
} else {
|
||||
margin(
|
||||
binding.clNotify,
|
||||
0,
|
||||
UIUtil.dip2px(context, 60.0),
|
||||
0,
|
||||
0
|
||||
)
|
||||
}
|
||||
showBoxNotifyBySVGA(messagesPlay.removeAt(0))
|
||||
}
|
||||
}
|
||||
// RoomEvent.BOX_NOTIFY -> {//寻爱
|
||||
// if ((mContext as AVRoomActivity).isTopActivity) {
|
||||
// isPlayAnim = true
|
||||
// val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
// if (isPlay) {
|
||||
// margin(
|
||||
// binding.clNotify,
|
||||
// 0,
|
||||
// UIUtil.dip2px(context, 180.0),
|
||||
// 0,
|
||||
// 0
|
||||
// )
|
||||
// } else {
|
||||
// margin(
|
||||
// binding.clNotify,
|
||||
// 0,
|
||||
// UIUtil.dip2px(context, 60.0),
|
||||
// 0,
|
||||
// 0
|
||||
// )
|
||||
// }
|
||||
// showBoxNotify(
|
||||
// messagesPlay.removeAt(0)
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// RoomEvent.BOX_NOTIFY_SVGA -> {//寻爱
|
||||
// if ((mContext as AVRoomActivity).isTopActivity) {
|
||||
// isPlayAnim = true
|
||||
// val isPlay = onPlayAnimCallback?.invoke() ?: false
|
||||
// if (isPlay) {
|
||||
// margin(
|
||||
// binding.clNotify,
|
||||
// 0,
|
||||
// UIUtil.dip2px(context, 180.0),
|
||||
// 0,
|
||||
// 0
|
||||
// )
|
||||
// } else {
|
||||
// margin(
|
||||
// binding.clNotify,
|
||||
// 0,
|
||||
// UIUtil.dip2px(context, 60.0),
|
||||
// 0,
|
||||
// 0
|
||||
// )
|
||||
// }
|
||||
// showBoxNotifyBySVGA(messagesPlay.removeAt(0))
|
||||
// }
|
||||
// }
|
||||
|
||||
RoomEvent.TAROT_NOTIFY -> {
|
||||
if ((mContext as AVRoomActivity).isTopActivity) {
|
||||
@@ -966,49 +966,49 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
isPlayAnim = false
|
||||
}, CLOSE_TIME.toLong())
|
||||
}
|
||||
|
||||
private fun showBoxNotify(roomPlayBean: RoomPlayBean) {
|
||||
val chatRoomMessage = roomPlayBean.chatRoomMessage
|
||||
val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment
|
||||
val textView =
|
||||
LayoutInflater.from(mContext).inflate(R.layout.layout_room_box_notify, null) as TextView
|
||||
val text = SpannableBuilder()
|
||||
.append(
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_08),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
attachment.nick.subAndReplaceDot(8),
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString(
|
||||
R.string.avroom_widget_roomeffectview_010
|
||||
), ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
attachment.prizeName,
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
if (attachment.prizeNum > 1) {
|
||||
text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
|
||||
}
|
||||
textView.text = text.build()
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
binding.flPlayNotify.addView(textView)
|
||||
textView.startAnimation(animationPlay)
|
||||
binding.flPlayNotify.postDelayed(
|
||||
{
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
textView.startAnimation(animationPlay)
|
||||
},
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
binding.flPlayNotify.postDelayed({
|
||||
binding.flPlayNotify.removeView(textView)
|
||||
isPlayAnim = false
|
||||
}, CLOSE_TIME.toLong())
|
||||
}
|
||||
//
|
||||
// private fun showBoxNotify(roomPlayBean: RoomPlayBean) {
|
||||
// val chatRoomMessage = roomPlayBean.chatRoomMessage
|
||||
// val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment
|
||||
// val textView =
|
||||
// LayoutInflater.from(mContext).inflate(R.layout.layout_room_box_notify, null) as TextView
|
||||
// val text = SpannableBuilder()
|
||||
// .append(
|
||||
// ResUtil.getString(R.string.avroom_widget_roomeffectview_08),
|
||||
// ForegroundColorSpan(Color.WHITE)
|
||||
// )
|
||||
// .append(
|
||||
// attachment.nick.subAndReplaceDot(8),
|
||||
// ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
// )
|
||||
// .append(
|
||||
// ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString(
|
||||
// R.string.avroom_widget_roomeffectview_010
|
||||
// ), ForegroundColorSpan(Color.WHITE)
|
||||
// )
|
||||
// .append(
|
||||
// attachment.prizeName,
|
||||
// ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
// )
|
||||
// if (attachment.prizeNum > 1) {
|
||||
// text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
|
||||
// }
|
||||
// textView.text = text.build()
|
||||
// animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
// binding.flPlayNotify.addView(textView)
|
||||
// textView.startAnimation(animationPlay)
|
||||
// binding.flPlayNotify.postDelayed(
|
||||
// {
|
||||
// animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
// textView.startAnimation(animationPlay)
|
||||
// },
|
||||
// SHOW_TIME.toLong()
|
||||
// )
|
||||
// binding.flPlayNotify.postDelayed({
|
||||
// binding.flPlayNotify.removeView(textView)
|
||||
// isPlayAnim = false
|
||||
// }, CLOSE_TIME.toLong())
|
||||
// }
|
||||
|
||||
private fun showTarotNotifyBySVGA(roomPlayBean: RoomPlayBean) {
|
||||
val chatRoomMessage = roomPlayBean.chatRoomMessage
|
||||
@@ -1066,78 +1066,78 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
)
|
||||
}
|
||||
|
||||
private fun showBoxNotifyBySVGA(roomPlayBean: RoomPlayBean) {
|
||||
val chatRoomMessage = roomPlayBean.chatRoomMessage
|
||||
val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment
|
||||
val text = SpannableBuilder()
|
||||
.append(
|
||||
ResUtil.getString(R.string.avroom_widget_roomeffectview_011),
|
||||
ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
StringUtils.abbreviate(attachment.nick, 8) + " ",
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
.append(
|
||||
ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString(
|
||||
R.string.avroom_widget_roomeffectview_013
|
||||
), ForegroundColorSpan(Color.WHITE)
|
||||
)
|
||||
.append(
|
||||
attachment.prizeName,
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
if (attachment.prizeNum > 1) {
|
||||
text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
|
||||
}
|
||||
val svgaImageView = SVGAImageView(mContext)
|
||||
svgaImageView.loops = 1
|
||||
svgaImageView.clearsAfterDetached = true
|
||||
val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
||||
svgaImageView.layoutParams = params
|
||||
svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
override fun onFinished() {
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
animationPlay!!.setAnimationListener(object : SimpleAnimationListener() {
|
||||
override fun onAnimationEnd(animation: Animation?) {
|
||||
binding.flPlayNotify.removeView(svgaImageView)
|
||||
isPlayAnim = false
|
||||
}
|
||||
})
|
||||
binding.flPlayNotify.startAnimation(animationPlay)
|
||||
}
|
||||
}
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
binding.flPlayNotify.addView(svgaImageView)
|
||||
binding.flPlayNotify.startAnimation(animationPlay)
|
||||
|
||||
shareParser().decodeFromAssets("svga/box_notify.svga", object : SVGAParser.ParseCompletion {
|
||||
override fun onComplete(videoItem: SVGAVideoEntity) {
|
||||
val dynamicEntity = SVGADynamicEntity()
|
||||
val textPaint = TextPaint()
|
||||
textPaint.color = Color.WHITE //字體顏色
|
||||
textPaint.textSize = 24f //字體大小
|
||||
dynamicEntity.setDynamicText(
|
||||
StaticLayout(
|
||||
text.build(),
|
||||
0,
|
||||
text.build().length,
|
||||
textPaint,
|
||||
0,
|
||||
Layout.Alignment.ALIGN_CENTER,
|
||||
1.0f,
|
||||
0.0f,
|
||||
false
|
||||
), "bg"
|
||||
)
|
||||
val drawable = SVGADrawable(videoItem, dynamicEntity)
|
||||
svgaImageView.setImageDrawable(drawable)
|
||||
svgaImageView.stepToFrame(0, true)
|
||||
}
|
||||
|
||||
override fun onError() {}
|
||||
}, null)
|
||||
}
|
||||
// private fun showBoxNotifyBySVGA(roomPlayBean: RoomPlayBean) {
|
||||
// val chatRoomMessage = roomPlayBean.chatRoomMessage
|
||||
// val attachment = chatRoomMessage.attachment as RoomBoxPrizeAttachment
|
||||
// val text = SpannableBuilder()
|
||||
// .append(
|
||||
// ResUtil.getString(R.string.avroom_widget_roomeffectview_011),
|
||||
// ForegroundColorSpan(Color.WHITE)
|
||||
// )
|
||||
// .append(
|
||||
// StringUtils.abbreviate(attachment.nick, 8) + " ",
|
||||
// ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
// )
|
||||
// .append(
|
||||
// ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString(
|
||||
// R.string.avroom_widget_roomeffectview_013
|
||||
// ), ForegroundColorSpan(Color.WHITE)
|
||||
// )
|
||||
// .append(
|
||||
// attachment.prizeName,
|
||||
// ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
// )
|
||||
// if (attachment.prizeNum > 1) {
|
||||
// text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
|
||||
// }
|
||||
// val svgaImageView = SVGAImageView(mContext)
|
||||
// svgaImageView.loops = 1
|
||||
// svgaImageView.clearsAfterDetached = true
|
||||
// val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
||||
// svgaImageView.layoutParams = params
|
||||
// svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
// override fun onFinished() {
|
||||
// animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
// animationPlay!!.setAnimationListener(object : SimpleAnimationListener() {
|
||||
// override fun onAnimationEnd(animation: Animation?) {
|
||||
// binding.flPlayNotify.removeView(svgaImageView)
|
||||
// isPlayAnim = false
|
||||
// }
|
||||
// })
|
||||
// binding.flPlayNotify.startAnimation(animationPlay)
|
||||
// }
|
||||
// }
|
||||
// animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
// binding.flPlayNotify.addView(svgaImageView)
|
||||
// binding.flPlayNotify.startAnimation(animationPlay)
|
||||
//
|
||||
// shareParser().decodeFromAssets("svga/box_notify.svga", object : SVGAParser.ParseCompletion {
|
||||
// override fun onComplete(videoItem: SVGAVideoEntity) {
|
||||
// val dynamicEntity = SVGADynamicEntity()
|
||||
// val textPaint = TextPaint()
|
||||
// textPaint.color = Color.WHITE //字體顏色
|
||||
// textPaint.textSize = 24f //字體大小
|
||||
// dynamicEntity.setDynamicText(
|
||||
// StaticLayout(
|
||||
// text.build(),
|
||||
// 0,
|
||||
// text.build().length,
|
||||
// textPaint,
|
||||
// 0,
|
||||
// Layout.Alignment.ALIGN_CENTER,
|
||||
// 1.0f,
|
||||
// 0.0f,
|
||||
// false
|
||||
// ), "bg"
|
||||
// )
|
||||
// val drawable = SVGADrawable(videoItem, dynamicEntity)
|
||||
// svgaImageView.setImageDrawable(drawable)
|
||||
// svgaImageView.stepToFrame(0, true)
|
||||
// }
|
||||
//
|
||||
// override fun onError() {}
|
||||
// }, null)
|
||||
// }
|
||||
|
||||
/**
|
||||
* 幸運池飄屏
|
||||
|
@@ -5042,7 +5042,7 @@
|
||||
<string name="treasure_warm_prompt">تنبيه دافئ</string>
|
||||
<string name="treasure_diamond_balance_is_insufficient">رصيد الماس غير كاف، يرجى الشحن أولاً</string>
|
||||
<string name="treasure_to_charge">شحن الآن</string>
|
||||
<string name="treasure_in_find_love">من خلال رحلة البحث عن الحب</string>
|
||||
<string name="treasure_in_find_love"> من خلال كسر البيضة بفرح</string>
|
||||
<string name="give_application_storage_permission">يرجى منح إذن تخزين التطبيق لحفظ الصور بشكل طبيعي.</string>
|
||||
<string name="Recharge_failure">فشل الشحن، يرجى تسجيل الدخول إلى Google Play أولاً</string>
|
||||
<string name="pay">دفع</string>
|
||||
|
@@ -5035,7 +5035,7 @@
|
||||
<string name="treasure_warm_prompt">溫馨提示</string>
|
||||
<string name="treasure_diamond_balance_is_insufficient">鉆石餘額不足,請先充值吧~</string>
|
||||
<string name="treasure_to_charge">去充值</string>
|
||||
<string name="treasure_in_find_love">通過尋愛之旅</string>
|
||||
<string name="treasure_in_find_love">通過歡樂砸蛋</string>
|
||||
<string name="give_application_storage_permission">請給予應用存儲權限,以正常保存圖片。</string>
|
||||
<string name="Recharge_failure">充值失敗,請先登錄Google Play</string>
|
||||
<string name="pay">支付</string>
|
||||
|
@@ -5017,7 +5017,7 @@
|
||||
<string name="treasure_warm_prompt">Warm Prompt</string>
|
||||
<string name="treasure_diamond_balance_is_insufficient">Insufficient diamond balance, please recharge first~</string>
|
||||
<string name="treasure_to_charge">Recharge Now</string>
|
||||
<string name="treasure_in_find_love">Through the Journey of Finding Love</string>
|
||||
<string name="treasure_in_find_love">via joyful egg smash</string>
|
||||
<string name="give_application_storage_permission">Please grant the application storage permission to save pictures normally.</string>
|
||||
<string name="Recharge_failure">Recharge failed, please log in to Google Play first</string>
|
||||
<string name="pay">Pay</string>
|
||||
|
Reference in New Issue
Block a user