Files
yusheng-android/MainModule/src/main/java/com/xscm/modulemain/dialog/RoomSettingFragment.java

904 lines
49 KiB
Java
Raw Normal View History

2025-10-28 16:56:13 +08:00
package com.xscm.modulemain.dialog;
2025-10-20 10:16:44 +08:00
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomBusinessTime;
2025-10-20 10:16:44 +08:00
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomOrderMic;
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomTimeRedSound;
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomTimeSpace;
2025-10-20 10:16:44 +08:00
import android.content.Context;
2025-10-24 17:52:11 +08:00
import android.content.Intent;
2025-10-20 10:16:44 +08:00
import android.os.Bundle;
import android.util.Log;
2025-10-24 17:52:11 +08:00
import android.view.*;
2025-10-20 10:16:44 +08:00
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
2025-10-20 10:16:44 +08:00
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.GsonUtils;
import com.blankj.utilcode.util.LogUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.hjq.toast.ToastUtils;
2025-10-28 16:56:13 +08:00
import com.xscm.modulemain.R;
import com.xscm.modulemain.activity.room.activity.RoomActivity;
import com.xscm.modulemain.activity.room.contacts.RoomSettingContacts;
import com.xscm.modulemain.activity.room.fragment.RoomBackgroundDialogFragment;
import com.xscm.modulemain.activity.room.presenter.RoomSettingPresenter;
2025-12-22 18:40:57 +08:00
import com.xscm.modulemain.adapter.HorizontalListAdapter;
2025-10-28 16:56:13 +08:00
import com.xscm.modulemain.adapter.RoomSettingAdapter;
import com.xscm.modulemain.databinding.DialogRoomSettingFragmentBinding;
2025-10-28 19:13:52 +08:00
import com.xscm.modulemain.activity.WebViewActivity;
2025-10-20 10:16:44 +08:00
import com.xscm.moduleutil.base.CommonAppContext;
2025-11-18 18:28:16 +08:00
import com.xscm.moduleutil.base.WebUrlConstants;
import com.xscm.moduleutil.bean.BlindBoxStatus;
2025-10-24 17:52:11 +08:00
import com.xscm.moduleutil.dialog.ConfirmDialog;
2025-10-20 10:16:44 +08:00
import com.xscm.moduleutil.event.EffectEvent;
2025-10-24 17:52:11 +08:00
import com.xscm.moduleutil.event.FloatingScreenEvent;
2025-10-20 10:16:44 +08:00
import com.xscm.moduleutil.event.MusicEvent;
import com.xscm.moduleutil.listener.MessageListenerSingleton;
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
import com.xscm.moduleutil.bean.RoomMessageEvent;
import com.xscm.moduleutil.bean.RoomSettingEvent;
import com.xscm.moduleutil.bean.room.RoomInfoResp;
import com.xscm.moduleutil.bean.room.RoomSettingBean;
import com.xscm.moduleutil.utils.ARouteConstants;
import com.xscm.moduleutil.utils.SpUtil;
import com.xscm.moduleutil.widget.DoubleTimePickerBottomSheet;
2025-10-20 10:16:44 +08:00
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
2025-10-20 10:16:44 +08:00
import java.util.ArrayList;
import java.util.Calendar;
2025-10-20 10:16:44 +08:00
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
2025-10-20 10:16:44 +08:00
/**
* @author qx
* @data 2025/6/17
* @description: 房间设置弹框
*/
public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresenter, DialogRoomSettingFragmentBinding> implements RoomSettingContacts.View {
private String userId;
private String roomId;
RoomSettingAdapter adapter;
List<RoomSettingBean> dataList;
// 创建父级列表
List<RoomSettingBean> parentList = new ArrayList<>();
2025-10-20 10:16:44 +08:00
private RoomInfoResp roomInfoResp;
private int read;
private boolean isSelected;
private boolean effectOn = false;//开启/关闭特效
private boolean redSound = false;//开启/关闭红包声音
2025-10-24 17:52:11 +08:00
private boolean floatingScreen = false;//开启/关闭飘屏
2025-10-20 10:16:44 +08:00
List<RoomSettingBean> filteredList = new ArrayList<>();
List<RoomSettingBean> blindList = new ArrayList<>();//盲盒列表
2025-10-20 10:16:44 +08:00
@Override
protected RoomSettingPresenter bindPresenter() {
return new RoomSettingPresenter(this, getActivity());
}
2025-10-24 17:52:11 +08:00
public static RoomSettingFragment show(RoomInfoResp roomInfoResp, FragmentManager fragmentManager) {
2025-10-20 10:16:44 +08:00
RoomSettingFragment dialogFragment = new RoomSettingFragment();
Bundle args = new Bundle();
args.putSerializable("roomInfoResp", roomInfoResp);
dialogFragment.setArguments(args);
dialogFragment.show(fragmentManager, "RoomSettingFragment");
2025-10-24 17:52:11 +08:00
return dialogFragment;
2025-10-20 10:16:44 +08:00
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
// roomId=getArguments().getString("roomId");
roomInfoResp = (RoomInfoResp) getArguments().getSerializable("roomInfoResp");
if (roomInfoResp == null) {
2025-10-24 17:52:11 +08:00
ToastUtils.show("房间信息为空");
return;
}
2025-10-20 10:16:44 +08:00
roomId = roomInfoResp.getRoom_info().getRoom_id();
if (roomInfoResp.getUser_info().getIs_room_owner() != 0) {
read = 1;
} else if (roomInfoResp.getUser_info().getIs_management() != 0) {
read = 2;
2025-10-24 17:52:11 +08:00
} else if (roomInfoResp.getUser_info().getIs_host() != 0) {
2025-10-20 10:16:44 +08:00
read = 3;
2025-10-24 17:52:11 +08:00
} else {
2025-10-20 10:16:44 +08:00
read = 4;
}
if (roomInfoResp.getUser_info().getPit_number() != 0) {
isSelected = true;
} else {
isSelected = false;
}
2025-10-20 10:16:44 +08:00
}
@Override
protected void initDialogStyle(Window window) {
super.initDialogStyle(window);
window.setGravity(Gravity.BOTTOM);
}
@Override
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
if (window != null) {
// 设置固定高度为 500dp
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
// 可选:设置动画样式(从底部弹出)
window.setWindowAnimations(com.xscm.moduleutil.R.style.CommonShowDialogBottom);
}
}
@Override
public void onStop() {
super.onStop();
}
@Override
protected void initData() {
2025-10-20 10:16:44 +08:00
dataList = new ArrayList<>();
effectOn = SpUtil.getOpenEffect() == 1;
2025-10-24 17:52:11 +08:00
floatingScreen = SpUtil.getFloatingScreen() == 1;
redSound = SpUtil.getRedSound() == 1;
2025-10-20 10:16:44 +08:00
boolean b = roomInfoResp.getRoom_info().getRoom_up_pit_type().equals("1");
LogUtils.e("effectOn=" + effectOn);
// 房间类型组
RoomSettingBean roomTypeParent = new RoomSettingBean("房间类型", null, null, null, -1, read, isSelected, false, false);
List<RoomSettingBean> roomTypeChildren = new ArrayList<>();
roomTypeChildren.add(new RoomSettingBean("交友", "ic_sing", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSing, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("拍卖", "ic_auction", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeAuction, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("点唱", "jiao_y", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("互娱", "ic_jiaoy", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU, read, isSelected, false, false));
// roomTypeChildren.add(new RoomSettingBean("练歌房", "ic_liang", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeLianG, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("签约", "sing_contract", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT, read, isSelected, false, false));
roomTypeChildren.add(new RoomSettingBean("酒吧房", "rub_room", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypePUBROOM, read, isSelected, false, false));
roomTypeParent.setChildren(roomTypeChildren);
parentList.add(roomTypeParent);
// 常用工具组
RoomSettingBean toolsParent = new RoomSettingBean("常用工具", null, null, null, -1, read, isSelected, false, false);
List<RoomSettingBean> toolsChildren = new ArrayList<>();
toolsChildren.add(new RoomSettingBean("房间补贴", "ic_subsidy", null, null, RoomSettingBean.QXRoomSettingTypeRoomSubsidy, read, isSelected, false, false));
toolsChildren.add(new RoomSettingBean("主持设置", "ic_compere", null, null, RoomSettingBean.QXRoomSettingTypeRoomCompere, read, isSelected, false, false));
toolsChildren.add(new RoomSettingBean("清空消息", "ic_clear_message", null, null, RoomSettingBean.QXRoomSettingTypeRoomClearMessage, read, isSelected, false, false));
toolsChildren.add(new RoomSettingBean("排麦模式", "ic_order_mic", null, null, QXRoomSettingTypeRoomOrderMic, read, isSelected, false, roomInfoResp.getRoom_info().getRoom_up_pit_type().equals("1")));
toolsChildren.add(new RoomSettingBean("背景音乐", "ic_bg_music", null, null, RoomSettingBean.QXRoomSettingTypeRoomBgMusic, read, isSelected, false, false));
toolsChildren.add(new RoomSettingBean("背景图片", "ic_bg_image", null, null, RoomSettingBean.QXRoomSettingTypeRoomBgImage, read, isSelected, false, false));
toolsChildren.add(new RoomSettingBean("营业时间", "ic_bg_image", null, null, QXRoomSettingTypeRoomBusinessTime, read, isSelected, false, false));
toolsParent.setChildren(toolsChildren);
parentList.add(toolsParent);
// 更多操作组
RoomSettingBean moreParent = new RoomSettingBean("更多操作", null, null, null, -1, read, isSelected, false, false);
List<RoomSettingBean> moreChildren = new ArrayList<>();
moreChildren.add(new RoomSettingBean("发红包", "ic_red", null, null, RoomSettingBean.QXRoomSettingTypeRoomFloatingRed, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("房间设置", "ic_room_setting", null, null, RoomSettingBean.QXRoomSettingTypeRoomSetting, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("关闭特效", "ic_close_effects", null, null, RoomSettingBean.QXRoomSettingTypeRoomCloseEffects, read, isSelected, false, effectOn));
moreChildren.add(new RoomSettingBean("关闭飘屏", "ic_close_floating_screen", null, null, RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen, read, isSelected, false, floatingScreen));
moreChildren.add(new RoomSettingBean("举报", "ic_report", null, null, RoomSettingBean.QXRoomSettingTypeRoomReport, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("岁月之城", "the_city_years", null, null, RoomSettingBean.QXRoomSettingTypeRoomTheCityYears, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("时空之巅", "time_space", null, null, QXRoomSettingTypeRoomTimeSpace, read, isSelected, false, false));
moreChildren.add(new RoomSettingBean("关闭红包声音", "crossing", null, null, QXRoomSettingTypeRoomTimeRedSound, read, isSelected, false, redSound));
moreParent.setChildren(moreChildren);
parentList.add(moreParent);
/*
2025-10-20 10:16:44 +08:00
// 添加标题和对应的内容项
dataList.add(new RoomSettingBean("房间类型", null, null, null, -1, read, isSelected, false, false));
2025-11-18 19:39:16 +08:00
dataList.add(new RoomSettingBean("交友", "ic_sing", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSing, read, isSelected, false, false));
2025-10-20 10:16:44 +08:00
dataList.add(new RoomSettingBean("拍卖", "ic_auction", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeAuction, read, isSelected, false, false));
2025-10-24 17:52:11 +08:00
// dataList.add(new RoomSettingBean("男神", "ic_boy", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeBoy, read, isSelected, false, false));
// dataList.add(new RoomSettingBean("女神", "ic_girl", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeGirl, read, isSelected, false, false));
2025-11-18 19:39:16 +08:00
dataList.add(new RoomSettingBean("点唱", "jiao_y", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy, read, isSelected, false, false));// 添加的新的房间类型 ,交友 ,是原来的男神女神类型
dataList.add(new RoomSettingBean("互娱", "ic_jiaoy", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU, read, isSelected, false, false)); //原交友,更改互娱 2025年9月19日11:18:01
2025-11-05 11:08:00 +08:00
dataList.add(new RoomSettingBean("练歌房", "ic_liang", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeLianG, read, isSelected, false, false)); //练歌房,原点歌房,同意的时候,走同意点歌的逻辑
dataList.add(new RoomSettingBean("签约", "sing_contract", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT, read, isSelected, false, false)); //签约房
2025-10-24 17:52:11 +08:00
2025-10-20 10:16:44 +08:00
dataList.add(new RoomSettingBean("常用工具", null, null, null, -1, read, isSelected, false, false));
dataList.add(new RoomSettingBean("房间补贴", "ic_subsidy", null, null, RoomSettingBean.QXRoomSettingTypeRoomSubsidy, read, isSelected, false, false));
dataList.add(new RoomSettingBean("主持设置", "ic_compere", null, null, RoomSettingBean.QXRoomSettingTypeRoomCompere, read, isSelected, false, false));
dataList.add(new RoomSettingBean("清空消息", "ic_clear_message", null, null, RoomSettingBean.QXRoomSettingTypeRoomClearMessage, read, isSelected, false, false));
2025-10-24 17:52:11 +08:00
dataList.add(new RoomSettingBean("排麦模式", "ic_order_mic", null, null, QXRoomSettingTypeRoomOrderMic, read, isSelected, false, roomInfoResp.getRoom_info().getRoom_up_pit_type().equals("1")));//等于1的时候是排麦模式等于2的时候是自由模式这里判断是否是拍卖模式
2025-10-20 10:16:44 +08:00
dataList.add(new RoomSettingBean("背景音乐", "ic_bg_music", null, null, RoomSettingBean.QXRoomSettingTypeRoomBgMusic, read, isSelected, false, false));
dataList.add(new RoomSettingBean("背景图片", "ic_bg_image", null, null, RoomSettingBean.QXRoomSettingTypeRoomBgImage, read, isSelected, false, false));
dataList.add(new RoomSettingBean("更多操作", null, null, null, -1, read, isSelected, false, false));
2025-10-24 17:52:11 +08:00
dataList.add(new RoomSettingBean("发红包", "ic_red", null, null, RoomSettingBean.QXRoomSettingTypeRoomFloatingRed, read, isSelected, false, false));
// dataList.add(new RoomSettingBean("离开房间", "ic_leave", null, null, RoomSettingBean.QXRoomSettingTypeRoomLeave, read, isSelected, false, false));
2025-10-20 10:16:44 +08:00
// dataList.add(new RoomSettingBean("分享房间", "ic_share", null, null, RoomSettingBean.QXRoomSettingTypeRoomShare, read, isSelected, false, false));
2025-11-05 11:08:00 +08:00
// dataList.add(new RoomSettingBean("调音台", "ic_my_dress", null, null, RoomSettingBean.QXRoomSettingTypeRoomMyDress, read, isSelected, false, false));
2025-10-20 10:16:44 +08:00
dataList.add(new RoomSettingBean("房间设置", "ic_room_setting", null, null, RoomSettingBean.QXRoomSettingTypeRoomSetting, read, isSelected, false, false));
// dataList.add(new RoomSettingBean("房间欢迎语", "ic_welcome", null, null, RoomSettingBean.QXRoomSettingTypeRoomWelcome,read,isSelected, false));
2025-10-24 17:52:11 +08:00
dataList.add(new RoomSettingBean("关闭特效", "ic_close_effects", null, null, RoomSettingBean.QXRoomSettingTypeRoomCloseEffects, read, isSelected, false, effectOn));
dataList.add(new RoomSettingBean("关闭飘屏", "ic_close_floating_screen", null, null, RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen, read, isSelected, false, floatingScreen));
2025-10-20 10:16:44 +08:00
dataList.add(new RoomSettingBean("举报", "ic_report", null, null, RoomSettingBean.QXRoomSettingTypeRoomReport, read, isSelected, false, false));
dataList.add(new RoomSettingBean("岁月之城", "the_city_years", null, null, RoomSettingBean.QXRoomSettingTypeRoomTheCityYears, read, isSelected, false, false));
dataList.add(new RoomSettingBean("时空之巅", "time_space", null, null, RoomSettingBean.QXRoomSettingTypeRoomTimeSpace, read, isSelected, false, false));
*/
// 更新 itemType
for (RoomSettingBean bean : parentList) {
bean.setRead(read);
bean.setSelected(isSelected);
switch (read) {
case 1, 2, 3:
bean.setStatus(true);
break;
case 4:
if (bean.getName().equals("房间类型") || bean.getName().equals("常用工具")) {
bean.setStatus(false);
bean.setChildren(null);
} else {
bean.setStatus(true);
}
break;
}
// 如果是父级项目(type = -1)
// 检查父级是否可见
// 处理子项
List<RoomSettingBean> children = bean.getChildren();
List<RoomSettingBean> children2 = new ArrayList<>();
if (children != null && !children.isEmpty()) {
for (RoomSettingBean child : children) {
child.setRead(read);
child.setSelected(isSelected);
if (isItemVisible(child)) {
child.setStatus(true);
if (child.getType() == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears || child.getType() == RoomSettingBean.QXRoomSettingTypeRoomTimeSpace) {
blindList.add(child);
}
children2.add(child);
} else {
child.setStatus(false);
}
child.updateItemType();
}
}
bean.setChildren(children2);
if (bean.isStatus()) {
filteredList.add(bean);
}
}
// 更新 itemType
/* for (RoomSettingBean bean : dataList) {
2025-10-20 10:16:44 +08:00
bean.setRead(read);
bean.setSelected(isSelected);
// 根据角色和状态设置 isVisible
if (isItemVisible(bean)) {
bean.setStatus(true);
} else {
bean.setStatus(false);
}
bean.updateItemType();
if (bean.isStatus()) {
filteredList.add(bean);
}
// 动态设置 GridLayoutManager 的列数
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 6); // 默认每行 4 个 item
2025-10-20 10:16:44 +08:00
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
RoomSettingBean item = filteredList.get(position);
if (item.getItemType() == RoomSettingBean.ITEM_TYPE_DEFAULT) { // 标题项占满一行
return layoutManager.getSpanCount();
} else { // 内容项默认每行 4 个
return 1;
}
}
});
// 根据 itemType 动态调整列数
mBinding.recycleView.setLayoutManager(layoutManager);
}*/
adapter = new RoomSettingAdapter();
mBinding.recycleView.setAdapter(adapter);
adapter.setNewData(filteredList);
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
adapter.setOnItemClickListener(new RoomSettingAdapter.OnItemClickListener() {
@Override
2025-12-22 18:40:57 +08:00
public void onItemClick(RoomSettingBean bean, int position, int itemPos, HorizontalListAdapter itemAdapter) {
// 示例:切换选择状态
if (bean.getType() == QXRoomSettingTypeRoomOrderMic) {
MvpPre.changeRoom(roomId, SpUtil.getUserId() + "", position, bean);
2025-10-20 10:16:44 +08:00
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomClearMessage) {
RoomMessageEvent.T t = new RoomMessageEvent.T();
t.setText("清空消息");
RoomMessageEvent roomMessageEvent = new RoomMessageEvent(123, roomId, t);
EventBus.getDefault().post(roomMessageEvent);
String json = GsonUtils.toJson(roomMessageEvent);
// 转换为 byte[]
byte[] binaryData = json.getBytes(StandardCharsets.UTF_8);
// 创建自定义消息
MessageListenerSingleton.getInstance().sendCustomRoomMessage(
roomId,
binaryData
);
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).clearData();
}
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
// TunerDialogFragment.show(roomId, getChildFragmentManager());
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCompere) {//主持设置
RoomHostFragment.newInstance(roomId).show(getChildFragmentManager(), "RoomHostFragment");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomBgImage) {//背景图片
RoomBackgroundDialogFragment.newInstance(roomId).show(getChildFragmentManager(), "RoomBackgroundDialogFragment");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCloseEffects) {//关闭特效
if (effectOn) {
//关闭
effectOn = false;
//保存到本地
SpUtil.setOpenEffect(0);
EventBus.getDefault().post(new EffectEvent(false));
bean.setSelect(false);
} else {
//打开
effectOn = true;
SpUtil.setOpenEffect(1);
EventBus.getDefault().post(new EffectEvent(true));
bean.setSelect(true);
}
2025-12-22 18:40:57 +08:00
itemAdapter.notifyItemChanged(itemPos);
// adapter.notifyItemChanged(position);
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomBgMusic) {
EventBus.getDefault().post(new MusicEvent());
dismiss();
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomLeave) {
// EventBus.getDefault().post(new RoomOutEvent());
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSing) {
// MvpPre.changeRoomType(roomId, "1");
queren("1");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction) {
// MvpPre.changeRoomType(roomId, "2");
queren("2");
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy) {
//// MvpPre.changeRoomType(roomId, "3");
// queren("3");
// }
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl) {
//// MvpPre.changeRoomType(roomId, "4");
// queren("4");
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy) {
// MvpPre.changeRoomType(roomId, "7");
queren("9");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU) {
queren("7");
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG) { 2025年12月30日20:56:53根据需求隐藏用户自主切换练歌房
// queren("-1");
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT) {
queren("10");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypePUBROOM) {
queren("11");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
if (roomInfoResp != null) {
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
} else {
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomReport) {
if (roomId != null) {
Intent intent = new Intent(getActivity(), WebViewActivity.class);
intent.putExtra("url", String.format(WebUrlConstants.INSTANCE.getWEB_REPORT_URL(), SpUtil.getToken(), 2, roomId));
startActivity(intent);
} else {
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
ARouter.getInstance().build(ARouteConstants.ROOM_ALLOWANCE).withString("from", "我的界面").withString("roomId", roomInfoResp.getRoom_info().getRoom_id() + "").navigation();
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen) {//2025年9月22日14:10:25添加飘屏关闭打开按钮
if (floatingScreen) {
//关闭
floatingScreen = false;
//保存到本地
SpUtil.setFloatingScreen(0);
EventBus.getDefault().post(new FloatingScreenEvent(false));
bean.setSelect(false);
} else {
//打开
floatingScreen = true;
SpUtil.setFloatingScreen(1);
EventBus.getDefault().post(new FloatingScreenEvent(true));
bean.setSelect(true);
}
2025-12-22 18:40:57 +08:00
itemAdapter.notifyItemChanged(itemPos);
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed) {
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).redDialogView();
}
dismiss();
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears) {
try {
// // 直接显示对话框,移除有问题的 FragmentTransaction
// this.dismissAllowingStateLoss(); // 使用 dismissAllowingStateLoss 更安全
//
FragmentManager fm = getParentFragmentManager();
if (fm != null && !fm.isDestroyed()) {
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(
"11", roomId, "", "", "");
newDialog.show(fm, "GiftLotteryDialog");
dismiss();
}
} catch (Exception e) {
LogUtils.e("RoomGiftDialogFragment", "Error in showGiftLotteryDialog", e);
ToastUtils.show("操作失败,请重试");
}
} else if (bean.getType() == QXRoomSettingTypeRoomTimeSpace) {
try {
// // 直接显示对话框,移除有问题的 FragmentTransaction
// this.dismissAllowingStateLoss(); // 使用 dismissAllowingStateLoss 更安全
//
FragmentManager fm = getParentFragmentManager();
if (fm != null && !fm.isDestroyed()) {
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(
"12", roomId, "", "", "");
newDialog.show(fm, "GiftLotteryDialog");
dismiss();
}
} catch (Exception e) {
LogUtils.e("RoomGiftDialogFragment", "Error in showGiftLotteryDialog", e);
ToastUtils.show("操作失败,请重试");
}
} else if (bean.getType() == QXRoomSettingTypeRoomTimeRedSound) {//关闭红包声音
if (redSound) {
//关闭
redSound = false;
//保存到本地
SpUtil.setRedSound(0);
bean.setSelect(false);
} else {
//打开
redSound = true;
SpUtil.setRedSound(1);
bean.setSelect(true);
}
2025-12-22 18:40:57 +08:00
itemAdapter.notifyItemChanged(itemPos);
} else if (bean.getType() == QXRoomSettingTypeRoomBusinessTime) {//营业时间
DoubleTimePickerBottomSheet dialog = new DoubleTimePickerBottomSheet();
dialog.setOnTimeRangeSelectedListener((startDate, endDate) -> {
// 处理选择的时间范围
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
// 获取开始时间的Calendar实例
Calendar startCalendar = Calendar.getInstance();
startCalendar.setTime(startDate);
// 将秒设置为00
startCalendar.set(Calendar.SECOND, 0);
// 获取结束时间的Calendar实例
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(endDate);
// 将秒设置为59
endCalendar.set(Calendar.SECOND, 59);
// 格式化时间
String startTime = sdf.format(startCalendar.getTime());
String endTime = sdf.format(endCalendar.getTime());
Log.d("SelectedTime", "开始时间:" + startTime);
Log.d("SelectedTime", "结束时间:" + endTime);
MvpPre.setRoomBusinessTime(roomId, startTime, endTime);
// MvpPre.getCharmList(roomId, stime, etime, currentPage + "", type);
});
dialog.setShowDate(false);
dialog.setShowTime(true);
dialog.setShowSeconds(false);
dialog.show(getChildFragmentManager(), "DoubleTimePicker");
}
}
});
MvpPre.blindBoxStatus();
/* adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
2025-10-20 10:16:44 +08:00
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
RoomSettingBean bean = (RoomSettingBean) adapter.getItem(position);
// 示例:切换选择状态
if (bean.getType() == QXRoomSettingTypeRoomOrderMic) {
MvpPre.changeRoom(roomId, SpUtil.getUserId() + "", position, bean);
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomClearMessage) {
RoomMessageEvent.T t = new RoomMessageEvent.T();
t.setText("清空消息");
RoomMessageEvent roomMessageEvent = new RoomMessageEvent(123, roomId, t);
EventBus.getDefault().post(roomMessageEvent);
String json = GsonUtils.toJson(roomMessageEvent);
// 转换为 byte[]
byte[] binaryData = json.getBytes(StandardCharsets.UTF_8);
// 创建自定义消息
MessageListenerSingleton.getInstance().sendCustomRoomMessage(
roomId,
binaryData
);
2025-10-24 17:52:11 +08:00
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).clearData();
}
2025-11-05 11:08:00 +08:00
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
// TunerDialogFragment.show(roomId, getChildFragmentManager());
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCompere) {//主持设置
2025-10-20 10:16:44 +08:00
RoomHostFragment.newInstance(roomId).show(getChildFragmentManager(), "RoomHostFragment");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomBgImage) {//背景图片
RoomBackgroundDialogFragment.newInstance(roomId).show(getChildFragmentManager(), "RoomBackgroundDialogFragment");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCloseEffects) {//关闭特效
if (effectOn) {
//关闭
effectOn = false;
//保存到本地
SpUtil.setOpenEffect(0);
EventBus.getDefault().post(new EffectEvent(false));
bean.setSelect(false);
} else {
//打开
effectOn = true;
SpUtil.setOpenEffect(1);
EventBus.getDefault().post(new EffectEvent(true));
bean.setSelect(true);
}
upAdapter();
// adapter.notifyItemChanged(position);
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomBgMusic) {
EventBus.getDefault().post(new MusicEvent());
dismiss();
2025-10-24 17:52:11 +08:00
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomLeave) {
// EventBus.getDefault().post(new RoomOutEvent());
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSing) {
// MvpPre.changeRoomType(roomId, "1");
queren("1");
2025-10-20 10:16:44 +08:00
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction) {
2025-10-24 17:52:11 +08:00
// MvpPre.changeRoomType(roomId, "2");
queren("2");
2025-10-20 10:16:44 +08:00
}
2025-10-24 17:52:11 +08:00
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy) {
//// MvpPre.changeRoomType(roomId, "3");
// queren("3");
// }
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl) {
//// MvpPre.changeRoomType(roomId, "4");
// queren("4");
// }
2025-10-20 10:16:44 +08:00
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy) {
2025-10-24 17:52:11 +08:00
// MvpPre.changeRoomType(roomId, "7");
2025-11-18 19:39:16 +08:00
queren("9");
2025-10-24 17:52:11 +08:00
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU) {
2025-11-18 19:39:16 +08:00
queren("7");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG) {
2025-11-05 11:08:00 +08:00
queren("-1");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT) {
queren("10");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
2025-10-24 17:52:11 +08:00
if (roomInfoResp != null) {
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
} else {
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomReport) {
if (roomId != null) {
Intent intent = new Intent(getActivity(), WebViewActivity.class);
intent.putExtra("url", String.format(WebUrlConstants.INSTANCE.getWEB_REPORT_URL(), SpUtil.getToken(), 2, roomId));
2025-10-24 17:52:11 +08:00
startActivity(intent);
} else {
2025-10-24 17:52:11 +08:00
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
ARouter.getInstance().build(ARouteConstants.ROOM_ALLOWANCE).withString("from", "我的界面").withString("roomId", roomInfoResp.getRoom_info().getRoom_id() + "").navigation();
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen) {//2025年9月22日14:10:25添加飘屏关闭打开按钮
if (floatingScreen) {
//关闭
floatingScreen = false;
//保存到本地
SpUtil.setFloatingScreen(0);
EventBus.getDefault().post(new FloatingScreenEvent(false));
bean.setSelect(false);
} else {
//打开
floatingScreen = true;
SpUtil.setFloatingScreen(1);
EventBus.getDefault().post(new FloatingScreenEvent(true));
bean.setSelect(true);
}
upAdapter();
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed) {
2025-10-24 17:52:11 +08:00
if (getActivity() instanceof RoomActivity) {
((RoomActivity) getActivity()).redDialogView();
}
dismiss();
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears) {
try {
// // 直接显示对话框,移除有问题的 FragmentTransaction
// this.dismissAllowingStateLoss(); // 使用 dismissAllowingStateLoss 更安全
//
FragmentManager fm = getParentFragmentManager();
if (fm != null && !fm.isDestroyed()) {
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(
"11", roomId, "", "", "");
newDialog.show(fm, "GiftLotteryDialog");
}
} catch (Exception e) {
LogUtils.e("RoomGiftDialogFragment", "Error in showGiftLotteryDialog", e);
ToastUtils.show("操作失败,请重试");
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTimeSpace) {
try {
// // 直接显示对话框,移除有问题的 FragmentTransaction
// this.dismissAllowingStateLoss(); // 使用 dismissAllowingStateLoss 更安全
//
FragmentManager fm = getParentFragmentManager();
if (fm != null && !fm.isDestroyed()) {
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(
"12", roomId, "", "", "");
newDialog.show(fm, "GiftLotteryDialog");
}
} catch (Exception e) {
LogUtils.e("RoomGiftDialogFragment", "Error in showGiftLotteryDialog", e);
ToastUtils.show("操作失败,请重试");
}
2025-10-20 10:16:44 +08:00
}
}
});*/
2025-10-20 10:16:44 +08:00
}
2025-10-24 17:52:11 +08:00
// TODO: 2025/8/29 房间切换提示框
private void queren(String type) {
// 创建并显示确认对话框
new ConfirmDialog(getActivity(),
"提示",
"即将修改房间类型为" +
(type.equals("1") ? "交友" :
(type.equals("2") ? "拍卖" :
(type.equals("3") ? "男神" :
(type.equals("4") ? "女神" :
(type.equals("7") ? "互娱" :
(type.equals("9") ? "点唱" :
(type.equals("-1") ? "练歌房" :
(type.equals("10") ? "签约房" :
(type.equals("11") ? "酒吧房" : "")
)
)
)
)
)
)
)
),
2025-10-24 17:52:11 +08:00
"确认",
"取消",
v -> {
2025-11-05 11:08:00 +08:00
if (type.equals("-1")) {
MvpPre.agreeSong(roomId, "1");
2025-11-05 11:08:00 +08:00
} else
// 点击“确认”按钮时执行删除操作
MvpPre.changeRoomType(roomId, type);
2025-10-24 17:52:11 +08:00
},
v -> {
// 点击“取消”按钮时什么都不做
}, false, 0).show();
}
2025-10-20 10:16:44 +08:00
private void upAdapter() {
adapter.notifyDataSetChanged();
}
private boolean isItemVisible(RoomSettingBean bean) {
int type = bean.getType();
int roleLevel = bean.getRead(); // 角色等级
boolean onMic = false; // 是否是特定房间
2025-10-24 17:52:11 +08:00
if ((roomInfoResp.getRoom_info().getType_id().equals("1") || roomInfoResp.getRoom_info().getType_id().equals("3")
2025-11-18 19:39:16 +08:00
|| roomInfoResp.getRoom_info().getType_id().equals("4") || roomInfoResp.getRoom_info().getType_id().equals("9")) && roomInfoResp.getRoom_info().getLabel_id().equals("2")) {
2025-10-24 17:52:11 +08:00
onMic = true;
2025-10-20 10:16:44 +08:00
}
2025-10-24 17:52:11 +08:00
// 2025年9月22日14:18:50因为声网sdk不对和点唱有关系的所有需要关闭
2025-10-20 10:16:44 +08:00
// 房主显示全部
if (roleLevel == 1) {
if (onMic) {
2025-11-06 11:53:23 +08:00
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
2025-10-24 17:52:11 +08:00
return false;
}
} else {
2025-11-06 11:53:23 +08:00
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
2025-10-20 10:16:44 +08:00
return false;
}
}
return true;
2025-10-24 17:52:11 +08:00
} else if (roleLevel == 2 || roleLevel == 3) { // type == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy || type == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl || 2025年9月19日11:21:04将男神女神合并成互娱最总是新添加一个标签
if (type == RoomSettingBean.QXRoomSettingTypeRoomTypeSing || type == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy || type == RoomSettingBean.QXRoomSettingTypeRoomSetting ||
type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG || type == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypePUBROOM || type == QXRoomSettingTypeRoomBusinessTime ||
2025-10-24 17:52:11 +08:00
type == RoomSettingBean.QXRoomSettingTypeRoomClearMessage || type == QXRoomSettingTypeRoomOrderMic || type == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen
|| type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomBgImage || type == -1) {
2025-11-06 11:53:23 +08:00
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress || type == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
return false;
2025-10-20 10:16:44 +08:00
}
2025-11-06 11:53:23 +08:00
// if (onMic) {
// if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
// || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress /*|| type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG*/) {
// return false;
// }
// } else {
// if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
// || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress /*|| type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG*/) {
// return false;
// }
// }
2025-10-20 10:16:44 +08:00
return true;
}
if (type >= RoomSettingBean.QXRoomSettingTypeRoomLeave &&
type <= RoomSettingBean.QXRoomSettingTypeRoomReport || type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed || type == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears ||
type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound) {
2025-10-20 10:16:44 +08:00
return true;
2025-10-24 17:52:11 +08:00
} else {
2025-11-06 11:53:23 +08:00
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
2025-10-24 17:52:11 +08:00
return false;
}
2025-11-06 11:53:23 +08:00
// if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy
// || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress /*|| type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG*/) {
// return false;
// }
2025-10-20 10:16:44 +08:00
}
return false;
} else { // 普通用户只显示更多操作中的特定条目
2025-10-20 10:16:44 +08:00
return type == RoomSettingBean.QXRoomSettingTypeRoomLeave ||
type == RoomSettingBean.QXRoomSettingTypeRoomShare ||
type == RoomSettingBean.QXRoomSettingTypeRoomCloseEffects ||
2025-10-24 17:52:11 +08:00
type == RoomSettingBean.QXRoomSettingTypeRoomReport ||
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed ||
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen
|| type == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears || type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound;
2025-10-20 10:16:44 +08:00
}
}
@Override
protected void initView() {
mBinding.cl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PublishCommentDialogFragment.show(roomId, getChildFragmentManager());
}
});
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onRoomSettingEvent(RoomSettingEvent event) {
if (event.getType() == 1014) {
for (int i = 0; i < dataList.size(); i++) {
RoomSettingBean bean = (RoomSettingBean) adapter.getItem(i);
if (bean.getType() == QXRoomSettingTypeRoomOrderMic) {
if (event.getRoom_up_pit_type() == 2) {
bean.setStatus(true);
adapter.notifyItemChanged(i);
} else {
bean.setStatus(false);
adapter.notifyItemChanged(i);
}
2025-11-18 18:28:16 +08:00
return;
2025-10-20 10:16:44 +08:00
}
}
}
}
@Override
protected int getLayoutId() {
return R.layout.dialog_room_setting_fragment;
}
@Override
public void changeRoomSuccess(String s, int position, RoomSettingBean bean) {
2025-10-24 17:52:11 +08:00
if (bean.isSelect()) {
2025-10-20 10:16:44 +08:00
bean.setSelect(false);
adapter.notifyItemChanged(position);
2025-10-24 17:52:11 +08:00
} else {
2025-10-20 10:16:44 +08:00
bean.setSelect(true);
adapter.notifyItemChanged(position);
}
// if (bean.getName().contains("排麦")) {
// bean.setName("自由模式");
// bean.setSelect(false);
// adapter.notifyItemChanged(position);
// } else {
// bean.setName("排麦模式");
// bean.setSelect(true);
// adapter.notifyItemChanged(position);
// }
}
@Override
public void changeRoomType(String s) {
ToastUtils.show(s);
dismiss();
}
2025-11-06 11:53:23 +08:00
@Override
public void agreeSong(String s) {
ToastUtils.show(s);
dismiss();
}
@Override
public void blindBoxStatus(List<BlindBoxStatus> blindBoxStatus) {
for (int i = 0; i < blindBoxStatus.size(); i++) {
int giftBagId = blindBoxStatus.get(i).getGift_bag_id();
int status = blindBoxStatus.get(i).getStatus();
for (int j = 0; j < filteredList.size(); j++) {
for (int k = 0; k < filteredList.get(j).getChildren().size(); k++) {
if ((giftBagId == 11 && filteredList.get(j).getChildren().get(k).getType() == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears) ||
(giftBagId == 12 && filteredList.get(j).getChildren().get(k).getType() == RoomSettingBean.QXRoomSettingTypeRoomTimeSpace)) {
if (status != 1) {
filteredList.get(j).getChildren().remove(k);
}
}
}
}
}
adapter.notifyDataSetChanged();
}
2025-10-20 10:16:44 +08:00
}