1、修改包的图片
2、修改房间的所有进出方式
This commit is contained in:
@@ -373,7 +373,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
startType = 1;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "1",heart_id);
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
// com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
return;
|
||||
}
|
||||
} else if (id == R.id.ll_ten) {
|
||||
@@ -384,7 +384,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "6",heart_id);
|
||||
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
// com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
}
|
||||
} else if (id == R.id.ll_hundred) {//抽奖100次
|
||||
if (!isDrawing) {
|
||||
@@ -393,7 +393,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
startType = 3;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "9",heart_id);
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
// com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
}
|
||||
} else if (id == R.id.tv_gz) {//规则
|
||||
Bundle bundle = new Bundle();
|
||||
@@ -882,6 +882,9 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
}
|
||||
}
|
||||
}
|
||||
if (MvpPre==null){
|
||||
MvpPre = new GiftLotteryPresenter(this, getActivity());
|
||||
}
|
||||
MvpPre.wallet();
|
||||
isDrawing = false;
|
||||
MvpPre.giftSend(blind_box_turntable_id);
|
||||
@@ -921,12 +924,23 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
? walletBean.getCoin()
|
||||
: "0"
|
||||
);
|
||||
if (type == 10) {
|
||||
mBinding.mirroeSky.tvIcon.setText(walletBean.getCoin());
|
||||
} else if (type == 11) {
|
||||
mBinding.cityTime.tvIcon.setText(walletBean.getCoin());
|
||||
} else if (type == 12) {
|
||||
mBinding.pinnacleTime.tvIcon.setText(walletBean.getCoin());
|
||||
if (isAdded() && getActivity() != null && !getActivity().isFinishing() &&
|
||||
getDialog() != null && getDialog().isShowing()) {
|
||||
if (type == 10) {
|
||||
mBinding.mirroeSky.tvIcon.setText(walletBean.getCoin());
|
||||
} else if (type == 11) {
|
||||
mBinding.cityTime.tvIcon.setText(walletBean.getCoin());
|
||||
} else if (type == 12) {
|
||||
mBinding.pinnacleTime.tvIcon.setText(walletBean.getCoin());
|
||||
}
|
||||
}else {
|
||||
// dialog 已关闭,不进行 UI 更新
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// walletBean 为空时也关闭 dialog
|
||||
if (getActivity() != null && !getActivity().isFinishing()) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
setBackground();
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
@@ -148,6 +149,9 @@ public class GiftLotteryPresenter extends BasePresenter<GiftLotteryContacts.View
|
||||
|
||||
@Override
|
||||
public void xlhChou(String room_id, String num) {
|
||||
if (api==null){
|
||||
api= RetrofitClient.getInstance();
|
||||
}
|
||||
api.xlhChou(room_id,num, new BaseObserver<List<XlhDrawBean>>() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,46 +1,41 @@
|
||||
package com.xscm.moduleutil.dialog.giftLottery;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.HorizontalScrollView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearSnapHelper;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.TimeUtils;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.bean.GiftBean;
|
||||
import com.xscm.moduleutil.bean.MqttXlhEnd;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.XLHBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
import com.xscm.moduleutil.databinding.FragmentTourClubDialogBinding;
|
||||
import com.xscm.moduleutil.dialog.WebViewDialog;
|
||||
import com.xscm.moduleutil.event.MqttBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.CenterScrollHelper;
|
||||
import com.xscm.moduleutil.widget.EqualSpaceItemDecoration;
|
||||
import com.xscm.moduleutil.widget.InfintLinearLayoutManager;
|
||||
import com.xscm.moduleutil.widget.pagerecyclerview.PagerGridSnapHelper;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -48,11 +43,11 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/15
|
||||
*@description: 玄镜之旅
|
||||
* @author qx
|
||||
* @data 2025/9/15
|
||||
* @description: 玄镜之旅
|
||||
*/
|
||||
public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPresenter, FragmentTourClubDialogBinding> implements GiftLotteryContacts.View {
|
||||
private String roomId;
|
||||
@@ -63,6 +58,7 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
private String num;
|
||||
private XlhRankingDialog xlhRankingDialog;
|
||||
private XlhRecordDialog xlhRecordDialog;
|
||||
private XlhObtainDialog xlhObtainDialog;
|
||||
|
||||
private GiftXlhChouAdapter giftXlhChouAdapter;
|
||||
private CenterScrollHelper scrollHelper;
|
||||
@@ -98,8 +94,8 @@ 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);
|
||||
if (!EventBus.getDefault().isRegistered(this))
|
||||
EventBus.getDefault().register(this);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@@ -198,7 +194,7 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
num = "1";
|
||||
MvpPre.xlhChou(roomId, num);
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
// com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
}
|
||||
|
||||
} else if (id == R.id.ll_ten) {
|
||||
@@ -208,17 +204,17 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
num = "10";
|
||||
MvpPre.xlhChou(roomId, num);
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
// com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
}
|
||||
|
||||
} else if (id == R.id.ll_hundred) {
|
||||
if (!isDrawing) {
|
||||
isDrawing = true;
|
||||
prepareForNewLottery();
|
||||
num = "100";
|
||||
num = "20";
|
||||
MvpPre.xlhChou(roomId, num);
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
// com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
}
|
||||
|
||||
} else if (id == R.id.tv_gz) {
|
||||
@@ -300,7 +296,7 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
private void upTitle(int boxPrice) {
|
||||
mBinding.tvOne.setText(boxPrice + "币一次");
|
||||
mBinding.tvTen.setText((boxPrice * 10) + "币十次");
|
||||
mBinding.tvHundred.setText((boxPrice * 100) + "币百次");
|
||||
mBinding.tvHundred.setText((boxPrice * 20) + "币二十次");
|
||||
}
|
||||
|
||||
// TODO: 2025/8/29 接收im推送过来的消息
|
||||
@@ -308,14 +304,19 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
public void onMusicPlay(RoomMessageEvent message) {
|
||||
if (message.getMsgType() == 1057) {
|
||||
// UpView(message.getText().getXlh_data());
|
||||
endTime = Long.parseLong(message.getText().getEnd_time());
|
||||
endTime = Long.parseLong(message.getText().getEnd_time() != null ? message.getText().getEnd_time() : "0");
|
||||
startCountdown();
|
||||
mBinding.tvGiftCount.setText(message.getText().getGift_num());
|
||||
mBinding.userName.setText(message.getText().getFromUserInfo().getNickname());
|
||||
mBinding.tvGiftCount.setText(message.getText().getGift_num() != null ? message.getText().getGift_num() : "0");
|
||||
mBinding.userName.setText(message.getText().getFromUserInfo().getNickname() != null ? message.getText().getFromUserInfo().getNickname() : "");
|
||||
ImageUtils.loadHeadCC(message.getText().getFromUserInfo().getAvatar(), mBinding.userPic);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageReceived(MqttXlhEnd event) {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动倒计时
|
||||
*/
|
||||
@@ -411,6 +412,23 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
if (giftXlhChouAdapter != null) {
|
||||
giftXlhChouAdapter = null;
|
||||
}
|
||||
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
if (xlhRecordDialog != null && xlhRecordDialog.isVisible()) {
|
||||
xlhRecordDialog.dismiss();
|
||||
}
|
||||
|
||||
// 如果当前dialog存在且正在显示,先关闭
|
||||
if (xlhRankingDialog != null && xlhRankingDialog.isVisible()) {
|
||||
xlhRankingDialog.dismiss();
|
||||
}
|
||||
|
||||
if (xlhObtainDialog != null && xlhObtainDialog.isShowing()) {
|
||||
xlhObtainDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -684,7 +702,6 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将指定的原始位置item居中显示
|
||||
*
|
||||
@@ -805,14 +822,19 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
* @param data 中奖数据
|
||||
*/
|
||||
private void showResultDialog(List<XlhDrawBean> data) {
|
||||
isDrawing=false;
|
||||
isDrawing = false;
|
||||
// 创建并显示对话框
|
||||
XlhObtainDialog dialog = new XlhObtainDialog(getActivity());
|
||||
dialog.setOnGiftItemClickListener(new XlhObtainDialog.OnGiftItemClickListener() {
|
||||
// 关闭之前可能存在的对话框
|
||||
// if (xlhObtainDialog != null && xlhObtainDialog.isShowing()) {
|
||||
// xlhObtainDialog.dismiss();
|
||||
// }
|
||||
// 创建并显示对话框
|
||||
xlhObtainDialog = new XlhObtainDialog(getActivity());
|
||||
xlhObtainDialog.setOnGiftItemClickListener(new XlhObtainDialog.OnGiftItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onPlayAgainClick() {
|
||||
isDrawing=true;
|
||||
isDrawing = true;
|
||||
// 处理再玩一次点击事件
|
||||
MvpPre.xlhChou(roomId, num);
|
||||
}
|
||||
@@ -820,12 +842,15 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
@Override
|
||||
public void onCloseClick() {
|
||||
// 处理关闭点击事件
|
||||
dialog.dismiss();
|
||||
if (xlhObtainDialog != null && xlhObtainDialog.isShowing()) {
|
||||
xlhObtainDialog.dismiss();
|
||||
}
|
||||
xlhObtainDialog = null;
|
||||
}
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
dialog.setGiftList(data);
|
||||
xlhObtainDialog.show();
|
||||
xlhObtainDialog.setGiftList(data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xscm.moduleutil.dialog.giftLottery;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.Gravity;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
@@ -53,6 +54,13 @@ public class XlhObtainDialog extends BaseDialog<DialogXlhObtainBinding> {
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
// 设置对话框在屏幕中央显示
|
||||
window.setGravity(Gravity.CENTER);
|
||||
// 去掉背景阴影
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
||||
|
||||
// 设置窗口背景为透明
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent);
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 375.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
// 设置点击事件
|
||||
mBinding.xlhClose.setOnClickListener(v -> {
|
||||
|
||||
Reference in New Issue
Block a user