新增 H5活动通用飘屏

This commit is contained in:
wzq
2023-09-18 15:32:52 +08:00
parent 873ecf1d2b
commit c631c1d3a8
11 changed files with 346 additions and 163 deletions

Binary file not shown.

View File

@@ -99,6 +99,7 @@ import com.yizhuan.xchat_android_core.gift.bean.GiftInfo;
import com.yizhuan.xchat_android_core.gift.bean.LuckyBagNoticeInfo; import com.yizhuan.xchat_android_core.gift.bean.LuckyBagNoticeInfo;
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment; import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.FairyMsgAttachment; import com.yizhuan.xchat_android_core.im.custom.bean.FairyMsgAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.NotifyH5Attachment;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeAttachment; import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeInfo; import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeInfo;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomLuckySeaAttachment; import com.yizhuan.xchat_android_core.im.custom.bean.RoomLuckySeaAttachment;
@@ -1260,6 +1261,19 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
.setChatRoomMessage(message)); .setChatRoomMessage(message));
} }
break; break;
case CustomAttachment.CUSTOM_MSG_NOTIFY_H5:
if (baseProtocol.getSecond() == CustomAttachment.CUSTOM_MSG_NOTIFY_H5_SUB_WHOLE_SERVICE) {
NotifyH5Attachment.Bean bean = JSON.parseObject(String.valueOf(baseProtocol.getData()), NotifyH5Attachment.Bean.class);
NotifyH5Attachment notifyH5Attachment = new NotifyH5Attachment(baseProtocol.getSecond());
notifyH5Attachment.setBean(bean);
ChatRoomMessage notifyH5Msg = ChatRoomMessageBuilder.createChatRoomCustomMessage(
String.valueOf(AvRoomDataManager.get().getRoomId()), notifyH5Attachment);
IMNetEaseManager.get().getChatRoomEventObservable()
.onNext(new RoomEvent()
.setEvent(RoomEvent.NOTIFY_H5)
.setChatRoomMessage(notifyH5Msg));
}
break;
case CUSTOM_MSG_LUCKY_SEA://星级厨房 case CUSTOM_MSG_LUCKY_SEA://星级厨房
if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL) { if (baseProtocol.getSecond() == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL) {
RoomLuckySeaAttachment attachment = new RoomLuckySeaAttachment(CUSTOM_MSG_LUCKY_SEA, CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL); RoomLuckySeaAttachment attachment = new RoomLuckySeaAttachment(CUSTOM_MSG_LUCKY_SEA, CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_ALL);

View File

@@ -32,7 +32,6 @@ import com.yizhuan.erban.avroom.activity.AVRoomActivity
import com.yizhuan.erban.avroom.bean.RoomPlayBean import com.yizhuan.erban.avroom.bean.RoomPlayBean
import com.yizhuan.erban.avroom.helper.AnimHelper import com.yizhuan.erban.avroom.helper.AnimHelper
import com.yizhuan.erban.common.svga.SimpleSvgaCallback import com.yizhuan.erban.common.svga.SimpleSvgaCallback
import com.yizhuan.erban.databinding.LayoutNotifyTarotIntermediateBinding
import com.yizhuan.erban.databinding.LayoutRoomEffectBinding import com.yizhuan.erban.databinding.LayoutRoomEffectBinding
import com.yizhuan.erban.ui.utils.ImageLoadUtils import com.yizhuan.erban.ui.utils.ImageLoadUtils
import com.yizhuan.erban.ui.utils.isDestroyed import com.yizhuan.erban.ui.utils.isDestroyed
@@ -178,6 +177,10 @@ class RoomEffectView @JvmOverloads constructor(
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage) addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
} }
RoomEvent.NOTIFY_H5 -> {
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
}
RoomEvent.RECEIVE_ROOM_LUCKY_BAG_NOTICE, RoomEvent.RECEIVE_SERVICE_LUCKY_BAG_NOTICE ->//全服福袋 RoomEvent.RECEIVE_ROOM_LUCKY_BAG_NOTICE, RoomEvent.RECEIVE_SERVICE_LUCKY_BAG_NOTICE ->//全服福袋
//廳內福袋 //廳內福袋
addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage) addPlayNotify(roomEvent.event, roomEvent.chatRoomMessage)
@@ -278,167 +281,195 @@ class RoomEffectView @JvmOverloads constructor(
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.takeWhile { messagesPlay.size > 0 && !mContext.isDestroyed() } .takeWhile { messagesPlay.size > 0 && !mContext.isDestroyed() }
.subscribe { .subscribe {
if (binding.flPlayNotify.childCount == 0) { if (binding.flPlayNotify.childCount != 0) {
when (messagesPlay[0].event) { return@subscribe
RoomEvent.BOX_NOTIFY -> {//寻爱 }
if ((mContext as AVRoomActivity).isTopActivity) {
isPlayAnim = true when (messagesPlay[0].event) {
val isPlay = onPlayAnimCallback?.invoke() ?: false RoomEvent.BOX_NOTIFY -> {//寻爱
if (isPlay) { if ((mContext as AVRoomActivity).isTopActivity) {
margin( isPlayAnim = true
binding.clNotify, val isPlay = onPlayAnimCallback?.invoke() ?: false
0, if (isPlay) {
UIUtil.dip2px(context, 180.0), margin(
0, binding.clNotify,
0 0,
) UIUtil.dip2px(context, 180.0),
} else { 0,
margin( 0
binding.clNotify, )
0, } else {
UIUtil.dip2px(context, 60.0), margin(
0, binding.clNotify,
0 0,
) UIUtil.dip2px(context, 60.0),
} 0,
showBoxNotify( 0
messagesPlay.removeAt(0)
) )
} }
showBoxNotify(
messagesPlay.removeAt(0)
)
} }
}
RoomEvent.BOX_NOTIFY_SVGA -> {//寻爱 RoomEvent.BOX_NOTIFY_SVGA -> {//寻爱
if ((mContext as AVRoomActivity).isTopActivity) { if ((mContext as AVRoomActivity).isTopActivity) {
isPlayAnim = true isPlayAnim = true
val isPlay = onPlayAnimCallback?.invoke() ?: false val isPlay = onPlayAnimCallback?.invoke() ?: false
if (isPlay) { if (isPlay) {
margin( margin(
binding.clNotify, binding.clNotify,
0, 0,
UIUtil.dip2px(context, 180.0), UIUtil.dip2px(context, 180.0),
0, 0,
0 0
) )
} else { } else {
margin( margin(
binding.clNotify, binding.clNotify,
0, 0,
UIUtil.dip2px(context, 60.0), UIUtil.dip2px(context, 60.0),
0, 0,
0 0
)
}
showBoxNotifyBySVGA(messagesPlay.removeAt(0))
}
}
RoomEvent.TAROT_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
)
}
showTarotNotify(
messagesPlay.removeAt(0)
) )
} }
showBoxNotifyBySVGA(messagesPlay.removeAt(0))
} }
}
RoomEvent.TAROT_NOTIFY_SVGA -> { RoomEvent.TAROT_NOTIFY -> {
if ((mContext as AVRoomActivity).isTopActivity) { 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
)
}
showTarotNotifyBySVGA(messagesPlay.removeAt(0))
}
}
RoomEvent.RECEIVE_ROOM_LUCKY_BAG_NOTICE, RoomEvent.RECEIVE_SERVICE_LUCKY_BAG_NOTICE -> {//福袋
isPlayAnim = true isPlayAnim = true
val isPlay = onPlayAnimCallback?.invoke() ?: false val isPlay = onPlayAnimCallback?.invoke() ?: false
if (isPlay) { if (isPlay) {
margin(binding.clNotify, 0, UIUtil.dip2px(context, 180.0), 0, 0) margin(
binding.clNotify,
0,
UIUtil.dip2px(context, 180.0),
0,
0
)
} else { } else {
margin(binding.clNotify, 0, UIUtil.dip2px(context, 60.0), 0, 0) margin(
binding.clNotify,
0,
UIUtil.dip2px(context, 60.0),
0,
0
)
} }
showLuckyBagNotify( showTarotNotify(
messagesPlay.removeAt(0) messagesPlay.removeAt(0)
) )
} }
}
RoomEvent.LUCKY_SEA_GIFT_ROOM_NOTIFY -> {//星级厨房 RoomEvent.TAROT_NOTIFY_SVGA -> {
if ((mContext as AVRoomActivity).isTopActivity) {
isPlayAnim = true isPlayAnim = true
val isPlay = onPlayAnimCallback?.invoke() ?: false val isPlay = onPlayAnimCallback?.invoke() ?: false
if (isPlay) { if (isPlay) {
margin(binding.clNotify, 0, UIUtil.dip2px(context, 180.0), 0, 0) margin(
binding.clNotify,
0,
UIUtil.dip2px(context, 180.0),
0,
0
)
} else { } else {
margin(binding.clNotify, 0, UIUtil.dip2px(context, 60.0), 0, 0) margin(
binding.clNotify,
0,
UIUtil.dip2px(context, 60.0),
0,
0
)
} }
showLuckySeaNotify( showTarotNotifyBySVGA(messagesPlay.removeAt(0))
messagesPlay.removeAt(0) }
) }
RoomEvent.NOTIFY_H5 -> {
if (!(mContext as AVRoomActivity).isTopActivity) {
return@subscribe
} }
RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY -> {//星级厨房 isPlayAnim = true
isPlayAnim = true val isPlay = onPlayAnimCallback?.invoke() ?: false
val isPlay = onPlayAnimCallback?.invoke() ?: false margin(
if (isPlay) { binding.clNotify,
margin(binding.clNotify, 0, UIUtil.dip2px(context, 180.0), 0, 0) 0,
} else { UIUtil.dip2px(context, if (isPlay) 180.0 else 60.0),
margin(binding.clNotify, 0, UIUtil.dip2px(context, 60.0), 0, 0) 0,
} 0
showLuckySeaNotifyBySVGA( )
messagesPlay.removeAt(0)
) val msg = messagesPlay.removeAt(0)
val attachment = msg.chatRoomMessage.attachment as NotifyH5Attachment
val bean = attachment.bean ?: return@subscribe
if (bean.floatingType == 0) {
showNotifyH5(bean)
} else {
showNotifyH5WithAnim(bean)
} }
RoomEvent.FAIRY_DRAW_GIFT_L4, }
RoomEvent.FAIRY_DRAW_GIFT_L5,
RoomEvent.FAIRY_CONVERT_L1, RoomEvent.RECEIVE_ROOM_LUCKY_BAG_NOTICE, RoomEvent.RECEIVE_SERVICE_LUCKY_BAG_NOTICE -> {//福袋
RoomEvent.FAIRY_CONVERT_L2, isPlayAnim = true
RoomEvent.FAIRY_CONVERT_L3 -> {//夺宝 val isPlay = onPlayAnimCallback?.invoke() ?: false
isPlayAnim = true if (isPlay) {
val isPlay = onPlayAnimCallback?.invoke() ?: false margin(binding.clNotify, 0, UIUtil.dip2px(context, 180.0), 0, 0)
if (isPlay) { } else {
margin(binding.clNotify, 0, UIUtil.dip2px(context, 180.0), 0, 0) margin(binding.clNotify, 0, UIUtil.dip2px(context, 60.0), 0, 0)
} else {
margin(binding.clNotify, 0, UIUtil.dip2px(context, 60.0), 0, 0)
}
showFairyNotify(
messagesPlay.removeAt(0)
)
} }
showLuckyBagNotify(
messagesPlay.removeAt(0)
)
}
RoomEvent.LUCKY_SEA_GIFT_ROOM_NOTIFY -> {//星级厨房
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)
}
showLuckySeaNotify(
messagesPlay.removeAt(0)
)
}
RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY -> {//星级厨房
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)
}
showLuckySeaNotifyBySVGA(
messagesPlay.removeAt(0)
)
}
RoomEvent.FAIRY_DRAW_GIFT_L4,
RoomEvent.FAIRY_DRAW_GIFT_L5,
RoomEvent.FAIRY_CONVERT_L1,
RoomEvent.FAIRY_CONVERT_L2,
RoomEvent.FAIRY_CONVERT_L3 -> {//夺宝
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)
}
showFairyNotify(
messagesPlay.removeAt(0)
)
} }
} }
} }
@@ -839,11 +870,80 @@ class RoomEffectView @JvmOverloads constructor(
) )
} }
private fun showNotifyH5(data: NotifyH5Attachment.Bean) {
val textView = LayoutInflater.from(mContext)
.inflate(R.layout.layout_notify_h5, null) as TextView
textView.text = data.content
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 showNotifyH5WithAnim(data: NotifyH5Attachment.Bean) {
val svgaImageView = SVGAImageView(mContext)
svgaImageView.loops = 1
svgaImageView.clearsAfterStop = true
val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
svgaImageView.layoutParams = params
svgaImageView.callback = object : SimpleSvgaCallback() {
override fun onFinished() {
binding.flPlayNotify.post {
binding.flPlayNotify.removeView(svgaImageView)
isPlayAnim = false
}
}
}
binding.flPlayNotify.addView(svgaImageView)
shareParser().decodeFromAssets(
"svga/svga_notify_h5.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(
data.content,
0,
data.content.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 showTarotNotify(roomPlayBean: RoomPlayBean) { private fun showTarotNotify(roomPlayBean: RoomPlayBean) {
val chatRoomMessage = roomPlayBean.chatRoomMessage val chatRoomMessage = roomPlayBean.chatRoomMessage
val attachment = chatRoomMessage.attachment as TarotAttachment val attachment = chatRoomMessage.attachment as TarotAttachment
val textView = val textView =
LayoutInflater.from(mContext).inflate(R.layout.layout_notify_tarot_intermediate, null) as TextView LayoutInflater.from(mContext)
.inflate(R.layout.layout_notify_tarot_intermediate, null) as TextView
val string = mContext.getString( val string = mContext.getString(
R.string.avroom_widget_roomeffectview_026, R.string.avroom_widget_roomeffectview_026,
StringUtils.abbreviate(RegexUtil.getPrintableString(attachment.tarotMsgBean.nick), 8), StringUtils.abbreviate(RegexUtil.getPrintableString(attachment.tarotMsgBean.nick), 8),
@@ -933,32 +1033,36 @@ class RoomEffectView @JvmOverloads constructor(
} }
} }
binding.flPlayNotify.addView(svgaImageView) binding.flPlayNotify.addView(svgaImageView)
shareParser().decodeFromAssets("svga/svga_tarot_senior.svga", object : SVGAParser.ParseCompletion { shareParser().decodeFromAssets(
override fun onComplete(videoItem: SVGAVideoEntity) { "svga/svga_tarot_senior.svga",
val dynamicEntity = SVGADynamicEntity() object : SVGAParser.ParseCompletion {
val textPaint = TextPaint() override fun onComplete(videoItem: SVGAVideoEntity) {
textPaint.color = Color.WHITE //字體顏色 val dynamicEntity = SVGADynamicEntity()
textPaint.textSize = 22f val textPaint = TextPaint()
dynamicEntity.setDynamicText( textPaint.color = Color.WHITE //字體顏色
StaticLayout( textPaint.textSize = 22f
text, dynamicEntity.setDynamicText(
0, StaticLayout(
text.length, text,
textPaint, 0,
0, text.length,
Layout.Alignment.ALIGN_CENTER, textPaint,
1.0f, 0,
0.0f, Layout.Alignment.ALIGN_CENTER,
false 1.0f,
), "taxt" 0.0f,
) false
val drawable = SVGADrawable(videoItem, dynamicEntity) ), "taxt"
svgaImageView.setImageDrawable(drawable) )
svgaImageView.stepToFrame(0, true) val drawable = SVGADrawable(videoItem, dynamicEntity)
} svgaImageView.setImageDrawable(drawable)
svgaImageView.stepToFrame(0, true)
}
override fun onError() {} override fun onError() {}
}, null) },
null
)
} }
private fun showBoxNotifyBySVGA(roomPlayBean: RoomPlayBean) { private fun showBoxNotifyBySVGA(roomPlayBean: RoomPlayBean) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<com.coorchice.library.SuperTextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="@drawable/bg_notify_h5"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingStart="@dimen/dp_50"
android:paddingEnd="0dp"
android:textColor="@color/white"
android:textSize="11sp"
tools:layout_height="wrap_content"
tools:text="@string/avroom_widget_roomeffectview_026" />

View File

@@ -97,7 +97,6 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_marginStart="@dimen/dp_4" android:layout_marginStart="@dimen/dp_4"
android:layout_marginTop="@dimen/dp_4" android:layout_marginTop="@dimen/dp_4"
android:onClick="@{click}"
android:src="@drawable/treasure_box_sub_normal" /> android:src="@drawable/treasure_box_sub_normal" />
<EditText <EditText
@@ -120,7 +119,6 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_marginTop="@dimen/dp_4" android:layout_marginTop="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_2" android:layout_marginEnd="@dimen/dp_2"
android:onClick="@{click}"
android:src="@drawable/treasure_box_add_normal" /> android:src="@drawable/treasure_box_add_normal" />
</LinearLayout> </LinearLayout>

View File

@@ -1360,6 +1360,8 @@ public final class IMNetEaseManager {
|| second == CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING) { || second == CUSTOM_MESS_TAROT_SENIOR_PRIZE_WINNING) {
noticeTarot(msg, second); noticeTarot(msg, second);
} }
case CUSTOM_MSG_NOTIFY_H5:
noticeH5(msg);
default: default:
break; break;
} }
@@ -3338,6 +3340,13 @@ public final class IMNetEaseManager {
.setChatRoomMessage(msg)); .setChatRoomMessage(msg));
} }
private void noticeH5(ChatRoomMessage msg) {
getChatRoomEventObservable()
.onNext(new RoomEvent()
.setEvent(RoomEvent.NOTIFY_H5)
.setChatRoomMessage(msg));
}
private void noticeRadish(ChatRoomMessage msg, int second) { private void noticeRadish(ChatRoomMessage msg, int second) {
int event = second == CUSTOM_MSG_SUB_RADISH_ALL_ROOM_NOTIFY ? RoomEvent.RADISH_NOTIFY : RoomEvent.RADISH_NOTIFY_SVGA; int event = second == CUSTOM_MSG_SUB_RADISH_ALL_ROOM_NOTIFY ? RoomEvent.RADISH_NOTIFY : RoomEvent.RADISH_NOTIFY_SVGA;
getChatRoomEventObservable() getChatRoomEventObservable()

View File

@@ -643,6 +643,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
attachment = new FairyMsgAttachment(first, second); attachment = new FairyMsgAttachment(first, second);
} }
break; break;
case CustomAttachment.CUSTOM_MSG_NOTIFY_H5:
attachment = new NotifyH5Attachment(second);
break;
default: default:
LogUtils.e(ResUtil.getString(R.string.custom_bean_customattachparser_01) + first + " second=" + second); LogUtils.e(ResUtil.getString(R.string.custom_bean_customattachparser_01) + first + " second=" + second);
break; break;

