eventbus调用销毁整合。
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
package com.xscm.moduleutil;
|
||||
|
||||
public class BaseEvent {
|
||||
}
|
||||
@@ -35,6 +35,7 @@ import com.xscm.moduleutil.widget.QXGiftDriftView;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -49,6 +50,10 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
|
||||
protected VDB mBinding;
|
||||
|
||||
@Subscribe (threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(Object event) {
|
||||
}
|
||||
|
||||
// private LoadingDialog mLoadingDialog;
|
||||
// 添加广播接收器成员变量
|
||||
private BroadcastReceiver mLogoutReceiver = new BroadcastReceiver() {
|
||||
@@ -104,23 +109,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
IntentFilter filter = new IntentFilter("com.xscm.moduleutil.ACTION_USER_LOGOUT");
|
||||
registerReceiver(mLogoutReceiver, filter);
|
||||
|
||||
// 动态判断是否包含 @Subscribe 注解的方法
|
||||
boolean hasSubscribeMethods = false;
|
||||
for (Method method : getClass().getDeclaredMethods()) {
|
||||
if (method.isAnnotationPresent(Subscribe.class)) {
|
||||
hasSubscribeMethods = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasSubscribeMethods) {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
|
||||
// 启动定时器
|
||||
// startTimer();
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
// 在Activity中
|
||||
@@ -262,6 +251,13 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
|
||||
protected abstract int getLayoutId();
|
||||
|
||||
|
||||
@Override
|
||||
public void finish() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
// 移除背景更新监听器
|
||||
@@ -271,9 +267,6 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
if (mBinding != null) {
|
||||
mBinding.unbind();
|
||||
}
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
try {
|
||||
unregisterReceiver(mLogoutReceiver);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -70,7 +70,6 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,10 +14,18 @@ import androidx.fragment.app.Fragment;
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
public abstract class BaseFragment<VDB extends ViewDataBinding> extends Fragment {
|
||||
protected VDB mBinding;
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
@@ -35,8 +43,14 @@ public abstract class BaseFragment<VDB extends ViewDataBinding> extends Fragment
|
||||
initView();
|
||||
initData();
|
||||
initListener();
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
|
||||
@Subscribe (threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(Object event) {
|
||||
|
||||
}
|
||||
public void initArgs(Bundle arguments) {
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/29
|
||||
@@ -43,6 +45,12 @@ public abstract class BaseMvpDialogFragment<P extends IPresenter, VDM extends Vi
|
||||
return getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
@@ -61,6 +69,7 @@ public abstract class BaseMvpDialogFragment<P extends IPresenter, VDM extends Vi
|
||||
}
|
||||
initView();
|
||||
initData();
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,13 +22,11 @@ public abstract class BaseRoomFragment<P extends BaseRoomPresenter, VDB extends
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
unRegisterWheatViews();
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@@ -43,7 +41,6 @@ public abstract class BaseRoomFragment<P extends BaseRoomPresenter, VDB extends
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void roomInfo(RoomInfoResp resp) {
|
||||
roomInfoUpdate(resp);
|
||||
// EventBus.getDefault().post(new RoomCardiacValueChangedEvent());
|
||||
}
|
||||
|
||||
public abstract void roomInfoUpdate(RoomInfoResp resp);
|
||||
@@ -51,112 +48,10 @@ public abstract class BaseRoomFragment<P extends BaseRoomPresenter, VDB extends
|
||||
public abstract void unRegisterWheatViews();
|
||||
|
||||
public abstract int[] collectCurrentCardiacValues();
|
||||
public int[][] collectAmativenessCurrentCardiacValues() { return new int[2][0]; }
|
||||
|
||||
public abstract void hideAllWheatMaozi();
|
||||
public void showWheatMaoziHuangguan(int wheat) {}
|
||||
public void showWheatMaoziBianbian(int... wheats) {}
|
||||
|
||||
public void showAmativenessMaleWheatMaozi(int index, int level) {}
|
||||
public void showAmativenessFemaleWheatMaozi(int index, int level) {}
|
||||
|
||||
protected void tzblChanged() {
|
||||
|
||||
}
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void onRoomTzblChangedEvent(RoomTzblChangedEvent event) {
|
||||
// tzblChanged();
|
||||
// }
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void onRoomCardiacValueChangedEvent(RoomCardiacValueChangedEvent event) {
|
||||
//// hideAllWheatMaozi();
|
||||
// checkWheatMaoziState(collectCurrentCardiacValues());
|
||||
// int[][] cvs = collectAmativenessCurrentCardiacValues();
|
||||
// checkAmativenessMaleWheatMaoziState(cvs[0]);
|
||||
// checkAmativenessFemaleWheatMaoziState(cvs[1]);
|
||||
// }
|
||||
|
||||
private void checkWheatMaoziState(int[] cvs) {
|
||||
int max = -999999999;
|
||||
int min = 999999999;
|
||||
List<Integer> maxs = new ArrayList<>();
|
||||
List<Integer> mins = new ArrayList<>();
|
||||
// 找出最大值/最小值
|
||||
for (int i = 0; i < cvs.length; i++) {
|
||||
int v = cvs[i];
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v >= max) { max = v; }
|
||||
if (v <= min) { min = v; }
|
||||
}
|
||||
// 如果最大值和最小值相同,全部不带帽子
|
||||
if (min == max) return;
|
||||
// 找出最大值的麦位/最小值的麦位
|
||||
for (int i = 0; i < cvs.length; i++) {
|
||||
int v = cvs[i];
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v == max) { maxs.add(i); }
|
||||
if (v == min) { mins.add(i); }
|
||||
}
|
||||
// 排序最大值的麦位,选出最优先的一个,带皇冠
|
||||
if (maxs.size() > 0) {
|
||||
// showWheatMaoziHuangguan(maxs.get(0));
|
||||
}
|
||||
// 给所有最小值的麦位,带便便
|
||||
if (mins.size() > 0) {
|
||||
int[] ws = new int[mins.size()];
|
||||
for (int i = 0; i < ws.length; i++) { ws[i] = mins.get(i); }
|
||||
// showWheatMaoziBianbian(ws);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAmativenessMaleWheatMaoziState(int[] cvs) {
|
||||
int max = -999999999;
|
||||
List<Integer> maxs = new ArrayList<>();
|
||||
// 找出最大值
|
||||
for (int v : cvs) {
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v >= max) {
|
||||
max = v;
|
||||
}
|
||||
}
|
||||
// 找出最大值的麦位
|
||||
for (int i = 0; i < cvs.length; i++) {
|
||||
int v = cvs[i];
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v == max) { maxs.add(i); }
|
||||
}
|
||||
// 获得男生第一帽子等级
|
||||
if (maxs.size() > 0) {
|
||||
int level = getAmativenessWheatMaoziLevel(max);
|
||||
if (level > 0) showAmativenessMaleWheatMaozi(maxs.get(0), level);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAmativenessFemaleWheatMaoziState(int[] cvs) {
|
||||
int max = -999999999;
|
||||
List<Integer> maxs = new ArrayList<>();
|
||||
// 找出最大值
|
||||
for (int v : cvs) {
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v >= max) {
|
||||
max = v;
|
||||
}
|
||||
}
|
||||
// 找出最大值的麦位
|
||||
for (int i = 0; i < cvs.length; i++) {
|
||||
int v = cvs[i];
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v == max) { maxs.add(i); }
|
||||
}
|
||||
// 获得女生第一帽子等级
|
||||
if (maxs.size() > 0) {
|
||||
int level = getAmativenessWheatMaoziLevel(max);
|
||||
if (level > 0) showAmativenessFemaleWheatMaozi(maxs.get(0), level);
|
||||
}
|
||||
}
|
||||
|
||||
private int getAmativenessWheatMaoziLevel(int value) {
|
||||
if (value >= 52000) {
|
||||
return 3;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
package com.xscm.moduleutil.enumType;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
package com.xscm.moduleutil.enumType;
|
||||
|
||||
public enum QXRoomSeatViewType {
|
||||
/**
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
package com.xscm.moduleutil.enumType;
|
||||
/**
|
||||
* 红包打开状态
|
||||
*/
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
/**
|
||||
* Created by http://www.yunbaokj.com on 2022/7/12.
|
||||
*/
|
||||
public class AppLifecycleEvent {
|
||||
public class AppLifecycleEvent extends BaseEvent {
|
||||
|
||||
private boolean mFrontGround;
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
/**
|
||||
* 项目名称 qipao-android
|
||||
* 包名:com.yutang.xqipao.data.even
|
||||
@@ -7,7 +9,7 @@ package com.xscm.moduleutil.event;
|
||||
* 创建时间 2020/7/18 9:42 AM
|
||||
* 描述 describe
|
||||
*/
|
||||
public class BossMsgEvent {
|
||||
public class BossMsgEvent extends BaseEvent {
|
||||
public String msg;
|
||||
|
||||
public BossMsgEvent(String msg) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CabinEvent {
|
||||
public class CabinEvent extends BaseEvent {
|
||||
private boolean joined;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/11
|
||||
*@description: 关闭屏幕共享
|
||||
*/
|
||||
public class ColoseCardEvent {
|
||||
public class ColoseCardEvent extends BaseEvent {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -11,6 +13,6 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EffectEvent {
|
||||
public class EffectEvent extends BaseEvent {
|
||||
private boolean effectOn;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -12,6 +14,6 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FloatingScreenEvent {
|
||||
public class FloatingScreenEvent extends BaseEvent {
|
||||
private boolean floatingScreen;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
public class GiftDoubleClickEvent {
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
public class GiftDoubleClickEvent extends BaseEvent {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -8,7 +10,7 @@ import lombok.Data;
|
||||
* @Description 打赏成功$
|
||||
*/
|
||||
@Data
|
||||
public class GiftRewardEvent {
|
||||
public class GiftRewardEvent extends BaseEvent {
|
||||
private int points;
|
||||
private String zone_id;
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
|
||||
public class GiftUserRefreshEvent {
|
||||
public class GiftUserRefreshEvent extends BaseEvent {
|
||||
public boolean addSelf;
|
||||
|
||||
public int type;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -8,7 +10,7 @@ import java.io.Serializable;
|
||||
* 小时榜飘屏
|
||||
*/
|
||||
@Data
|
||||
public class HourlyBean implements Serializable {
|
||||
public class HourlyBean extends BaseEvent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String room_id;
|
||||
private String room_name;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/7/18.
|
||||
*/
|
||||
|
||||
public class LocationCityEvent {
|
||||
private final String city;
|
||||
|
||||
public LocationCityEvent(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/7/18.
|
||||
*/
|
||||
|
||||
public class LocationEvent {
|
||||
private double lng;
|
||||
private double lat;
|
||||
|
||||
public LocationEvent(double lng, double lat) {
|
||||
this.lng = lng;
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLng() {
|
||||
return lng;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
public class LogOutEvent {
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
public class LogOutEvent extends BaseEvent {
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
public enum MessageType {
|
||||
JOIN_ROOM(1001, true, true), // 加入房间事件(展示+广播)
|
||||
CLEAR_CHAT(123, false, false), // 清空聊天(不展示不广播)
|
||||
GIFT_MESSAGE(1012, true, false), // 礼物消息(仅展示)
|
||||
MUSIC_PLAY(124, false, true), // 播放音乐(不展示但广播)
|
||||
DEFAULT(0, true, false); // 默认处理
|
||||
|
||||
private final int code;
|
||||
private final boolean show;
|
||||
private final boolean broadcast;
|
||||
|
||||
MessageType(int code, boolean show, boolean broadcast) {
|
||||
this.code = code;
|
||||
this.show = show;
|
||||
this.broadcast = broadcast;
|
||||
}
|
||||
|
||||
public static MessageType fromCode(int code) {
|
||||
for (MessageType type : values()) {
|
||||
if (type.code == code) return type;
|
||||
}
|
||||
return DEFAULT;
|
||||
}
|
||||
|
||||
public boolean isShow() {
|
||||
return show;
|
||||
}
|
||||
|
||||
public boolean isBroadcast() {
|
||||
return broadcast;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonToken;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -19,7 +20,7 @@ import lombok.Data;
|
||||
* @Description 从声望获取到的参数$
|
||||
*/
|
||||
@Data
|
||||
public class MqttBean {
|
||||
public class MqttBean extends BaseEvent {
|
||||
private String room_id;
|
||||
@JsonAdapter(ListBeanListAdapter.class)
|
||||
private List<ListBean> list;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
@@ -7,5 +9,5 @@ import lombok.Data;
|
||||
*@description: 背景音乐
|
||||
*/
|
||||
@Data
|
||||
public class MusicEvent {
|
||||
public class MusicEvent extends BaseEvent {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
/**
|
||||
* 项目名称 qipao-android
|
||||
* 包名:com.qpyy.room.event
|
||||
@@ -7,7 +9,7 @@ package com.xscm.moduleutil.event;
|
||||
* 创建时间 2020/8/11 3:40 PM
|
||||
* 描述 describe
|
||||
*/
|
||||
public class PasswordInputEvent {
|
||||
public class PasswordInputEvent extends BaseEvent {
|
||||
public String password;
|
||||
|
||||
public PasswordInputEvent(String password) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
/**
|
||||
* Copyright (c) 1
|
||||
*
|
||||
@@ -9,7 +11,7 @@ package com.xscm.moduleutil.event;
|
||||
* @Date $date$ $time$
|
||||
*/
|
||||
|
||||
public class PayEvent {
|
||||
public class PayEvent extends BaseEvent {
|
||||
public PayEvent(int type, String content) {
|
||||
this.type = type;
|
||||
this.content = content;
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
package com.xscm.moduleutil.event
|
||||
|
||||
data class QDZMqttEvent(var json: String)
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class RedBean implements Serializable {
|
||||
public class RedBean extends BaseEvent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String room_id;
|
||||
private String room_name;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -7,7 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RoomBanWheatEvent {
|
||||
public class RoomBanWheatEvent extends BaseEvent {
|
||||
|
||||
private String roomId;
|
||||
private String pit_number;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -7,7 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RoomBeckoningEvent {
|
||||
public class RoomBeckoningEvent extends BaseEvent {
|
||||
|
||||
private String roomId;
|
||||
private boolean isOpen;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
public class RoomCardiacValueChangedEvent {
|
||||
public String pitNumber;
|
||||
public String value;
|
||||
public RoomCardiacValueChangedEvent() { this("", ""); }
|
||||
public RoomCardiacValueChangedEvent(String pit, String value) {
|
||||
this.pitNumber = pit;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -7,7 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class RoomFaceEvent {
|
||||
public class RoomFaceEvent extends BaseEvent {
|
||||
private String room_id;
|
||||
private String pit_number;
|
||||
private String special;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.adapter.GiftTwoAdapter;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class RoomGiftClickEvent {
|
||||
public class RoomGiftClickEvent extends BaseEvent {
|
||||
public WeakReference<GiftTwoAdapter> adapter;
|
||||
public RoonGiftModel gift;
|
||||
public int type;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.adapter.GiftRoomAdapter;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class RoomGiftClickToEvent {
|
||||
public class RoomGiftClickToEvent extends BaseEvent {
|
||||
public WeakReference<GiftRoomAdapter> adapter;
|
||||
public RoonGiftModel gift;
|
||||
public int type;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomGiftGiveEvent {
|
||||
public class RoomGiftGiveEvent extends BaseEvent {
|
||||
public String userId;
|
||||
public String room_id;
|
||||
public String pit;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
import com.xscm.moduleutil.adapter.GiftPackAdapter;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
|
||||
@@ -10,7 +11,7 @@ import java.lang.ref.WeakReference;
|
||||
* @Time 2025年7月29日23:42:45$ $
|
||||
* @Description 背包礼物选中$
|
||||
*/
|
||||
public class RoomGiftPackToEvent {
|
||||
public class RoomGiftPackToEvent extends BaseEvent {
|
||||
public WeakReference<GiftPackAdapter> adapter;
|
||||
public GiftPackBean gift;
|
||||
public int type;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -12,7 +13,7 @@ import java.util.List;
|
||||
* @Time $ $
|
||||
* @Description $
|
||||
*/
|
||||
public class RoomGiftRunable implements Runnable {
|
||||
public class RoomGiftRunable extends BaseEvent implements Runnable {
|
||||
|
||||
private String data;
|
||||
private static final List<MqttBean> mqttCache = new ArrayList<>();
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time $ $
|
||||
* @Description 隐藏软键盘$
|
||||
*/
|
||||
public class RoomInputHideEvent {
|
||||
public class RoomInputHideEvent extends BaseEvent {
|
||||
public boolean hide;
|
||||
|
||||
public RoomInputHideEvent(boolean hide) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -11,7 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RoomJoinMountModel {
|
||||
public class RoomJoinMountModel extends BaseEvent {
|
||||
|
||||
private String room_id;
|
||||
private String ride_url;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
public class RoomOutEvent {
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
public class RoomOutEvent extends BaseEvent {
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomOwnerLeaveEvent {
|
||||
public class RoomOwnerLeaveEvent extends BaseEvent {
|
||||
private String room_id;
|
||||
private String user_id;
|
||||
private String emchat_username;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025-8-6 14:53:35$ $
|
||||
* @Description 房间任务信息$
|
||||
*/
|
||||
public class RoomTaskEvent {
|
||||
public class RoomTaskEvent extends BaseEvent {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -7,7 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RoomWheatEvent {
|
||||
public class RoomWheatEvent extends BaseEvent {
|
||||
|
||||
private String roomId;
|
||||
private boolean isFree; //true 自由 false 排麦
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
public class ShowOnWheatDialogEvent {
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.xscm.moduleutil.event;
|
||||
|
||||
import android.view.SurfaceView;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -10,7 +12,7 @@ import lombok.Data;
|
||||
* @Description 判断是否是电影房$
|
||||
*/
|
||||
@Data
|
||||
public class SurfaceEvent {
|
||||
public class SurfaceEvent extends BaseEvent {
|
||||
|
||||
private SurfaceView surfaceView;
|
||||
private int type;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025年7月28日16:34:24$ $
|
||||
* @Description $ 这是获取到腾讯的im总得未读数量
|
||||
*/
|
||||
@Data
|
||||
public class TxEvent {
|
||||
private long unreadCount;
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
@@ -7,7 +9,7 @@ import lombok.Data;
|
||||
*@description: 这是im展示需要显示的未读消息数
|
||||
*/
|
||||
@Data
|
||||
public class UnreadCountEvent {
|
||||
public class UnreadCountEvent extends BaseEvent {
|
||||
private long aLong;
|
||||
private long bLong;
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
public class UserDownWheatEvent {
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
public class UserInfoShowEvent {
|
||||
import com.xscm.moduleutil.BaseEvent;
|
||||
|
||||
public class UserInfoShowEvent extends BaseEvent {
|
||||
public String roomId;
|
||||
public String userId;
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.base.RoomRollModel;
|
||||
import com.xscm.moduleutil.bean.FaceBean;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.ClosePhone;
|
||||
import com.xscm.moduleutil.bean.room.RoomClearCardiacAllModel;
|
||||
import com.xscm.moduleutil.bean.room.RoomClearCardiacModel;
|
||||
@@ -36,12 +34,9 @@ import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class BaseWheatView extends ConstraintLayout implements IBaseWheat {
|
||||
public ImageView mRiv;
|
||||
public ImageView mIvGift;
|
||||
@@ -111,9 +106,6 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
oX = mIvGift.getX();
|
||||
oY = mIvGift.getY();
|
||||
initPit(context, attrs);
|
||||
if (!EventBus.getDefault().isRegistered( this)){
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void initPit(Context context, AttributeSet attrs);
|
||||
@@ -475,22 +467,6 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// } else {
|
||||
// try {
|
||||
// String d = pitBean.getXin_dong();
|
||||
// long xd = Long.parseLong(d);
|
||||
// if (xd <= 0) {
|
||||
// mCharmView.setSex(pitBean.getSex(), pitBean.getUser_id(), d, false);
|
||||
// } else {
|
||||
// float xxd = xd * bl;
|
||||
// mCharmView.setSex(pitBean.getSex(), pitBean.getUser_id(), String.format(Locale.CHINESE, "%sx%.2f=%.2f", d, bl, xxd), true);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// mCharmView.setSex(pitBean.getSex(), pitBean.getUser_id(), pitBean.getXin_dong(), false);
|
||||
// }
|
||||
// }
|
||||
// EventBus.getDefault().post(new RoomCardiacValueChangedEvent(pitNumber, pitBean.getCharm()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,7 +478,6 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
if (mCharmView != null) {
|
||||
pitBean.setCharm("0");
|
||||
mCharmView.setSex(pitBean.getSex(), pitBean.getUser_id(), pitBean.getCharm(), true);
|
||||
// EventBus.getDefault().post(new RoomCardiacValueChangedEvent(pitNumber, pitBean.getCharm()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,14 +502,12 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
|
||||
@Override
|
||||
public void register(Object obj) {
|
||||
EventBus.getDefault().register(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unRegister(Object obj) {
|
||||
AgoraManager.getInstance(getContext()).removeSoundLevelListener(this);
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.event.QXRoomSeatViewType;
|
||||
import com.xscm.moduleutil.enumType.QXRoomSeatViewType;
|
||||
|
||||
// 在 common 模块中或相应模块中
|
||||
public class SharedViewModel extends ViewModel {
|
||||
|
||||
@@ -106,9 +106,6 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
|
||||
mGiftNumList.add(new GiftNumBean("10", "x10"));
|
||||
mGiftNumList.add(new GiftNumBean("5", "x5"));
|
||||
mGiftNumList.add(new GiftNumBean("1", "x1"));
|
||||
if (!EventBus.getDefault().isRegistered( this)){
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -371,17 +368,13 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
if (!EventBus.getDefault().isRegistered( this)){
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (!EventBus.getDefault().isRegistered( this)){
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
Reference in New Issue
Block a user