pk房完成,剩余禁止对方麦未完成
拍卖房完成 点歌房完成,音乐播放需要测试
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.qxcm.moduleutil.bean;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class RoomMessageManager {
|
||||
|
||||
private static final RoomMessageManager instance = new RoomMessageManager();
|
||||
|
||||
private RoomMessageManager() {}
|
||||
|
||||
public static RoomMessageManager getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收原始消息,转换后发送到 EventBus
|
||||
*/
|
||||
public void onNewMessage(String roomId, int msgType, RoomMessageEvent.T data) {
|
||||
RoomMessageEvent event = new RoomMessageEvent(msgType, roomId, data);
|
||||
EventBus.getDefault().post(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册监听器(如 Fragment 或 Activity)
|
||||
*/
|
||||
public void register(Object subscriber) {
|
||||
if (!EventBus.getDefault().isRegistered(subscriber)) {
|
||||
EventBus.getDefault().register(subscriber);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 反注册监听器
|
||||
*/
|
||||
public void unregister(Object subscriber) {
|
||||
if (EventBus.getDefault().isRegistered(subscriber)) {
|
||||
EventBus.getDefault().unregister(subscriber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user