View File

@@ -453,6 +453,21 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_SUB_CONVERT_L2 = 9732; // 召唤L2 public static final int CUSTOM_MSG_SUB_CONVERT_L2 = 9732; // 召唤L2
public static final int CUSTOM_MSG_SUB_CONVERT_L3 = 9733; // 召唤L3 public static final int CUSTOM_MSG_SUB_CONVERT_L3 = 9733; // 召唤L3
/**
* H5活动通用飘屏
*/
public static final int CUSTOM_MSG_NOTIFY_H5 = 100;
/**
* H5活动通用飘屏 - 房间
*/
public static final int CUSTOM_MSG_NOTIFY_H5_SUB_ROOM = 1001;
/**
* H5活动通用飘屏 - 全服
*/
public static final int CUSTOM_MSG_NOTIFY_H5_SUB_WHOLE_SERVICE = 1002;
/** /**
* 自定义消息附件的类型,根据该字段区分不同的自定义消息 * 自定义消息附件的类型,根据该字段区分不同的自定义消息
*/ */

View File

@@ -0,0 +1,22 @@
package com.yizhuan.xchat_android_core.im.custom.bean
import com.alibaba.fastjson.JSONObject
import com.google.gson.Gson
class NotifyH5Attachment(second: Int) : CustomAttachment(CUSTOM_MSG_NOTIFY_H5, second) {
var bean: Bean? = null
override fun parseData(data: JSONObject) {
bean = Gson().fromJson(data.toJSONString(), Bean::class.java)
}
data class Bean(
val roomUid: Int,
/**
* 飘屏类型 0 房间静态飘屏 1 全服动态飘屏
*/
val floatingType: Int,
val content: String,
)
}

View File

@@ -261,6 +261,7 @@ public class RoomEvent {
public static final int TAROT_NOTIFY = 107; public static final int TAROT_NOTIFY = 107;
public static final int TAROT_NOTIFY_SVGA = 108; public static final int TAROT_NOTIFY_SVGA = 108;
public static final int NOTIFY_H5 = 109;
private int event = NONE; private int event = NONE;
private int micPosition = Integer.MIN_VALUE; private int micPosition = Integer.MIN_VALUE;