新增 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

View File

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

View File

@@ -643,6 +643,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
attachment = new FairyMsgAttachment(first, second);
}
break;
case CustomAttachment.CUSTOM_MSG_NOTIFY_H5:
attachment = new NotifyH5Attachment(second);
break;
default:
LogUtils.e(ResUtil.getString(R.string.custom_bean_customattachparser_01) + first + " second=" + second);
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_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_SVGA = 108;
public static final int NOTIFY_H5 = 109;
private int event = NONE;
private int micPosition = Integer.MIN_VALUE;