1:添加炼仙传说功能

2:修改混淆,
This commit is contained in:
2026-01-28 18:43:36 +08:00
parent 513cc23d9c
commit 5b27d91278
78 changed files with 3080 additions and 232 deletions

View File

@@ -1,5 +1,6 @@
package com.xscm.modulemain.dialog;
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomBusinessLegend;
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomBusinessTime;
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomOrderMic;
import static com.xscm.moduleutil.bean.room.RoomSettingBean.QXRoomSettingTypeRoomTimeRedSound;
@@ -31,6 +32,7 @@ import com.xscm.modulemain.adapter.HorizontalListAdapter;
import com.xscm.modulemain.adapter.RoomSettingAdapter;
import com.xscm.modulemain.databinding.DialogRoomSettingFragmentBinding;
import com.xscm.modulemain.activity.WebViewActivity;
import com.xscm.modulemain.dialog.refining.BoxMainDialog2;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.base.WebUrlConstants;
import com.xscm.moduleutil.bean.BlindBoxStatus;
@@ -193,8 +195,6 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
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);
@@ -353,7 +353,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCompere) {//主持设置
RoomHostFragment.newInstance(roomId).show(getChildFragmentManager(), "RoomHostFragment");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomBgImage) {//背景图片
RoomBackgroundDialogFragment.newInstance(roomId,roomInfoResp.getRoom_info().getRoom_password()).show(getChildFragmentManager(), "RoomBackgroundDialogFragment");
RoomBackgroundDialogFragment.newInstance(roomId, roomInfoResp.getRoom_info().getRoom_password()).show(getChildFragmentManager(), "RoomBackgroundDialogFragment");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCloseEffects) {//关闭特效
if (effectOn) {
//关闭
@@ -528,6 +528,8 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
dialog.setTvEndTime(roomInfoResp.getRoom_info().getEnd_time());
dialog.setTvStartTime(roomInfoResp.getRoom_info().getStart_time());
dialog.show(getChildFragmentManager(), "DoubleTimePicker");
} else if (bean.getType() == QXRoomSettingTypeRoomBusinessLegend) {
new BoxMainDialog2((RoomActivity) getSelfActivity()).show(getChildFragmentManager(), "炼仙传说");
}
}
@@ -535,164 +537,6 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
MvpPre.blindBoxStatus();
/* adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@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
);
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);
}
upAdapter();
// 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) {
queren("-1");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT) {
queren("10");
} 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);
}
upAdapter();
} 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");
}
} 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("操作失败,请重试");
}
}
}
});*/
}
// TODO: 2025/8/29 房间切换提示框
@@ -792,7 +636,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
}
if (type >= RoomSettingBean.QXRoomSettingTypeRoomLeave &&
type <= RoomSettingBean.QXRoomSettingTypeRoomReport || type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed || type == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears ||
type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound) {
type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound || type == QXRoomSettingTypeRoomBusinessLegend) {
return true;
} else {
@@ -814,7 +658,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
type == RoomSettingBean.QXRoomSettingTypeRoomReport ||
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed ||
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen
|| type == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears || type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound;
|| type == RoomSettingBean.QXRoomSettingTypeRoomTheCityYears || type == QXRoomSettingTypeRoomTimeSpace || type == QXRoomSettingTypeRoomTimeRedSound || type == QXRoomSettingTypeRoomBusinessLegend;
}
@@ -890,24 +734,33 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
@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);
}else {
if (SpUtil.getShelf() == 1) {
filteredList.get(j).getChildren().remove(k);
}
}
if (blindBoxStatus != null && !blindBoxStatus.isEmpty()) {
RoomSettingBean moreParent = new RoomSettingBean("活动", null, null, null, -1, read, isSelected, true, false);
List<RoomSettingBean> moreChildren = new ArrayList<>();
for (int i = 0; i < blindBoxStatus.size(); i++) {
int giftBagId = blindBoxStatus.get(i).getGift_bag_id();
int status = blindBoxStatus.get(i).getStatus();
if (giftBagId == 11) {
if (status == 1) {
moreChildren.add(new RoomSettingBean("岁月之城", "the_city_years", null, null, RoomSettingBean.QXRoomSettingTypeRoomTheCityYears, read, isSelected, true, false));
}
} else if (giftBagId == 12) {
if (status == 1) {
moreChildren.add(new RoomSettingBean("时空之巅", "time_space", null, null, QXRoomSettingTypeRoomTimeSpace, read, isSelected, true, false));
}
}else if (giftBagId == 60) {
if (status == 1) {
moreChildren.add(new RoomSettingBean("炼仙传说", "legend", null, null, QXRoomSettingTypeRoomBusinessLegend, read, isSelected, true, redSound));
}
}
// else {
// if (status == 1) {
// moreChildren.add(new RoomSettingBean("炼仙传说", "legend", null, null, QXRoomSettingTypeRoomBusinessLegend, read, isSelected, true, redSound));
// }
// }
}
moreParent.setChildren(moreChildren);
filteredList.add(moreParent);
}
adapter.notifyDataSetChanged();
}