eventbus调用销毁整合。
This commit is contained in:
@@ -88,8 +88,6 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
// 新增版本检查逻辑
|
||||
checkAppVersion();
|
||||
super.onCreate(savedInstanceState);
|
||||
// EventBus.getDefault().register(this);
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A0101);
|
||||
}
|
||||
private void checkAppVersion() {
|
||||
// 获取当前版本号
|
||||
@@ -125,7 +123,6 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
if (phoneNumberAuthHelper!=null) {
|
||||
phoneNumberAuthHelper.hideLoginLoading();
|
||||
//获取成功 dimiss就去登录、登录成功
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
<activity
|
||||
android:name=".activity.main.activity.MainActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="fontScale" />
|
||||
|
||||
|
||||
|
||||
@@ -61,12 +61,10 @@ public class LoginActivity extends BaseMvpActivity<LoginPresenter, ActivityLogin
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -73,13 +73,6 @@ import java.util.Map;
|
||||
public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBinding>
|
||||
implements HomeContacts.View, View.OnClickListener, LocationProvider.LocationCallback {
|
||||
private static int index = -1;
|
||||
|
||||
public static boolean isShortsShowing() {
|
||||
return index == 1;
|
||||
}
|
||||
|
||||
public String giftBagUrl;
|
||||
|
||||
private Fragment[] fragments;
|
||||
private AppUpdateDialog appUpdateDialog;
|
||||
|
||||
@@ -109,10 +102,8 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
index = -1;
|
||||
// ServiceUtils.startService(EMqttService.class);
|
||||
checkTab(getIntent().getIntExtra("tab", -1));
|
||||
|
||||
|
||||
if (getOnBackPressedDispatcher() != null) {
|
||||
getOnBackPressedDispatcher().addCallback(this, new androidx.activity.OnBackPressedCallback(true) {
|
||||
@Override
|
||||
@@ -121,11 +112,6 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
// 检查是否有正在播放的房间
|
||||
if (CommonAppContext.getInstance().isPlaying) {
|
||||
// 如果有正在播放的房间,直接退出应用
|
||||
// finish();
|
||||
// android.os.Process.killProcess(android.os.Process.myPid());
|
||||
// System.exit(0);
|
||||
// exitApp();
|
||||
|
||||
clearAllOtherTasksAndRestart();
|
||||
return;
|
||||
}
|
||||
@@ -138,10 +124,6 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
mHandler.postDelayed(() -> isExit = false, 2000);
|
||||
} else {
|
||||
exitApp();
|
||||
// 退出应用
|
||||
// finishAll();
|
||||
// android.os.Process.killProcess(android.os.Process.myPid());
|
||||
// System.exit(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -311,7 +293,6 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
// EventBus.getDefault().register(this);
|
||||
mBinding.rlMedia.setOnClickListener(this);
|
||||
mBinding.rlTrend.setOnClickListener(this);
|
||||
// mBinding.rlParty.setOnClickListener(this);
|
||||
@@ -710,7 +691,6 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
// }
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ public class CircleCategoryFragment extends BaseMvpFragment<CirclePresenter, Fra
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@SuppressLint("WrongConstant")
|
||||
@@ -179,7 +178,6 @@ public class CircleCategoryFragment extends BaseMvpFragment<CirclePresenter, Fra
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
MvpPre.getCircleList(page + "", "10");
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ import com.xscm.modulemain.dialog.SoundEffectsDialogFragment
|
||||
import com.xscm.modulemain.service.ForegroundService
|
||||
import com.xscm.modulemain.service.RoomPlayService
|
||||
import com.xscm.modulemain.BaseMvpActivity
|
||||
import com.xscm.modulemain.activity.main.activity.MainActivity
|
||||
import com.xscm.moduleutil.adapter.CommonPageAdapter
|
||||
import com.xscm.moduleutil.adapter.LikeUserAdapter
|
||||
import com.xscm.moduleutil.base.AppStateListener
|
||||
@@ -92,6 +93,9 @@ import com.xscm.moduleutil.dialog.RechargeDialogFragment
|
||||
import com.xscm.modulemain.dialog.GiftLotteryDialog
|
||||
import com.xscm.modulemain.dialog.TourClubDialogFragment
|
||||
import com.xscm.modulemain.manager.RoomManager
|
||||
import com.xscm.moduleutil.BaseEvent
|
||||
import com.xscm.moduleutil.enumType.QXRoomSeatViewType
|
||||
import com.xscm.moduleutil.enumType.RedEnvelopeStatus
|
||||
import com.xscm.moduleutil.event.*
|
||||
import com.xscm.moduleutil.event.RoomWheatEvent
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
@@ -125,7 +129,8 @@ import java.util.stream.Collectors
|
||||
|
||||
@Route(path = ARouteConstants.ROOM_DETAILS)
|
||||
class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
RoomContacts.View, PermissionCallbacks, OnMessageReceivedListener, QXRedPacketManager.QXRedPacketManagerDelegate {
|
||||
RoomContacts.View, PermissionCallbacks, OnMessageReceivedListener,
|
||||
QXRedPacketManager.QXRedPacketManagerDelegate {
|
||||
private var roomFragment: RoomFragment? = null
|
||||
var commonPageAdapter: CommonPageAdapter? = null
|
||||
private var mRoomBean: RoomBean? = null
|
||||
@@ -142,6 +147,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
var roomId: String? = null
|
||||
|
||||
var mRoomInfoResp: RoomInfoResp? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var taskId: String? = null
|
||||
@@ -200,21 +206,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
taskId = intent.getStringExtra("taskId")
|
||||
}
|
||||
|
||||
|
||||
private fun resumeRoomFromMinimize() {
|
||||
// 从最小化状态恢复房间
|
||||
isMinimized = false
|
||||
clearMinimizeState()
|
||||
|
||||
// 恢复房间状态
|
||||
resumeRoomState()
|
||||
|
||||
// 确保UI正确显示
|
||||
if (mBinding != null) {
|
||||
// 恢复UI状态
|
||||
}
|
||||
}
|
||||
|
||||
private var bgEffectView: View? = null
|
||||
|
||||
private fun setupEffectView() {
|
||||
@@ -384,14 +375,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
override fun onExitRoom() {
|
||||
// 调用退出房间方法
|
||||
// MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
|
||||
// 真正退出房间
|
||||
// 调用退出房间方法
|
||||
MessageListenerSingleton.quitGroup(roomId);
|
||||
quit();
|
||||
if (mRoomInfoResp?.getRoom_info()?.getLabel_id() != null && mRoomInfoResp?.getRoom_info()
|
||||
if (mRoomInfoResp?.getRoom_info()
|
||||
?.getLabel_id() != null && mRoomInfoResp?.getRoom_info()
|
||||
?.getLabel_id()
|
||||
.equals("5")
|
||||
) {
|
||||
@@ -445,48 +434,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
publicScreenFragment!!.someMethod()
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun roomInfoEvent(surfaceView: SurfaceEvent) {
|
||||
if (mRoomInfoResp!!.room_info.type_id == "6") { //判断是否是电影房
|
||||
floatingMagnetView = findViewById(R.id.flaoat) //电影房
|
||||
if (mRoomInfoResp!!.user_info.is_room_owner != 1) { //判断是不是房主,1:是 如何是,不展示 0不是,展示布局
|
||||
if (surfaceView.type != 1) {
|
||||
val container =
|
||||
floatingMagnetView?.findViewById<FrameLayout>(R.id.fl_screenshare)
|
||||
// mBinding.flaoat.setVisibility(GONE);//展示或不展示
|
||||
if (surfaceView == null) {
|
||||
runOnUiThread {
|
||||
mBinding!!.flaoat.visibility = View.GONE
|
||||
container?.removeAllViews()
|
||||
}
|
||||
} else {
|
||||
runOnUiThread {
|
||||
mBinding!!.flaoat.visibility = View.VISIBLE
|
||||
container?.removeAllViews()
|
||||
container?.addView(surfaceView.surfaceView)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
floatingMagnetView?.setVisibility(View.GONE)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun hideInput(event: RoomInputHideEvent) {
|
||||
if (event.hide) {
|
||||
mBinding!!.vpRoomPager.isScrollContainer = false
|
||||
} else {
|
||||
mBinding!!.vpRoomPager.isScrollContainer = true
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun roomInfoEvent(messageEvent: ColoseCardEvent?) {
|
||||
mBinding!!.flaoat.visibility = View.GONE
|
||||
exitFullScreen()
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放当前房间
|
||||
@@ -499,20 +446,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
cleanupResources()
|
||||
}
|
||||
|
||||
private lateinit var giftManager: GiftDisplayManager
|
||||
private val testHandler = Handler()
|
||||
private var testRunnable: Runnable? = null
|
||||
|
||||
// override fun onNewIntent(intent: Intent?) {
|
||||
// super.onNewIntent(intent)
|
||||
// setIntent( intent)
|
||||
// Log.d("TAG", "=== onNewIntent called ===");
|
||||
// if (intent != null) {
|
||||
// val roomId = intent.getStringExtra("roomId")
|
||||
// redPacketInfo = intent.getSerializableExtra("redPacketInfo") as RedPacketInfo?
|
||||
// }
|
||||
// }
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
Log.d("TAG", "=== onDestroy called ===");
|
||||
@@ -536,16 +469,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
// 检查是否有保存的最小化状态
|
||||
checkAndRestoreMinimizeState()
|
||||
// 获取传递的房间数据
|
||||
// 在子线程中执行网络请求
|
||||
// performNetworkRequestsAsync()
|
||||
|
||||
// roomFragment = RoomFragment.newInstance()
|
||||
// supportFragmentManager
|
||||
// .beginTransaction()
|
||||
// .replace(R.id.vp_room_pager, roomFragment!!)
|
||||
// .commitAllowingStateLoss()
|
||||
// 使用新的 OnBackPressedDispatcher API 来处理返回事件
|
||||
if (onBackPressedDispatcher != null) {
|
||||
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
@@ -568,7 +492,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
MessageListenerSingleton.getInstance().joinGroup(roomId)
|
||||
// 处理房间数据
|
||||
// handleRoomData();
|
||||
SpUtil.saveMyRoomId(roomId)
|
||||
// 检查是否从最小化状态恢复
|
||||
if (isMinimized) {
|
||||
@@ -597,7 +520,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if (CommonAppContext.getInstance().playId != null) {
|
||||
LogUtils.e("@@@", "重连成功")
|
||||
LogUtils.e("@@@", "" + CommonAppContext.getInstance().playId)
|
||||
RetrofitClient.getInstance().roomUserReconnect(CommonAppContext.getInstance().playId)
|
||||
RetrofitClient.getInstance()
|
||||
.roomUserReconnect(CommonAppContext.getInstance().playId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -766,67 +690,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 在子线程中执行网络请求,避免阻塞主线程
|
||||
*/
|
||||
private fun performNetworkRequestsAsync() {
|
||||
ThreadUtils.executeByIo(object : ThreadUtils.SimpleTask<Void?>() {
|
||||
@Throws(Throwable::class)
|
||||
override fun doInBackground(): Void? {
|
||||
// 在后台线程执行网络请求前的准备工作
|
||||
// 例如:检查缓存、预处理数据等
|
||||
// prepareNetworkRequest();
|
||||
return null
|
||||
}
|
||||
|
||||
override fun onSuccess(result: Void?) {
|
||||
runOnUiThread {
|
||||
// 使用Handler确保在主线程中调用
|
||||
// MvpPre.getRoomIn(roomId, password);
|
||||
if (mRoomInfoResp == null) {
|
||||
// 使用Handler确保在主线程中调用
|
||||
MvpPre!!.getRoomIn(roomId, password)
|
||||
|
||||
}
|
||||
MvpPre!!.getRoomOnline(roomId, "1", "10")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onFail(e: Throwable) {
|
||||
LogUtils.e("Network request preparation failed: " + e.message)
|
||||
// 即使准备失败,也尝试执行网络请求
|
||||
runOnUiThread {
|
||||
// MvpPre.getRoomIn(roomId, password);
|
||||
// 检查是否已经有房间信息,如果有则不需要再次获取
|
||||
if (mRoomInfoResp == null) {
|
||||
MvpPre!!.getRoomIn(roomId, password)
|
||||
}
|
||||
MvpPre!!.getRoomOnline(roomId, "1", "10")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onRoomTaskEvent(event: RoomTaskEvent?) {
|
||||
if (taskId != null && taskId != "9") { //这是每日任务完成发送私聊信息的事件
|
||||
RetrofitClient.getInstance().dailyTasksComplete(taskId, object : BaseObserver<RoomSingleton?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(roomSingleton: RoomSingleton) {
|
||||
number++
|
||||
// 这里处理请求结果
|
||||
if (roomSingleton.is_completed == 1) {
|
||||
// 任务完成,可以做一些后续操作
|
||||
taskId = null
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 发红包
|
||||
fun redDialogView() {
|
||||
@@ -905,30 +768,38 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mBinding!!.redBj.setOnClickListener {
|
||||
if (qxRedPacketManager!!.getAllRedPackets().size == 1) {
|
||||
redPacketInfo = qxRedPacketManager!!.getAllRedPackets().get(0)
|
||||
if (qxRedPacketManager!!.getAllRedPackets().get(0) != null && qxRedPacketManager!!.getAllRedPackets()
|
||||
if (qxRedPacketManager!!.getAllRedPackets()
|
||||
.get(0) != null && qxRedPacketManager!!.getAllRedPackets()
|
||||
.get(0).is_qiang == 1
|
||||
) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT)
|
||||
.withString("redpacketId", qxRedPacketManager!!.getAllRedPackets().get(0).getRedpacket_id())
|
||||
.withString(
|
||||
"redpacketId",
|
||||
qxRedPacketManager!!.getAllRedPackets().get(0).getRedpacket_id()
|
||||
)
|
||||
.navigation();
|
||||
} else {
|
||||
redEnvelopesFragment = RedEnvelopesFragment(this@RoomActivity)
|
||||
redEnvelopesFragment!!.setIsCollectedRoom(mRoomUserBean!!.is_collect == 1)
|
||||
redEnvelopesFragment!!.setFromToComment(false)
|
||||
redEnvelopesFragment!!.setRedPacket(qxRedPacketManager!!.getAllRedPackets().get(0))
|
||||
redEnvelopesFragment!!.setRedPacket(
|
||||
qxRedPacketManager!!.getAllRedPackets().get(0)
|
||||
)
|
||||
redEnvelopesFragment!!.show()
|
||||
}
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
redListDialog = RedListDialog(this)
|
||||
redListDialog!!.setOnRedPacketClickListener(object : RedListDialog.OnRedPacketClickListener {
|
||||
redListDialog!!.setOnRedPacketClickListener(object :
|
||||
RedListDialog.OnRedPacketClickListener {
|
||||
|
||||
override fun onRedPacketClick(redPacketInfos: RedPacketInfo?, position: Int) {
|
||||
redPacketInfo = redPacketInfos
|
||||
if (redPacketInfos != null && redPacketInfos.is_qiang == 1) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT)
|
||||
.withString("redpacketId", redPacketInfos.getRedpacket_id()).navigation();
|
||||
.withString("redpacketId", redPacketInfos.getRedpacket_id())
|
||||
.navigation();
|
||||
} else {
|
||||
redEnvelopesFragment = RedEnvelopesFragment(this@RoomActivity)
|
||||
redEnvelopesFragment!!.setIsCollectedRoom(mRoomUserBean!!.is_collect == 1)
|
||||
@@ -1085,10 +956,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if (isFullScreen) {
|
||||
exitFullScreen()
|
||||
} else {
|
||||
// enterFullScreen();
|
||||
|
||||
// 修改为横屏展示模式而不是全屏模式
|
||||
|
||||
enterLandscapeMode()
|
||||
}
|
||||
}
|
||||
@@ -1145,38 +1013,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
private fun enterFullScreen() {
|
||||
isFullScreen = true
|
||||
|
||||
|
||||
// 隐藏系统UI
|
||||
val decorView = window.decorView
|
||||
decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
|
||||
|
||||
// 设置横屏
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
|
||||
// 找到 fl_screenshare 并移到全屏容器中
|
||||
val fl_screenshare = findViewById<FrameLayout>(R.id.fl_screenshare)
|
||||
if (fl_screenshare != null) {
|
||||
// // 先从当前父容器中移除
|
||||
// ViewParent parent = fl_screenshare.getParent();
|
||||
// if (parent != null && parent instanceof ViewGroup) {
|
||||
// ((ViewGroup) parent).removeView(fl_screenshare);
|
||||
// }
|
||||
//
|
||||
// // 添加到全屏容器
|
||||
// fullScreenContainer.addView(fl_screenshare);
|
||||
|
||||
safelyMoveViewToParent(fl_screenshare, floatingMagnetView)
|
||||
// 显示全屏容器
|
||||
fullScreenContainer!!.visibility = View.VISIBLE
|
||||
floatingMagnetView!!.visibility = View.GONE
|
||||
ivExitFullscreen!!.visibility = View.VISIBLE // 显示退出按钮
|
||||
}
|
||||
}
|
||||
|
||||
private fun exitFullScreen() {
|
||||
isFullScreen = false
|
||||
|
||||
@@ -1278,9 +1114,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// PublicScreenEaseChatFragment fragment = PublicScreenEaseChatFragment.newInstance();
|
||||
// getSupportFragmentManager().beginTransaction().replace(R.id.ease_container, fragment).commitAllowingStateLoss();
|
||||
mBinding!!.ivChat.setOnClickListener { view: View ->
|
||||
this.onClick(
|
||||
view
|
||||
@@ -1334,9 +1167,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
)
|
||||
}
|
||||
|
||||
// SpUtil.saveMyRoomId(roomId);
|
||||
// MvpPre.getRoomIn(roomId, password);
|
||||
// MvpPre.getRoomOnline(roomId, "1", "10");
|
||||
mBinding!!.inputMenu1.performClick()
|
||||
|
||||
V2TIMManager.getConversationManager()
|
||||
@@ -1400,18 +1230,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
.dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
)
|
||||
QXGiftPlayerManager.getInstance(this).displayFullEffectView1(playQueue)
|
||||
// if(messageEvent?.text?.toUserInfos!=null){
|
||||
// for (i in messageEvent.text.toUserInfos.indices){
|
||||
// var giftBean = messageEvent.text.giftInfo
|
||||
// giftBean.nickname= messageEvent.text.fromUserInfo.nickname
|
||||
// giftBean.userAvatar=messageEvent.text.fromUserInfo.avatar
|
||||
// giftBean.senderName=messageEvent.text.toUserInfos.get(i).nickname
|
||||
// giftBean.senderAvatarUrl=messageEvent.text.toUserInfos.get(i).avatar
|
||||
//
|
||||
// giftBean.number=messageEvent.text.gift_num.toInt()
|
||||
// giftManager.receiveGift(giftBean)
|
||||
// }
|
||||
// }else {
|
||||
|
||||
if (messageEvent!!.text.giftInfo != null) {
|
||||
var giftBean = messageEvent.text.giftInfo
|
||||
giftBean.nickname = messageEvent.text.fromUserInfo.nickname
|
||||
@@ -1583,7 +1402,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onMessageEvent(messageEvent: MqttXlhEnd) {
|
||||
val xlhBean: XLHBean = GsonUtils.fromJson<XLHBean>(messageEvent.message, XLHBean::class.java)
|
||||
val xlhBean: XLHBean =
|
||||
GsonUtils.fromJson<XLHBean>(messageEvent.message, XLHBean::class.java)
|
||||
if (xlhBean.from_type == 100) {
|
||||
if (xlhBean.xlh_data != null) {
|
||||
if (xlhBean.xlh_data.status == 1) {
|
||||
@@ -2008,7 +1828,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if ("2" == labelId) {
|
||||
roomFragment!!.KtvFragmentEvent(messageEvent)
|
||||
} else if ("1" == labelId) {
|
||||
mRoomInfoResp!!.room_info.pit_list.set(pitNumber.toInt() - 1, getPitBean(messageEvent))
|
||||
mRoomInfoResp!!.room_info.pit_list.set(
|
||||
pitNumber.toInt() - 1,
|
||||
getPitBean(messageEvent)
|
||||
)
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment!!.SingSongEvent(messageEvent)
|
||||
}
|
||||
@@ -2085,7 +1908,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if ("2" == labelId) {
|
||||
roomFragment!!.KtvFragmentEvent(messageEvent)
|
||||
} else if ("1" == labelId) {
|
||||
mRoomInfoResp!!.room_info.pit_list.set(pitNumber.toInt() - 1, getPitBean2(messageEvent, pitNumber))
|
||||
mRoomInfoResp!!.room_info.pit_list.set(
|
||||
pitNumber.toInt() - 1,
|
||||
getPitBean2(messageEvent, pitNumber)
|
||||
)
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment!!.SingSongEvent(messageEvent)
|
||||
if (mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId().toString() + "") {
|
||||
@@ -2308,11 +2134,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
//退出房间
|
||||
fun quitRoomAll(roomId: String?) {
|
||||
MvpPre!!.quitRoom(roomId, SpUtil.getUserId().toString() + "")
|
||||
}
|
||||
|
||||
private fun handleMsgType1053(messageEvent: RoomMessageEvent, text: T?) {
|
||||
if (text == null || text.list == null || text.list.isEmpty()) return
|
||||
val pitArr: MutableList<RoomPitBean> = ArrayList()
|
||||
@@ -2750,7 +2571,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
} else if (id == R.id.rl_gift) { //礼物
|
||||
// RoomGiftDialogFragment.show(mRoomInfoResp, null, roomId, 0, "", getSupportFragmentManager());
|
||||
val fragment = RoomGiftDialogFragment.show(
|
||||
mRoomInfoResp, null, roomId, 0, "",
|
||||
supportFragmentManager
|
||||
@@ -2759,7 +2579,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
addActiveDialogFragment(fragment) // 添加到管理列表
|
||||
}
|
||||
} else if (id == R.id.iv_sound_effects) {
|
||||
// SoundEffectsDialogFragment.show(roomId, getSupportFragmentManager());
|
||||
val fragment = SoundEffectsDialogFragment.show(
|
||||
roomId,
|
||||
supportFragmentManager
|
||||
@@ -2768,14 +2587,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
addActiveDialogFragment(fragment) // 添加到管理列表
|
||||
}
|
||||
} else if (id == R.id.cl_first_charge) {
|
||||
// showWheatFeedingDialog(roomId, (mRoomInfoResp.getUser_info().getIs_room_owner() == 1 || mRoomInfoResp.getUser_info().getIs_host() == 1 || mRoomInfoResp.getUser_info().getIs_management() == 1) ? 1 : 2);
|
||||
roomFragment!!.showWheatFeedingDialog(
|
||||
roomId,
|
||||
if ((mRoomInfoResp!!.user_info.is_room_owner == 1 || mRoomInfoResp!!.user_info.is_host == 1 || mRoomInfoResp!!.user_info.is_management == 1)) 1 else 2
|
||||
)
|
||||
} else if (id == R.id.iv_wheat_feeding) { //点击上麦操作
|
||||
if (mRoomInfoResp!!.room_info.room_up_pit_type == "1") {
|
||||
// showWheatFeedingDialog(roomId, mRoomInfoResp.getUser_info().getPit_number() == 9 ? 1 : 2);
|
||||
if (aBoolean) {
|
||||
MvpPre!!.applyPit(roomId, "")
|
||||
// aBoolean = false;
|
||||
@@ -2785,11 +2602,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
} else {
|
||||
if (aBoolean) {
|
||||
// mBinding.ivWheatFeeding.setImageResource(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up);
|
||||
MvpPre!!.applyPit(roomId, "")
|
||||
aBoolean = false
|
||||
} else {
|
||||
// mBinding.ivWheatFeeding.setImageResource(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
||||
MvpPre!!.downPit(roomId, "")
|
||||
aBoolean = true
|
||||
}
|
||||
@@ -2807,28 +2622,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
CommonAppContext.getInstance().isPlaying = false
|
||||
CommonAppContext.getInstance().isShow = false
|
||||
QXGiftPlayerManager.getInstance(this).destroyEffectSvga()
|
||||
// 停止屏幕捕获和其他资源
|
||||
// AgoraManager.getInstance(this).stopScreenCapture();
|
||||
// AgoraManager.getInstance(this).leaveRoom();
|
||||
// AgoraManager.getInstance(this).stopMusicPlayer();
|
||||
AgoraManager.getInstance(this).cleanup()
|
||||
|
||||
MyRoomSingleton.getInstance().onExitRoom()
|
||||
MessageListenerSingleton.quitGroup(roomId)
|
||||
// 清理ViewModel中的数据
|
||||
// if (sharedViewModel != null) {
|
||||
// sharedViewModel.clearAllData();
|
||||
// }
|
||||
RoomManager.getInstance().exitRoom(roomId)
|
||||
// 清理资源
|
||||
cleanupResources()
|
||||
// if (type == 1) {
|
||||
// // 导航到首页
|
||||
// navigateToMainPage()
|
||||
// } else if (type == 2) {
|
||||
// // 返回上一个页面
|
||||
// finish()
|
||||
// }
|
||||
|
||||
finish()
|
||||
}
|
||||
@@ -2892,33 +2692,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
appStateListener!!.isAppInBackground = true
|
||||
}
|
||||
QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga()
|
||||
ARouter.getInstance()
|
||||
.build(ARouteConstants.ME)
|
||||
.navigation()
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.ME)
|
||||
// .addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
// .navigation();
|
||||
|
||||
// 使用Intent启动主Activity,通过ARouter路径
|
||||
// 这样可以避免模块间的直接依赖
|
||||
// try {
|
||||
// val intent = Intent()
|
||||
// intent.setClassName(packageName, "com.xscm.modulemain.activity.MainActivity")
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
// startActivity(intent)
|
||||
// } catch (e: Exception) {
|
||||
// // 如果直接指定类名失败,则使用默认的Launcher Activity
|
||||
// val startMain = Intent(Intent.ACTION_MAIN)
|
||||
// startMain.addCategory(Intent.CATEGORY_HOME)
|
||||
// startMain.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
|
||||
// startActivity(startMain)
|
||||
// }
|
||||
|
||||
// 隐藏Activity而不是销毁它
|
||||
// moveTaskToBack(true);
|
||||
// 使用 moveTaskToBack 将应用最小化
|
||||
// moveTaskToBack(true);
|
||||
toActivity(MainActivity::class.java)
|
||||
}
|
||||
|
||||
private fun saveMinimizeState() {
|
||||
@@ -3221,7 +2995,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if (type == 2) {
|
||||
if (redPacketInfo != null) {
|
||||
LogUtils.e("输入口令红包", redPacketInfo)
|
||||
LogUtils.e("输入口令红包", "# 口令红包 " + redPacketInfo!!.password, "inputSting", inputSting)
|
||||
LogUtils.e(
|
||||
"输入口令红包",
|
||||
"# 口令红包 " + redPacketInfo!!.password,
|
||||
"inputSting",
|
||||
inputSting
|
||||
)
|
||||
if (intRed_num == null || intRed_num!!.isEmpty()) {
|
||||
return@OnClickListener
|
||||
}
|
||||
@@ -3304,7 +3083,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun roomOut(roomOutEvent: RoomOutEvent?) {
|
||||
// MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
performExitRoom(2)
|
||||
}
|
||||
|
||||
@@ -3546,7 +3324,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mBinding!!.ivQuanC.setOnClickListener { v: View? ->
|
||||
if (mRoomInfoResp!!.room_info.head_line.room_id != null && mRoomInfoResp!!.room_info.head_line.room_id.isNotEmpty()) {
|
||||
if (mRoomInfoResp!!.room_info.head_line.room_id != roomId) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(applicationContext, mRoomInfoResp!!.room_info.head_line.room_id, "",null)
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(
|
||||
applicationContext,
|
||||
mRoomInfoResp!!.room_info.head_line.room_id,
|
||||
"",
|
||||
null
|
||||
)
|
||||
} else {
|
||||
com.blankj.utilcode.util.ToastUtils.showLong("您就在当前房间")
|
||||
}
|
||||
@@ -3666,24 +3449,76 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
finish()
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun logOutEvent(musicEvent: MusicEvent?) {
|
||||
// mBinding.musicView.setVisibility(VISIBLE);
|
||||
// musicWindowControl.show(); // <<< 添加这行代码
|
||||
if (!isMusic) {
|
||||
xunf()
|
||||
isMusic = true
|
||||
fun onMusicEvent(event: Music?) {
|
||||
if (customMusicFloatingView != null) {
|
||||
customMusicFloatingView!!.onMusicEvent(event)
|
||||
}
|
||||
// RequestDialogFragment.show(roomId, mRoomInfoResp, 2, getSupportFragmentManager());
|
||||
val fragment = RequestDialogFragment.show(
|
||||
roomId, mRoomInfoResp, 2,
|
||||
supportFragmentManager
|
||||
)
|
||||
if (fragment != null) {
|
||||
addActiveDialogFragment(fragment) // 添加到管理列表
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onMusicPlayBeanEvent(event: MusicPlayBean) {
|
||||
if (customMusicFloatingView != null) {
|
||||
customMusicFloatingView!!.updateProgress(Math.toIntExact(event.position))
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onEventMain(event: BaseEvent?) {
|
||||
if (event is MusicEvent) {
|
||||
if (!isMusic) {
|
||||
xunf()
|
||||
isMusic = true
|
||||
}
|
||||
val fragment = RequestDialogFragment.show(
|
||||
roomId, mRoomInfoResp, 2,
|
||||
supportFragmentManager
|
||||
)
|
||||
if (fragment != null) {
|
||||
addActiveDialogFragment(fragment) // 添加到管理列表
|
||||
}
|
||||
} else if (event is RoomInputHideEvent) {
|
||||
mBinding!!.vpRoomPager.isScrollContainer = !event.hide
|
||||
} else if (event is SurfaceEvent) {
|
||||
if (mRoomInfoResp!!.room_info.type_id == "6") { //判断是否是电影房
|
||||
floatingMagnetView = findViewById(R.id.flaoat) //电影房
|
||||
if (mRoomInfoResp!!.user_info.is_room_owner != 1) { //判断是不是房主,1:是 如何是,不展示 0不是,展示布局
|
||||
if (event.type != 1) {
|
||||
val container =
|
||||
floatingMagnetView?.findViewById<FrameLayout>(R.id.fl_screenshare)
|
||||
mBinding!!.flaoat.visibility = View.VISIBLE
|
||||
container?.removeAllViews()
|
||||
container?.addView(event.surfaceView)
|
||||
} else {
|
||||
floatingMagnetView?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (event is ColoseCardEvent) {
|
||||
mBinding!!.flaoat.visibility = View.GONE
|
||||
exitFullScreen()
|
||||
} else if (event is RoomTaskEvent) {
|
||||
if (taskId != null && taskId != "9") { //这是每日任务完成发送私聊信息的事件
|
||||
RetrofitClient.getInstance()
|
||||
.dailyTasksComplete(taskId, object : BaseObserver<RoomSingleton?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(roomSingleton: RoomSingleton) {
|
||||
number++
|
||||
// 这里处理请求结果
|
||||
if (roomSingleton.is_completed == 1) {
|
||||
// 任务完成,可以做一些后续操作
|
||||
taskId = null
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 背景音乐
|
||||
*/
|
||||
@@ -3756,10 +3591,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
MvpPre!!.roomRedPackets(roomId);
|
||||
LogUtils.e("RoomActivity", "onResume")
|
||||
|
||||
if ((mRoomInfoResp?.room_info?.type_id.equals("1") || mRoomInfoResp?.room_info?.type_id.equals("8") || mRoomInfoResp?.room_info?.type_id.equals(
|
||||
if ((mRoomInfoResp?.room_info?.type_id.equals("1") || mRoomInfoResp?.room_info?.type_id.equals(
|
||||
"8"
|
||||
) || mRoomInfoResp?.room_info?.type_id.equals(
|
||||
"3"
|
||||
)
|
||||
|| mRoomInfoResp?.room_info?.type_id.equals("4")) && mRoomInfoResp?.room_info?.label_id.equals("2")
|
||||
|| mRoomInfoResp?.room_info?.type_id.equals("4")) && mRoomInfoResp?.room_info?.label_id.equals(
|
||||
"2"
|
||||
)
|
||||
) {
|
||||
return
|
||||
}
|
||||
@@ -4476,19 +4315,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onMusicEvent(event: Music) {
|
||||
if (customMusicFloatingView != null) {
|
||||
customMusicFloatingView!!.onMusicEvent(event)
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onMusicPlay(musicPlayBean: MusicPlayBean) {
|
||||
if (customMusicFloatingView != null) {
|
||||
customMusicFloatingView!!.updateProgress(Math.toIntExact(musicPlayBean.position))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMessageReceived(message: RoomMessageEvent) {
|
||||
EventBus.getDefault().post(message)
|
||||
|
||||
@@ -1718,11 +1718,6 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideAllWheatMaozi() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 销毁视图和资源
|
||||
|
||||
@@ -113,17 +113,12 @@ public class MusicSongListFragment extends BaseMvpFragment<RequestPresenter, Fra
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
// if (!EventBus.getDefault().isRegistered( this)) {
|
||||
// EventBus.getDefault().register(this);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -181,7 +176,6 @@ public class MusicSongListFragment extends BaseMvpFragment<RequestPresenter, Fra
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
// AgoraManager.getInstance(getContext()).searchMusic( mBinding.editQuery.getText().toString(),page);
|
||||
MvpPre.songList(roomId);
|
||||
|
||||
@@ -118,7 +118,6 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
|
||||
// 注册当前 Fragment 到 RoomMessageManager
|
||||
// RoomMessageManager.getInstance().register(this);
|
||||
@@ -126,20 +125,12 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
// mBinding.recycleView.removeCallbacks(joinChatRoomTask);
|
||||
// EventBus.getDefault().unregister(this);
|
||||
// RoomMessageManager.getInstance().unregister(this);
|
||||
// if (countDownTimer != null) {
|
||||
// countDownTimer.cancel();
|
||||
// }
|
||||
onFragmentShowDestroy();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
public void onFragmentShowDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
@@ -354,10 +345,6 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
|
||||
if (emMessage.getText().getFromUserInfo() != null) {
|
||||
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), emMessage.getText().getFromUserInfo().getUser_id() != 0 ? emMessage.getText().getFromUserInfo().getUser_id() + "" : emMessage.getText().getFromUserInfo().getId() + "", emMessage.getText().getFromUserInfo().getPit_number(), getHostUser(roomInfoResp.getUser_info()), false, 5, isNumberWhether(), getChildFragmentManager());
|
||||
}
|
||||
// String userId = item.getEmMessage().getStringAttribute("user_id", "");
|
||||
// if (!TextUtils.isEmpty(userId)) {
|
||||
// EventBus.getDefault().post(new UserInfoShowEvent(roomInfoResp.getRoom_info().getRoom_id(), userId));
|
||||
// }
|
||||
|
||||
});
|
||||
//
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.xscm.modulemain.activity.room.fragment;
|
||||
|
||||
import static com.xscm.moduleutil.event.RedEnvelopeStatus.QXRedBagDrawTypeCollect;
|
||||
import static com.xscm.moduleutil.event.RedEnvelopeStatus.QXRedBagDrawTypeOpen;
|
||||
import static com.xscm.moduleutil.event.RedEnvelopeStatus.QXRedBagDrawTypePwdSend;
|
||||
import static com.xscm.moduleutil.event.RedEnvelopeStatus.QXRedBagDrawTypeTimeDown;
|
||||
import static com.xscm.moduleutil.enumType.RedEnvelopeStatus.QXRedBagDrawTypeCollect;
|
||||
import static com.xscm.moduleutil.enumType.RedEnvelopeStatus.QXRedBagDrawTypeOpen;
|
||||
import static com.xscm.moduleutil.enumType.RedEnvelopeStatus.QXRedBagDrawTypePwdSend;
|
||||
import static com.xscm.moduleutil.enumType.RedEnvelopeStatus.QXRedBagDrawTypeTimeDown;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.CountDownTimer;
|
||||
@@ -24,7 +24,7 @@ import com.xscm.modulemain.databinding.FragmentRedEnvelopesBinding;
|
||||
import com.xscm.moduleutil.bean.RedPackGrab;
|
||||
import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.event.RedEnvelopeStatus;
|
||||
import com.xscm.moduleutil.enumType.RedEnvelopeStatus;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
|
||||
@@ -95,13 +95,11 @@ public class RequestFragment extends BaseMvpFragment<RequestPresenter, FragmentR
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -172,7 +170,6 @@ public class RequestFragment extends BaseMvpFragment<RequestPresenter, FragmentR
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
AgoraManager.getInstance(getContext()).searchMusic(mBinding.editQuery.getText().toString(), page);
|
||||
}
|
||||
|
||||
@@ -657,20 +657,6 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
super.initListener();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void hideAllWheatMaozi() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void showWheatMaoziHuangguan(int wheat) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showWheatMaoziBianbian(int... wheats) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] collectCurrentCardiacValues() {
|
||||
int[] cvs = new int[8];
|
||||
|
||||
@@ -39,7 +39,7 @@ import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.event.QXRoomSeatViewType;
|
||||
import com.xscm.moduleutil.enumType.QXRoomSeatViewType;
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
@@ -353,10 +353,6 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
}
|
||||
|
||||
public void onFragmentShowDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
// ImageUtils.clearDiskCache(getActivity());
|
||||
// 释放SVGA动画资源
|
||||
if (mBinding != null && mBinding.svgaNobility != null) {
|
||||
mBinding.svgaNobility.release();
|
||||
@@ -432,19 +428,12 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
LogUtils.e("lxj", "创建room时间:" + TimeUtils.date2String(new Date()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
// 在 onStop 中也注销 EventBus,防止内存泄漏
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
// 提前释放计时器资源
|
||||
releaseCountDownTimer();
|
||||
|
||||
@@ -266,9 +266,6 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -611,11 +608,6 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
|
||||
public void releaseResources() {
|
||||
endRotateAnimation();
|
||||
// AgoraManager.getInstance(getActivity()).destroy();
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
// ImageUtils.clearDiskCache(getActivity());
|
||||
}
|
||||
|
||||
//开始旋转
|
||||
|
||||
@@ -342,7 +342,6 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
|
||||
|
||||
protected void tzblChanged() {
|
||||
// mBinding.dhv9.updateTzbl(SpUtil.getTzbl(roomId));
|
||||
|
||||
StringBuilder userIds = new StringBuilder();
|
||||
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||
@@ -773,19 +772,6 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideAllWheatMaozi() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void showWheatMaoziHuangguan(int wheat) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showWheatMaoziBianbian(int... wheats) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] collectCurrentCardiacValues() {
|
||||
int[] cvs = new int[10];
|
||||
|
||||
@@ -87,13 +87,11 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
// EventBus.getDefault().register(this);
|
||||
return super.onCreateView(inflater, container, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
|
||||
@@ -65,13 +65,11 @@ public class MyRoomListFragment extends BaseMvpFragment<MyRoomPresenter, RoomFra
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
// EventBus.getDefault().register(this);
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
// EventBus.getDefault().unregister(this);
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
|
||||
@@ -410,12 +410,10 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
// EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
// EventBus.getDefault().unregister(this);
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.xscm.moduleutil.dialog.giftLottery.GiftLotteryContacts;
|
||||
import com.xscm.moduleutil.dialog.giftLottery.GiftLotteryDialogFragment;
|
||||
import com.xscm.moduleutil.dialog.giftLottery.GiftLotteryPresenter;
|
||||
import com.xscm.moduleutil.dialog.giftLottery.PrizePoolDialog;
|
||||
import com.xscm.moduleutil.event.LotteryEvent;
|
||||
import com.xscm.moduleutil.enumType.LotteryEvent;
|
||||
import com.xscm.moduleutil.widget.CircularProgressView;
|
||||
import com.xscm.moduleutil.widget.GiftCardView;
|
||||
|
||||
@@ -137,9 +137,6 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
heart_id = getArguments().getString("heart_id");
|
||||
auction_id = getArguments().getString("auction_id");
|
||||
|
||||
if (!EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1057,11 +1054,6 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
player.release();
|
||||
player = null;
|
||||
}
|
||||
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
// 建议进行垃圾回收
|
||||
System.gc();
|
||||
}
|
||||
|
||||
@@ -111,7 +111,6 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
EventBus.getDefault().register(this);
|
||||
roomInfoResp = (RoomInfoResp) getArguments().getSerializable("roomInfoResp");
|
||||
userInfo = (UserInfo) getArguments().getSerializable("userInfo");
|
||||
roomId = getArguments().getString("roomId");
|
||||
@@ -128,7 +127,6 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
EventBus.getDefault().unregister(this);
|
||||
// 清理资源,防止内存泄漏
|
||||
if (mSelectGiftNumPopupWindow != null) {
|
||||
mSelectGiftNumPopupWindow.dismiss();
|
||||
|
||||
@@ -79,9 +79,6 @@ public class RoomHostFragment extends BaseMvpDialogFragment<RoomHostPresenter, R
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
EventBus.getDefault().register(this); // 注册EventBus
|
||||
|
||||
// MvpPre.clearHostList(mRoomId, "1");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -207,7 +204,6 @@ public class RoomHostFragment extends BaseMvpDialogFragment<RoomHostPresenter, R
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
EventBus.getDefault().unregister(this); // 取消注册EventBus
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -112,7 +112,6 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
EventBus.getDefault().register(this);
|
||||
Window window = getDialog().getWindow();
|
||||
if (window != null) {
|
||||
// 设置固定高度为 500dp
|
||||
@@ -130,7 +129,6 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -81,7 +81,6 @@ public class RoomWheatGiftSettingFragment extends BaseMvpDialogFragment<RewardGi
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
EventBus.getDefault().register(this);
|
||||
Window window = getDialog().getWindow();
|
||||
if (window != null) {
|
||||
// 设置固定高度为 500dp
|
||||
@@ -134,7 +133,6 @@ public class RoomWheatGiftSettingFragment extends BaseMvpDialogFragment<RewardGi
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
||||
@@ -105,8 +105,6 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
Dialog dialog = super.onCreateDialog(savedInstanceState);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setCancelable(true);
|
||||
if (!EventBus.getDefault().isRegistered(this))
|
||||
EventBus.getDefault().register(this);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@@ -550,9 +548,6 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
giftXlhChouAdapter = null;
|
||||
}
|
||||
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
if (xlhRecordDialog != null && xlhRecordDialog.isVisible()) {
|
||||
xlhRecordDialog.dismiss();
|
||||
|
||||
@@ -118,9 +118,6 @@ public class WheatFeedingDialogFragment extends BaseMvpDialogFragment<WheatPrese
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
Window window = getDialog().getWindow();
|
||||
if (window != null) {
|
||||
// 设置固定高度为 500dp
|
||||
|
||||
@@ -158,13 +158,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/room_top">
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.Guideline-->
|
||||
<!-- android:id="@+id/guideline_horizontal"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- app:layout_constraintGuide_percent="0.66" />-->
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/vp_room_pager"
|
||||
android:layout_width="0dp"
|
||||
@@ -409,24 +402,6 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
<!-- <com.xscm.moduleutil.widget.AvatarFrameView-->
|
||||
<!-- android:id="@+id/svga_gift"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!-- <com.xscm.moduleutil.widget.AvatarFrameView-->
|
||||
<!-- android:id="@+id/svga_zuoji"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!--礼物连送图标-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/gift_show_layout"
|
||||
|
||||
@@ -121,6 +121,5 @@
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
Reference in New Issue
Block a user