修改拍卖房结构,目前修改到拍卖者上麦下麦
@@ -43,12 +43,14 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
|||||||
private int type;//1:房间点击进入的;2:打赏进入的
|
private int type;//1:房间点击进入的;2:打赏进入的
|
||||||
private List<RoonGiftModel> giftList=new ArrayList<>();
|
private List<RoonGiftModel> giftList=new ArrayList<>();
|
||||||
private List<GiftPackBean> giftPackList=new ArrayList<>();
|
private List<GiftPackBean> giftPackList=new ArrayList<>();
|
||||||
|
private String roomId;
|
||||||
|
|
||||||
public static GiftTwoDetailsFragment newInstance(String id,int type) {
|
public static GiftTwoDetailsFragment newInstance(String id,int type,String roomId) {
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString("id", id);
|
args.putString("id", id);
|
||||||
args.putInt("type", type);
|
args.putInt("type", type);
|
||||||
|
args.putString("roomId", roomId);
|
||||||
GiftTwoDetailsFragment fragment = new GiftTwoDetailsFragment();
|
GiftTwoDetailsFragment fragment = new GiftTwoDetailsFragment();
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
return fragment;
|
return fragment;
|
||||||
@@ -59,6 +61,7 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
|||||||
super.initArgs(arguments);
|
super.initArgs(arguments);
|
||||||
id = arguments.getString("id");
|
id = arguments.getString("id");
|
||||||
type = arguments.getInt("type");
|
type = arguments.getInt("type");
|
||||||
|
roomId = arguments.getString("roomId");
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@@ -78,9 +81,9 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
|
|||||||
MvpPre.giftPack();
|
MvpPre.giftPack();
|
||||||
}else {
|
}else {
|
||||||
if (type==0) {
|
if (type==0) {
|
||||||
MvpPre.getGiftList("0", type);
|
MvpPre.getGiftList("0", type, roomId);
|
||||||
}else {
|
}else {
|
||||||
MvpPre.getGiftList(id, type);
|
MvpPre.getGiftList(id, type, roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,6 @@ public class GiftBean {
|
|||||||
private int number;
|
private int number;
|
||||||
private String createtime;
|
private String createtime;
|
||||||
private String nickname;
|
private String nickname;
|
||||||
private String count;
|
private int count;
|
||||||
private String user_id;
|
private String user_id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.xscm.moduleutil.bean;
|
package com.xscm.moduleutil.bean;
|
||||||
|
|
||||||
|
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||||
import com.xscm.moduleutil.bean.room.FriendInfo;
|
import com.xscm.moduleutil.bean.room.FriendInfo;
|
||||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||||
import com.xscm.moduleutil.bean.room.RoomAuction;
|
import com.xscm.moduleutil.bean.room.RoomAuction;
|
||||||
@@ -86,6 +87,8 @@ public class RoomMessageEvent {
|
|||||||
private long time_day;
|
private long time_day;
|
||||||
|
|
||||||
private int online_number;//在线人数
|
private int online_number;//在线人数
|
||||||
|
|
||||||
|
private BlindBoxBean.XlhData xlh_Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class BlindBoxBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isXlhDataObject() {
|
public boolean isXlhDataObject() {
|
||||||
return xlh_data instanceof JsonObject || xlh_data instanceof XlhData;
|
return xlh_data instanceof JsonObject || xlh_data instanceof Map || xlh_data instanceof XlhData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<XlhData> getXlhDataAsList() {
|
public List<XlhData> getXlhDataAsList() {
|
||||||
@@ -43,8 +43,78 @@ public class BlindBoxBean {
|
|||||||
|
|
||||||
public XlhData getXlhDataAsObject() {
|
public XlhData getXlhDataAsObject() {
|
||||||
if (isXlhDataObject()) {
|
if (isXlhDataObject()) {
|
||||||
|
// 如果已经是XlhData类型,直接返回
|
||||||
|
if (xlh_data instanceof XlhData) {
|
||||||
return (XlhData) xlh_data;
|
return (XlhData) xlh_data;
|
||||||
}
|
}
|
||||||
|
// 如果是Map类型(Gson解析后的LinkedTreeMap),手动转换
|
||||||
|
else if (xlh_data instanceof Map) {
|
||||||
|
Map<String, Object> map = (Map<String, Object>) xlh_data;
|
||||||
|
XlhData xlhData = new XlhData();
|
||||||
|
|
||||||
|
// 安全地转换各个字段
|
||||||
|
Object waitingStartNum = map.get("waiting_start_num");
|
||||||
|
if (waitingStartNum != null) {
|
||||||
|
xlhData.setWaiting_start_num(waitingStartNum.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
Object startNum = map.get("start_num");
|
||||||
|
if (startNum != null) {
|
||||||
|
xlhData.setStart_num(startNum.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
Object currentNum = map.get("current_num");
|
||||||
|
if (currentNum != null) {
|
||||||
|
if (currentNum instanceof Number) {
|
||||||
|
xlhData.setCurrent_num(((Number) currentNum).intValue());
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
xlhData.setCurrent_num(Integer.parseInt(currentNum.toString()));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
xlhData.setCurrent_num(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Object status = map.get("status");
|
||||||
|
if (status != null) {
|
||||||
|
if (status instanceof Number) {
|
||||||
|
xlhData.setStatus(((Number) status).intValue());
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
xlhData.setStatus(Integer.parseInt(status.toString()));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
xlhData.setStatus(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return xlhData;
|
||||||
|
}
|
||||||
|
// 如果是JsonObject,也需要转换
|
||||||
|
else if (xlh_data instanceof JsonObject) {
|
||||||
|
JsonObject jsonObject = (JsonObject) xlh_data;
|
||||||
|
XlhData xlhData = new XlhData();
|
||||||
|
|
||||||
|
if (jsonObject.has("waiting_start_num")) {
|
||||||
|
xlhData.setWaiting_start_num(jsonObject.get("waiting_start_num").getAsString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jsonObject.has("start_num")) {
|
||||||
|
xlhData.setStart_num(jsonObject.get("start_num").getAsString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jsonObject.has("current_num")) {
|
||||||
|
xlhData.setCurrent_num(jsonObject.get("current_num").getAsInt());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jsonObject.has("status")) {
|
||||||
|
xlhData.setStatus(jsonObject.get("status").getAsInt());
|
||||||
|
}
|
||||||
|
|
||||||
|
return xlhData;
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -96,6 +96,10 @@ public class EMMessageInfo implements MultiItemEntity {
|
|||||||
public static final int QXRoomMessageTypeHeartDidChanged = 1054;
|
public static final int QXRoomMessageTypeHeartDidChanged = 1054;
|
||||||
/// 小黑屋有人退出房间
|
/// 小黑屋有人退出房间
|
||||||
public static final int QXRoomMessageTypeHeartDid = 1055;
|
public static final int QXRoomMessageTypeHeartDid = 1055;
|
||||||
|
///盲盒抽奖进度条
|
||||||
|
public static final int QXRoomMessageTypeMangH = 1056;
|
||||||
|
///巡乐会
|
||||||
|
public static final int QXRoomMessageTypeXlh = 1057;
|
||||||
private RoomMessageEvent emMessage;
|
private RoomMessageEvent emMessage;
|
||||||
|
|
||||||
private int custom = 0;
|
private int custom = 0;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import com.xscm.moduleutil.R;
|
|||||||
import com.xscm.moduleutil.activity.IPresenter;
|
import com.xscm.moduleutil.activity.IPresenter;
|
||||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||||
import com.xscm.moduleutil.bean.GiftBean;
|
import com.xscm.moduleutil.bean.GiftBean;
|
||||||
|
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||||
import com.xscm.moduleutil.bean.WalletBean;
|
import com.xscm.moduleutil.bean.WalletBean;
|
||||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||||
@@ -37,6 +38,10 @@ import com.xscm.moduleutil.utils.ARouteConstants;
|
|||||||
import com.xscm.moduleutil.widget.CircularProgressView;
|
import com.xscm.moduleutil.widget.CircularProgressView;
|
||||||
import com.xscm.moduleutil.widget.GiftCardView;
|
import com.xscm.moduleutil.widget.GiftCardView;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -85,7 +90,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
private LotteryEvent userIdType; // 新增枚举类型字段
|
private LotteryEvent userIdType; // 新增枚举类型字段
|
||||||
private int type;//10:对应天空之境 11:对应岁月之城 12:对应时空之巅
|
private int type;//10:对应天空之境 11:对应岁月之城 12:对应时空之巅
|
||||||
private GiftLotteryDialogFragment giftLotteryDialogFragment;
|
private GiftLotteryDialogFragment giftLotteryDialogFragment;
|
||||||
private List<Integer> reslutListAll = new ArrayList<>();
|
private String blind_box_turntable_id = "";//本次抽奖标识id
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected GiftLotteryPresenter bindPresenter() {
|
protected GiftLotteryPresenter bindPresenter() {
|
||||||
@@ -108,9 +113,12 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
Dialog dialog = super.onCreateDialog(savedInstanceState);
|
Dialog dialog = super.onCreateDialog(savedInstanceState);
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
dialog.setCancelable(true);
|
dialog.setCancelable(true);
|
||||||
|
if (!EventBus.getDefault().isRegistered(this))
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(@NonNull Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
@@ -133,13 +141,14 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
protected void initView() {
|
protected void initView() {
|
||||||
// 根据不同的用户类型显示不同的界面
|
// 根据不同的用户类型显示不同的界面
|
||||||
setupUIBasedOnUserType();
|
setupUIBasedOnUserType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initDialogStyle(Window window) {
|
protected void initDialogStyle(Window window) {
|
||||||
super.initDialogStyle(window);
|
super.initDialogStyle(window);
|
||||||
window.setGravity(Gravity.BOTTOM);
|
window.setGravity(Gravity.BOTTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
@@ -150,7 +159,8 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
requireActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
requireActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||||
int screenHeight = displayMetrics.heightPixels;
|
int screenHeight = displayMetrics.heightPixels;
|
||||||
// 设置高度为屏幕高度的100%(全屏)
|
// 设置高度为屏幕高度的100%(全屏)
|
||||||
int heightInPx = (int) (screenHeight * 0.8);;
|
int heightInPx = (int) (screenHeight * 0.9);
|
||||||
|
;
|
||||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, heightInPx);
|
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, heightInPx);
|
||||||
window.setBackgroundDrawableResource(android.R.color.transparent);
|
window.setBackgroundDrawableResource(android.R.color.transparent);
|
||||||
|
|
||||||
@@ -158,6 +168,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
window.setWindowAnimations(R.style.CommonShowDialogBottom);
|
window.setWindowAnimations(R.style.CommonShowDialogBottom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupUIBasedOnUserType() {
|
private void setupUIBasedOnUserType() {
|
||||||
switch (userIdType) {
|
switch (userIdType) {
|
||||||
case MIRROR_SKY://天空之境
|
case MIRROR_SKY://天空之境
|
||||||
@@ -203,6 +214,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
mBinding.mirroeSky.tvGz.setOnClickListener(this::onClisk);
|
mBinding.mirroeSky.tvGz.setOnClickListener(this::onClisk);
|
||||||
mBinding.mirroeSky.tvJc.setOnClickListener(this::onClisk);
|
mBinding.mirroeSky.tvJc.setOnClickListener(this::onClisk);
|
||||||
mBinding.mirroeSky.tvJl.setOnClickListener(this::onClisk);
|
mBinding.mirroeSky.tvJl.setOnClickListener(this::onClisk);
|
||||||
|
mBinding.mirroeSky.tvStart.setOnClickListener(this::onClisk);
|
||||||
init(0);
|
init(0);
|
||||||
mBinding.mirroeSky.swLockYx.setChecked(true);
|
mBinding.mirroeSky.swLockYx.setChecked(true);
|
||||||
mBinding.mirroeSky.swTex.setChecked(true);
|
mBinding.mirroeSky.swTex.setChecked(true);
|
||||||
@@ -214,7 +226,6 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//岁月之城
|
//岁月之城
|
||||||
private void setupMultiUserUI() {
|
private void setupMultiUserUI() {
|
||||||
allViewsArray = new ArrayList<>();
|
allViewsArray = new ArrayList<>();
|
||||||
@@ -241,6 +252,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
mBinding.cityTime.tvGz.setOnClickListener(this::onClisk);
|
mBinding.cityTime.tvGz.setOnClickListener(this::onClisk);
|
||||||
mBinding.cityTime.tvJc.setOnClickListener(this::onClisk);
|
mBinding.cityTime.tvJc.setOnClickListener(this::onClisk);
|
||||||
mBinding.cityTime.tvJl.setOnClickListener(this::onClisk);
|
mBinding.cityTime.tvJl.setOnClickListener(this::onClisk);
|
||||||
|
mBinding.cityTime.tvStart.setOnClickListener(this::onClisk);
|
||||||
init2(0);
|
init2(0);
|
||||||
mBinding.cityTime.swLockYx.setChecked(true);
|
mBinding.cityTime.swLockYx.setChecked(true);
|
||||||
mBinding.cityTime.swTex.setChecked(true);
|
mBinding.cityTime.swTex.setChecked(true);
|
||||||
@@ -277,6 +289,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
mBinding.pinnacleTime.tvGz.setOnClickListener(this::onClisk);
|
mBinding.pinnacleTime.tvGz.setOnClickListener(this::onClisk);
|
||||||
mBinding.pinnacleTime.tvJc.setOnClickListener(this::onClisk);
|
mBinding.pinnacleTime.tvJc.setOnClickListener(this::onClisk);
|
||||||
mBinding.pinnacleTime.tvJl.setOnClickListener(this::onClisk);
|
mBinding.pinnacleTime.tvJl.setOnClickListener(this::onClisk);
|
||||||
|
mBinding.pinnacleTime.tvStart.setOnClickListener(this::onClisk);
|
||||||
init3(0);
|
init3(0);
|
||||||
mBinding.pinnacleTime.swLockYx.setChecked(true);
|
mBinding.pinnacleTime.swLockYx.setChecked(true);
|
||||||
mBinding.pinnacleTime.swTex.setChecked(true);
|
mBinding.pinnacleTime.swTex.setChecked(true);
|
||||||
@@ -286,6 +299,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
circularProgress = mBinding.pinnacleTime.circularProgressView;
|
circularProgress = mBinding.pinnacleTime.circularProgressView;
|
||||||
circularProgress.setProgress(0);
|
circularProgress.setProgress(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClisk(View view) {
|
private void onClisk(View view) {
|
||||||
int id = view.getId();
|
int id = view.getId();
|
||||||
if (id == R.id.ll_one) {
|
if (id == R.id.ll_one) {
|
||||||
@@ -379,6 +393,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
mBinding.cityTime.llHundred.setBackground(getResources().getDrawable(R.mipmap.chou_w));
|
mBinding.cityTime.llHundred.setBackground(getResources().getDrawable(R.mipmap.chou_w));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init3(int type) {
|
private void init3(int type) {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
mBinding.pinnacleTime.llOne.setBackground(getResources().getDrawable(R.mipmap.chou_x));
|
mBinding.pinnacleTime.llOne.setBackground(getResources().getDrawable(R.mipmap.chou_x));
|
||||||
@@ -479,9 +494,8 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
}
|
}
|
||||||
delayTime = 0.03;
|
delayTime = 0.03;
|
||||||
if (targetArrayIndex.isEmpty()) {
|
if (targetArrayIndex.isEmpty()) {
|
||||||
String result = TextUtils.join(",", reslutListAll);
|
|
||||||
|
|
||||||
MvpPre.giftSend(result);
|
MvpPre.giftSend(blind_box_turntable_id);
|
||||||
MvpPre.wallet();
|
MvpPre.wallet();
|
||||||
stopFastAnimate();
|
stopFastAnimate();
|
||||||
return;
|
return;
|
||||||
@@ -581,19 +595,70 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
for (int i = size; i < allViewsArray.size(); i++) {
|
for (int i = size; i < allViewsArray.size(); i++) {
|
||||||
allViewsArray.get(i).setVisibility(View.GONE);
|
allViewsArray.get(i).setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (blindBoxBean.getIs_xlh() == 1) {
|
||||||
|
|
||||||
BlindBoxBean.XlhData xlhData = blindBoxBean.getXlhDataAsObject();
|
BlindBoxBean.XlhData xlhData = blindBoxBean.getXlhDataAsObject();
|
||||||
|
UpView(xlhData);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (type == 10) {
|
||||||
|
mBinding.mirroeSky.llProgress.setVisibility(View.INVISIBLE);
|
||||||
|
mBinding.mirroeSky.tvStart.setVisibility(View.INVISIBLE);
|
||||||
|
} else if (type == 11) {
|
||||||
|
mBinding.cityTime.llProgress.setVisibility(View.INVISIBLE);
|
||||||
|
mBinding.cityTime.tvStart.setVisibility(View.INVISIBLE);
|
||||||
|
} else if (type == 12) {
|
||||||
|
mBinding.pinnacleTime.llProgress.setVisibility(View.INVISIBLE);
|
||||||
|
mBinding.pinnacleTime.tvStart.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpView(BlindBoxBean.XlhData xlhData) {
|
||||||
if (xlhData != null) {
|
if (xlhData != null) {
|
||||||
|
|
||||||
if (giftBagId.equals("10")) {
|
int currentNum = xlhData.getCurrent_num();
|
||||||
circularProgress.setProgress(xlhData.getCurrent_num());
|
int startNum = Integer.parseInt(xlhData.getStart_num());
|
||||||
mBinding.mirroeSky.tvProgress.setText(xlhData.getCurrent_num() + "%");
|
int waitingStartNum = Integer.parseInt(xlhData.getWaiting_start_num());
|
||||||
}else if (giftBagId.equals("11")){
|
|
||||||
circularProgress.setProgress(xlhData.getCurrent_num());
|
int progress = 0;
|
||||||
mBinding.cityTime.tvProgress.setText(xlhData.getCurrent_num() + "%");
|
String progressText = "";
|
||||||
}else if (giftBagId.equals("12")){
|
|
||||||
circularProgress.setProgress(xlhData.getCurrent_num());
|
if (currentNum >= startNum) {
|
||||||
mBinding.pinnacleTime.tvProgress.setText(xlhData.getCurrent_num() + "%");
|
// 已经达到开启条件,显示完整进度或特殊状态
|
||||||
|
progress = 100;
|
||||||
|
progressText = "100%";
|
||||||
|
} else {
|
||||||
|
// 还未达到等待开始条件,计算相对于waiting_start_num的进度
|
||||||
|
progress = (int) (((float) currentNum / startNum) * 100);
|
||||||
|
progressText = progress + "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (giftBagId.equals("10")) {
|
||||||
|
circularProgress.setProgress(progress * 10);
|
||||||
|
mBinding.mirroeSky.tvProgress.setText(progressText);
|
||||||
|
} else if (giftBagId.equals("11")) {
|
||||||
|
circularProgress.setProgress(progress * 10);
|
||||||
|
mBinding.cityTime.tvProgress.setText(progressText);
|
||||||
|
} else if (giftBagId.equals("12")) {
|
||||||
|
circularProgress.setProgress(progress * 10);
|
||||||
|
mBinding.pinnacleTime.tvProgress.setText(progressText);
|
||||||
|
}
|
||||||
|
if (xlhData.getStatus() == 0) {
|
||||||
|
mBinding.mirroeSky.tvStart.setBackgroundResource(R.mipmap.dengt);
|
||||||
|
mBinding.cityTime.tvStart.setBackgroundResource(R.mipmap.dengt);
|
||||||
|
mBinding.pinnacleTime.tvStart.setBackgroundResource(R.mipmap.dengt);
|
||||||
|
} else if (xlhData.getStatus() == 1) {
|
||||||
|
mBinding.mirroeSky.tvStart.setBackgroundResource(R.mipmap.zhensgh);
|
||||||
|
mBinding.cityTime.tvStart.setBackgroundResource(R.mipmap.zhensgh);
|
||||||
|
mBinding.pinnacleTime.tvStart.setBackgroundResource(R.mipmap.zhensgh);
|
||||||
|
} else if (xlhData.getStatus() == 2) {
|
||||||
|
mBinding.mirroeSky.tvStart.setBackgroundResource(R.mipmap.jijang);
|
||||||
|
mBinding.cityTime.tvStart.setBackgroundResource(R.mipmap.zhensgh);
|
||||||
|
mBinding.pinnacleTime.tvStart.setBackgroundResource(R.mipmap.zhensgh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -606,10 +671,12 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
// 清空之前的数据
|
// 清空之前的数据
|
||||||
targetArrayIndex.clear();
|
targetArrayIndex.clear();
|
||||||
finishTargetArrayIndex.clear();
|
finishTargetArrayIndex.clear();
|
||||||
|
if (blindReslutBean.getBlind_box_turntable_id() != null) {
|
||||||
|
blind_box_turntable_id = blindReslutBean.getBlind_box_turntable_id();
|
||||||
|
}
|
||||||
for (int i = 0; i < blindReslutBean.getReslut_list().size(); i++) {
|
for (int i = 0; i < blindReslutBean.getReslut_list().size(); i++) {
|
||||||
BlindReslutBean.ReslutList reslutList = blindReslutBean.getReslut_list().get(i);
|
BlindReslutBean.ReslutList reslutList = blindReslutBean.getReslut_list().get(i);
|
||||||
reslutListAll.add(reslutList.getGift_id());
|
|
||||||
|
|
||||||
for (int j = 0; j < giftLists.size(); j++) {
|
for (int j = 0; j < giftLists.size(); j++) {
|
||||||
if (giftLists.get(j).getGift_id().equals(reslutList.getGift_id() + "")) {
|
if (giftLists.get(j).getGift_id().equals(reslutList.getGift_id() + "")) {
|
||||||
@@ -617,7 +684,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
if (j < giftMaxCount) {
|
if (j < giftMaxCount) {
|
||||||
GiftCardView giftCardView = allViewsArray.get(j);
|
GiftCardView giftCardView = allViewsArray.get(j);
|
||||||
GiftBean giftBean = giftLists.get(j);
|
GiftBean giftBean = giftLists.get(j);
|
||||||
giftBean.setNumber(reslutList.getCount());
|
giftBean.setCount(reslutList.getCount());
|
||||||
|
|
||||||
if (!isOpenSpecial) {
|
if (!isOpenSpecial) {
|
||||||
giftCardView.setVisibilitymResultTextView(true);
|
giftCardView.setVisibilitymResultTextView(true);
|
||||||
@@ -625,9 +692,10 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
playSound("draw.mp3");
|
playSound("draw.mp3");
|
||||||
// 不要设置isDrawing=true,这会影响动画控制
|
// 不要设置isDrawing=true,这会影响动画控制
|
||||||
MvpPre.wallet();
|
MvpPre.wallet();
|
||||||
String result = TextUtils.join(",", reslutListAll);
|
|
||||||
MvpPre.giftSend(result);
|
MvpPre.giftSend(blind_box_turntable_id);
|
||||||
}
|
}
|
||||||
|
giftCardView.bindGiftData(giftBean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -667,6 +735,14 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: 2025/8/29 接收im推送过来的消息
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onMusicPlay(RoomMessageEvent message) {
|
||||||
|
if (message.getMsgType() == 1056){
|
||||||
|
UpView(message.getText().getXlh_Data());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
@@ -723,6 +799,9 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
|||||||
player.release();
|
player.release();
|
||||||
player = null;
|
player = null;
|
||||||
}
|
}
|
||||||
|
if (!EventBus.getDefault().isRegistered( this)){
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
}
|
||||||
// 建议进行垃圾回收
|
// 建议进行垃圾回收
|
||||||
System.gc();
|
System.gc();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ public interface ApiServer {
|
|||||||
|
|
||||||
@GET(Constants.GIFT_LIST)
|
@GET(Constants.GIFT_LIST)
|
||||||
//获取礼物列表
|
//获取礼物列表
|
||||||
Observable<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label);
|
Observable<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label,@Query("room_id")String room_id);
|
||||||
|
|
||||||
@GET(Constants.TOPIC_LIST)
|
@GET(Constants.TOPIC_LIST)
|
||||||
//获取话题
|
//获取话题
|
||||||
|
|||||||
@@ -917,8 +917,8 @@ public class RetrofitClient {
|
|||||||
sApiServer.getGiftLabel(have_hot).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.getGiftLabel(have_hot).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getGiftList(int type, BaseObserver<List<RoonGiftModel>> observer) {
|
public void getGiftList(int type,String roomId, BaseObserver<List<RoonGiftModel>> observer) {
|
||||||
sApiServer.getGiftList(type).compose(new DefaultTransformer<>()).subscribe(observer);
|
sApiServer.getGiftList(type,roomId).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class RewardGiftContacts {
|
|||||||
|
|
||||||
void getGiftLabel(String have_hot);
|
void getGiftLabel(String have_hot);
|
||||||
|
|
||||||
void getGiftList(String id, int type);
|
void getGiftList(String id, int type,String roomId);
|
||||||
|
|
||||||
void giveGift(String user_id, String gid, String num, String to_uid, String gift_type);
|
void giveGift(String user_id, String gid, String num, String to_uid, String gift_type);
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getGiftList(String id, int type) {
|
public void getGiftList(String id, int type,String roomId) {
|
||||||
api.getGiftList(Integer.parseInt(id), new BaseObserver<List<RoonGiftModel>>() {
|
api.getGiftList(Integer.parseInt(id),roomId, new BaseObserver<List<RoonGiftModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ public class MyMqttService extends Service implements MyEmqttConnectListener, My
|
|||||||
private static MyEmqttSubscribeListener mMyEmqttSubscribeListener;
|
private static MyEmqttSubscribeListener mMyEmqttSubscribeListener;
|
||||||
|
|
||||||
private static final String TOPIC_BOSS = "qx_room_topic";
|
private static final String TOPIC_BOSS = "qx_room_topic";
|
||||||
|
|
||||||
|
private static final String TOPIC_XLH = "qx_xunlehui";
|
||||||
private static final int NOTIFICATION_ID = 1;
|
private static final int NOTIFICATION_ID = 1;
|
||||||
|
|
||||||
|
|
||||||
@@ -228,7 +230,8 @@ public class MyMqttService extends Service implements MyEmqttConnectListener, My
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure(IMqttToken asyncActionToken,
|
public void onFailure(IMqttToken asyncActionToken,
|
||||||
Throwable exception) {
|
Throwable exception) {
|
||||||
if (!TOPIC_BOSS.equals(topic) && mMyEmqttSubscribeListener != null) {
|
if ((!TOPIC_BOSS.equals(topic) && mMyEmqttSubscribeListener != null)
|
||||||
|
|| (!TOPIC_XLH.equals(topic) && mMyEmqttSubscribeListener != null)) {
|
||||||
mMyEmqttSubscribeListener.onSubscribeFailure();
|
mMyEmqttSubscribeListener.onSubscribeFailure();
|
||||||
}
|
}
|
||||||
Logger.e(TAG, "订阅失败:" + topic + ", error: " + exception.getMessage());
|
Logger.e(TAG, "订阅失败:" + topic + ", error: " + exception.getMessage());
|
||||||
@@ -381,6 +384,7 @@ public class MyMqttService extends Service implements MyEmqttConnectListener, My
|
|||||||
}
|
}
|
||||||
Logger.e(TAG, "链接状态:", "链接成功");
|
Logger.e(TAG, "链接状态:", "链接成功");
|
||||||
subscribe(TOPIC_BOSS);
|
subscribe(TOPIC_BOSS);
|
||||||
|
subscribe(TOPIC_XLH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -411,7 +415,7 @@ public class MyMqttService extends Service implements MyEmqttConnectListener, My
|
|||||||
try {
|
try {
|
||||||
String messageStr = message.toString();
|
String messageStr = message.toString();
|
||||||
Logger.e(TAG, "收到的消息", "主题:" + topic + " 收到的消息:" + messageStr);
|
Logger.e(TAG, "收到的消息", "主题:" + topic + " 收到的消息:" + messageStr);
|
||||||
|
if (topic.equals(TOPIC_BOSS)) {
|
||||||
// 处理消息
|
// 处理消息
|
||||||
receiveMessage(topic, messageStr);
|
receiveMessage(topic, messageStr);
|
||||||
|
|
||||||
@@ -422,6 +426,9 @@ public class MyMqttService extends Service implements MyEmqttConnectListener, My
|
|||||||
mMyEmqttMesgListener.messageArrived(topic, messageStr);
|
mMyEmqttMesgListener.messageArrived(topic, messageStr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else if (topic.equals(TOPIC_XLH)) {
|
||||||
|
receiveXlhMessage(messageStr);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "处理MQTT消息异常", e);
|
Log.e(TAG, "处理MQTT消息异常", e);
|
||||||
}
|
}
|
||||||
@@ -454,6 +461,25 @@ public class MyMqttService extends Service implements MyEmqttConnectListener, My
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private void receiveXlhMessage(String messageStr) {
|
||||||
|
try {
|
||||||
|
String newdata = messageStr;//TextLengthUtil.decode(data);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(newdata);
|
||||||
|
|
||||||
|
int type = jsonObject.getIntValue("type");
|
||||||
|
String message = jsonObject.getString("msg");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 将事件处理放到主线程执行
|
||||||
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
|
processMessageType(type, message);
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "解析MQTT消息异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void receiveMessage(String topic, String data) {
|
private void receiveMessage(String topic, String data) {
|
||||||
try {
|
try {
|
||||||
String newdata = data;//TextLengthUtil.decode(data);
|
String newdata = data;//TextLengthUtil.decode(data);
|
||||||
@@ -640,6 +666,7 @@ public class MyMqttService extends Service implements MyEmqttConnectListener, My
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanSubscribe(TOPIC_BOSS);
|
cleanSubscribe(TOPIC_BOSS);
|
||||||
|
cleanSubscribe(TOPIC_XLH);
|
||||||
if (mqttAndroidClient != null) {
|
if (mqttAndroidClient != null) {
|
||||||
mqttAndroidClient.disconnect(); //断开连接
|
mqttAndroidClient.disconnect(); //断开连接
|
||||||
mqttAndroidClient.unregisterResources();
|
mqttAndroidClient.unregisterResources();
|
||||||
@@ -680,16 +707,16 @@ public class MyMqttService extends Service implements MyEmqttConnectListener, My
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void messageArrived(String topic, String mesg) {
|
public void messageArrived(String topic, String mesg) {
|
||||||
|
LogUtils.e("lxj", "messageArrived:"+mesg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribeSuccess(String topic) {
|
public void onSubscribeSuccess(String topic) {
|
||||||
|
LogUtils.e("lxj", "onSubscribeSuccess:"+topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribeFailure() {
|
public void onSubscribeFailure() {
|
||||||
|
LogUtils.e("lxj", "onSubscribeFailure");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ public class AvatarFrameView extends FrameLayout implements IAnimListener {
|
|||||||
// 在主线程中播放动画
|
// 在主线程中播放动画
|
||||||
mainHandler.post(() -> {
|
mainHandler.post(() -> {
|
||||||
if (isTxk) {
|
if (isTxk) {
|
||||||
mBinding.playView.setLoop(20);
|
mBinding.playView.setLoop(1);
|
||||||
}
|
}
|
||||||
mBinding.playView.startPlay(downloadedFile);
|
mBinding.playView.startPlay(downloadedFile);
|
||||||
});
|
});
|
||||||
@@ -381,7 +381,7 @@ public class AvatarFrameView extends FrameLayout implements IAnimListener {
|
|||||||
LogUtils.e("有缓存");
|
LogUtils.e("有缓存");
|
||||||
// 直接播放缓存文件
|
// 直接播放缓存文件
|
||||||
if (isTxk) {
|
if (isTxk) {
|
||||||
mBinding.playView.setLoop(20);
|
mBinding.playView.setLoop(1);
|
||||||
}
|
}
|
||||||
mBinding.playView.startPlay(file);
|
mBinding.playView.startPlay(file);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class GiftCardView extends FrameLayout {
|
|||||||
|
|
||||||
// 设置礼物数量
|
// 设置礼物数量
|
||||||
setCount(giftBean.getGift_price() != null ? giftBean.getGift_price() : "0");
|
setCount(giftBean.getGift_price() != null ? giftBean.getGift_price() : "0");
|
||||||
setmResultTextView(giftBean.getNumber());
|
setmResultTextView(giftBean.getCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getGiftLabel(List<GiftLabelBean> giftLabelBeans) {
|
public void getGiftLabel(List<GiftLabelBean> giftLabelBeans) {
|
||||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), giftLabelBeans,fragmentList));
|
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), giftLabelBeans,fragmentList,""));
|
||||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||||
mBinding.slidingTabLayout.setCurrentTab(0);
|
mBinding.slidingTabLayout.setCurrentTab(0);
|
||||||
}
|
}
|
||||||
@@ -291,17 +291,19 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
|
|||||||
|
|
||||||
private List<GiftLabelBean> list;
|
private List<GiftLabelBean> list;
|
||||||
private List<Fragment> fragmentList ;
|
private List<Fragment> fragmentList ;
|
||||||
|
private String roomId;
|
||||||
|
|
||||||
public MyFragmentPagerAdapter(FragmentManager fm, List<GiftLabelBean> list,List<Fragment> fragmentList) {
|
public MyFragmentPagerAdapter(FragmentManager fm, List<GiftLabelBean> list,List<Fragment> fragmentList,String roomId) {
|
||||||
super(fm);
|
super(fm);
|
||||||
this.list = list;
|
this.list = list;
|
||||||
this.fragmentList = fragmentList;
|
this.fragmentList = fragmentList;
|
||||||
|
this.roomId = roomId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
GiftLabelBean model = list.get(position);
|
GiftLabelBean model = list.get(position);
|
||||||
Fragment fragment = GiftTwoDetailsFragment.newInstance(model.getId(), 2);
|
Fragment fragment = GiftTwoDetailsFragment.newInstance(model.getId(), 2, roomId);
|
||||||
fragmentList.add(fragment); // 保存 Fragment 实例
|
fragmentList.add(fragment); // 保存 Fragment 实例
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/skzd_left_bj.webp
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/skzd_rigth_bj.webp
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/skzd_w.webp
Normal file
|
After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/skzd_x.webp
Normal file
|
After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 122 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/skzj_z_b.webp
Normal file
|
After Width: | Height: | Size: 312 KiB |
|
Before Width: | Height: | Size: 80 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/skzl_jc.webp
Normal file
|
After Width: | Height: | Size: 241 KiB |
|
Before Width: | Height: | Size: 107 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/skzl_jl.webp
Normal file
|
After Width: | Height: | Size: 302 KiB |
|
Before Width: | Height: | Size: 80 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/syzc_jc.webp
Normal file
|
After Width: | Height: | Size: 233 KiB |
|
Before Width: | Height: | Size: 105 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/syzc_jl.webp
Normal file
|
After Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/syzc_left_bj.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/syzc_rigth_bj.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/syzc_w.webp
Normal file
|
After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/syzc_x.webp
Normal file
|
After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 124 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/syzc_z_b.webp
Normal file
|
After Width: | Height: | Size: 315 KiB |
@@ -2,6 +2,7 @@ package com.example.moduleroom.activity;
|
|||||||
|
|
||||||
import static android.app.PendingIntent.getActivity;
|
import static android.app.PendingIntent.getActivity;
|
||||||
import static android.view.View.GONE;
|
import static android.view.View.GONE;
|
||||||
|
import static android.view.View.INVISIBLE;
|
||||||
import static android.view.View.VISIBLE;
|
import static android.view.View.VISIBLE;
|
||||||
|
|
||||||
import static com.liulishuo.okdownload.OkDownloadProvider.context;
|
import static com.liulishuo.okdownload.OkDownloadProvider.context;
|
||||||
@@ -57,6 +58,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
|
|||||||
import com.example.moduleroom.R;
|
import com.example.moduleroom.R;
|
||||||
import com.example.moduleroom.contacts.RoomContacts;
|
import com.example.moduleroom.contacts.RoomContacts;
|
||||||
import com.example.moduleroom.databinding.ActivityRoomBinding;
|
import com.example.moduleroom.databinding.ActivityRoomBinding;
|
||||||
|
import com.example.moduleroom.dialog.CardRelationshipFragment;
|
||||||
import com.example.moduleroom.dialog.ExitRoomBottomSheet;
|
import com.example.moduleroom.dialog.ExitRoomBottomSheet;
|
||||||
import com.example.moduleroom.dialog.FriendsDialogFragment;
|
import com.example.moduleroom.dialog.FriendsDialogFragment;
|
||||||
import com.example.moduleroom.dialog.PublishCommentDialogFragment;
|
import com.example.moduleroom.dialog.PublishCommentDialogFragment;
|
||||||
@@ -83,6 +85,7 @@ import com.xscm.moduleutil.bean.UserInfo;
|
|||||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||||
import com.xscm.moduleutil.bean.room.FriendInfo;
|
import com.xscm.moduleutil.bean.room.FriendInfo;
|
||||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||||
|
import com.xscm.moduleutil.bean.room.RoomAuction;
|
||||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||||
import com.xscm.moduleutil.databinding.RoomDialogMusicWindowOpenBinding;
|
import com.xscm.moduleutil.databinding.RoomDialogMusicWindowOpenBinding;
|
||||||
@@ -190,6 +193,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
|||||||
private PublicScreenEaseChatFragment publicScreenFragment; // 添加成员变量
|
private PublicScreenEaseChatFragment publicScreenFragment; // 添加成员变量
|
||||||
// 添加成员变量
|
// 添加成员变量
|
||||||
private boolean isLayoutAdjusted = false;
|
private boolean isLayoutAdjusted = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
password = intent.getStringExtra("password");
|
password = intent.getStringExtra("password");
|
||||||
@@ -645,14 +649,26 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
|||||||
musicPlayBean.setPosition(text.getPosition());
|
musicPlayBean.setPosition(text.getPosition());
|
||||||
EventBus.getDefault().post(musicPlayBean);
|
EventBus.getDefault().post(musicPlayBean);
|
||||||
} else if (messageEvent.getMsgType() == 1003) {//上麦操作
|
} else if (messageEvent.getMsgType() == 1003) {//上麦操作
|
||||||
//
|
|
||||||
// RoomWheatEvent roomWheatEvent = new RoomWheatEvent();
|
|
||||||
// roomWheatEvent.setRoomId(roomId);
|
|
||||||
// roomWheatEvent.setOccupied(true);
|
|
||||||
// EventBus.getDefault().post(roomWheatEvent);
|
|
||||||
if (messageEvent.getText().getPit_number().equals("9") && messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
if (messageEvent.getText().getPit_number().equals("9") && messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
mBinding.roomTop.rl.setVisibility(View.VISIBLE);
|
mBinding.roomTop.rl.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
|
aBoolean = false;
|
||||||
|
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up);
|
||||||
|
setBoolean(aBoolean);
|
||||||
|
mRoomInfoResp.getUser_info().setPit_number(messageEvent.getText().getPit_number() != null ? Integer.parseInt(messageEvent.getText().getPit_number()) : 0);
|
||||||
|
setRoleType(3, Integer.parseInt(messageEvent.getText().getPit_number()));
|
||||||
|
switchMic(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mRoomInfoResp.getRoom_info().getType_id().equals("2")) {///拍卖房上麦操作
|
||||||
|
|
||||||
|
if (messageEvent.getText().getPit_number().equals("9")) {
|
||||||
|
mRoomInfoResp.getRoom_info().getPit_list().set(0, getPitBean(messageEvent));
|
||||||
|
mRoomInfoResp.getUser_info().setPit_number(Integer.parseInt(messageEvent.getText().getPit_number()));
|
||||||
|
|
||||||
|
}
|
||||||
|
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("7")) {
|
||||||
RoomPitBean pitBean = mRoomInfoResp.getRoom_info().getPit_list().get(Integer.parseInt(messageEvent.getText().getPit_number()) - 1);
|
RoomPitBean pitBean = mRoomInfoResp.getRoom_info().getPit_list().get(Integer.parseInt(messageEvent.getText().getPit_number()) - 1);
|
||||||
pitBean.setUser_id(messageEvent.getText().getFromUserInfo().getUser_id() + "");
|
pitBean.setUser_id(messageEvent.getText().getFromUserInfo().getUser_id() + "");
|
||||||
pitBean.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
|
pitBean.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
|
||||||
@@ -661,6 +677,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
|||||||
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
|
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
|
||||||
pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
|
pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
|
||||||
mRoomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(messageEvent.getText().getPit_number()) - 1, pitBean);
|
mRoomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(messageEvent.getText().getPit_number()) - 1, pitBean);
|
||||||
|
}
|
||||||
roomFragment.updateSeatViewExchangedWithPitArray(mRoomInfoResp);
|
roomFragment.updateSeatViewExchangedWithPitArray(mRoomInfoResp);
|
||||||
} else if (messageEvent.getMsgType() == 1004) {//下麦操作
|
} else if (messageEvent.getMsgType() == 1004) {//下麦操作
|
||||||
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId() && messageEvent.getText().getPit_number().equals("9")) {
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId() && messageEvent.getText().getPit_number().equals("9")) {
|
||||||
@@ -671,6 +688,21 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
|||||||
mBinding.roomTop.rl.setVisibility(GONE);
|
mBinding.roomTop.rl.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mRoomInfoResp.getRoom_info().getType_id().equals("2")) {
|
||||||
|
if (messageEvent.getText().getPit_number().equals("9")) {
|
||||||
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
|
mRoomInfoResp.getRoom_info().getPit_list().set(0, getPitBean2(messageEvent, "9"));
|
||||||
|
mRoomInfoResp.getUser_info().setPit_number(0);
|
||||||
|
}
|
||||||
|
} else if (messageEvent.getText().getPit_number().equals("888")) {
|
||||||
|
mRoomInfoResp.setRoom_auction(null);
|
||||||
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
|
setRoleType(0, 0);
|
||||||
|
switchMic(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
RoomPitBean pitBean = mRoomInfoResp.getRoom_info().getPit_list().get(Integer.parseInt(messageEvent.getText().getPit_number()) - 1);
|
RoomPitBean pitBean = mRoomInfoResp.getRoom_info().getPit_list().get(Integer.parseInt(messageEvent.getText().getPit_number()) - 1);
|
||||||
pitBean.setUser_id("");
|
pitBean.setUser_id("");
|
||||||
pitBean.setAvatar("");
|
pitBean.setAvatar("");
|
||||||
@@ -679,7 +711,52 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
|||||||
pitBean.setCharm("");
|
pitBean.setCharm("");
|
||||||
pitBean.setDress("");
|
pitBean.setDress("");
|
||||||
mRoomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(messageEvent.getText().getPit_number()) - 1, pitBean);
|
mRoomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(messageEvent.getText().getPit_number()) - 1, pitBean);
|
||||||
|
|
||||||
|
}
|
||||||
roomFragment.updateSeatViewExchangedWithPitArray(mRoomInfoResp);
|
roomFragment.updateSeatViewExchangedWithPitArray(mRoomInfoResp);
|
||||||
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
|
// mBinding.ivWheatFeeding.setImageResource(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
||||||
|
aBoolean = true;
|
||||||
|
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
||||||
|
setBoolean(aBoolean);
|
||||||
|
mRoomInfoResp.getUser_info().setPit_number(0);
|
||||||
|
setRoleType(0, 0);
|
||||||
|
switchMic(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else if (messageEvent.getMsgType() == 1022) {
|
||||||
|
if (messageEvent.getText().getType() == 1) {//拍卖位上麦
|
||||||
|
if (messageEvent.getText().getPit_number().equals("888")) {
|
||||||
|
mRoomInfoResp.getRoom_auction().setAuction_user(getPitBean3(messageEvent));
|
||||||
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
|
setRoleType(3, 888);
|
||||||
|
switchMic(2);
|
||||||
|
// parentFragment.setRoleType(3, 888);
|
||||||
|
// parentFragment.switchMic(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int type = -1; // 或其他默认值
|
||||||
|
if (mRoomInfoResp.getRoom_info().getType_id().equals("2")) {
|
||||||
|
type = (mRoomInfoResp.getRoom_info().getLabel_id().equals("1")) ? 1 : 2;
|
||||||
|
}
|
||||||
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
|
CardRelationshipFragment.show(mRoomInfoResp.getRoom_info().getRoom_id(), SpUtil.getUserId() + "", type+"", getSupportFragmentManager());
|
||||||
|
}
|
||||||
|
} else if (messageEvent.getText().getType() == 2) {//拍卖位下麦
|
||||||
|
if (messageEvent.getText().getPit_number().equals("9")) {
|
||||||
|
mRoomInfoResp.getRoom_info().getPit_list().set(0, getPitBean2(messageEvent, "9"));
|
||||||
|
mRoomInfoResp.getUser_info().setPit_number(0);
|
||||||
|
setRoleType(0, 0);
|
||||||
|
switchMic(2);
|
||||||
|
} else if (messageEvent.getText().getPit_number().equals("888")) {
|
||||||
|
mRoomInfoResp.setRoom_auction(new RoomAuction());
|
||||||
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
|
setRoleType(0, 0);
|
||||||
|
switchMic(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (messageEvent.getMsgType() == 1020) {
|
} else if (messageEvent.getMsgType() == 1020) {
|
||||||
mRoomBean = messageEvent.getText().getRoomInfo();
|
mRoomBean = messageEvent.getText().getRoomInfo();
|
||||||
EventBus.getDefault().post(mRoomBean);
|
EventBus.getDefault().post(mRoomBean);
|
||||||
@@ -801,6 +878,44 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: 2025/6/30 上麦,麦位变化
|
||||||
|
private RoomPitBean getPitBean(RoomMessageEvent messageEvent) {
|
||||||
|
RoomPitBean pitBean = new RoomPitBean();
|
||||||
|
pitBean.setPit_number(messageEvent.getText().getPit_number());
|
||||||
|
pitBean.setUser_id(messageEvent.getText().getFromUserInfo().getUser_id() + "");
|
||||||
|
pitBean.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
|
||||||
|
pitBean.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
|
||||||
|
pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
|
||||||
|
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
|
||||||
|
|
||||||
|
return pitBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: 2025/6/30 下麦麦位变化
|
||||||
|
private RoomPitBean getPitBean2(RoomMessageEvent messageEvent, String number) {
|
||||||
|
RoomPitBean pitBean = new RoomPitBean();
|
||||||
|
pitBean.setPit_number(messageEvent != null ? messageEvent.getText().getPit_number() : number);
|
||||||
|
pitBean.setUser_id("");
|
||||||
|
pitBean.setAvatar("");
|
||||||
|
pitBean.setNickname("");
|
||||||
|
pitBean.setSex("");
|
||||||
|
pitBean.setCharm("");
|
||||||
|
pitBean.setIs_pm(1);
|
||||||
|
return pitBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: 2025/8/29 排麦位上麦
|
||||||
|
private RoomAuction.AuctionUserBean getPitBean3(RoomMessageEvent messageEvent) {
|
||||||
|
RoomAuction.AuctionUserBean roomAuction = new RoomAuction().getAuction_user();
|
||||||
|
roomAuction.setUser_id(messageEvent.getText().getFromUserInfo().getUser_id() + "");
|
||||||
|
roomAuction.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
|
||||||
|
roomAuction.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
|
||||||
|
roomAuction.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
|
||||||
|
roomAuction.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
|
||||||
|
|
||||||
|
return roomAuction;
|
||||||
|
}
|
||||||
|
|
||||||
public void mus() {
|
public void mus() {
|
||||||
if (mRoomInfoResp.getUser_info().getIs_mute().equals("1")) {
|
if (mRoomInfoResp.getUser_info().getIs_mute().equals("1")) {
|
||||||
com.hjq.toast.ToastUtils.show("您已经被禁言");
|
com.hjq.toast.ToastUtils.show("您已经被禁言");
|
||||||
@@ -2242,7 +2357,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
|
||||||
|
@NonNull int[] grantResults) {
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
|
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -362,6 +362,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
|||||||
mBinding.llGiftRule.setVisibility(View.GONE);
|
mBinding.llGiftRule.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
if (event.gift.getActivities_id() == 5) {
|
if (event.gift.getActivities_id() == 5) {
|
||||||
|
this.dismiss();
|
||||||
showGiftLotteryDialog(event.gift, roomId);
|
showGiftLotteryDialog(event.gift, roomId);
|
||||||
return;
|
return;
|
||||||
// String userId = gifyuseradapter.getUserIdToString();
|
// String userId = gifyuseradapter.getUserIdToString();
|
||||||
@@ -394,14 +395,26 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FragmentManager fm = getParentFragmentManager();
|
||||||
|
GiftLotteryDialog newDialog = GiftLotteryDialog.newInstance(gift.getGift_bag()+"", roomId, userId);
|
||||||
|
newDialog.show(fm, "GiftLotteryDialog");
|
||||||
|
|
||||||
|
fm.beginTransaction()
|
||||||
|
.replace(getId(), newDialog)
|
||||||
|
.addToBackStack(null)
|
||||||
|
.commit();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 如果当前dialog存在且正在显示,先关闭
|
// 如果当前dialog存在且正在显示,先关闭
|
||||||
if (currentDialog != null && currentDialog.isVisible()) {
|
// if (currentDialog != null && currentDialog.isVisible()) {
|
||||||
currentDialog.dismiss();
|
// currentDialog.dismiss();
|
||||||
|
// }
|
||||||
|
// currentDialog = GiftLotteryDialog.newInstance(gift.getGift_bag()+"", roomId, userId);
|
||||||
|
// currentDialog.show(getChildFragmentManager(), "GiftLotteryDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
currentDialog = GiftLotteryDialog.newInstance(gift.getGift_bag()+"", roomId, userId);
|
|
||||||
currentDialog.show(getChildFragmentManager(), "GiftLotteryDialog");
|
|
||||||
}
|
|
||||||
public void setGiftDetail(RoonGiftModel giftDetailResp) {
|
public void setGiftDetail(RoonGiftModel giftDetailResp) {
|
||||||
if (giftDetailResp == null) {
|
if (giftDetailResp == null) {
|
||||||
return;
|
return;
|
||||||
@@ -552,7 +565,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
|||||||
giftLabelBean.setId("0");
|
giftLabelBean.setId("0");
|
||||||
giftLabelBean.setName("背包");
|
giftLabelBean.setName("背包");
|
||||||
giftLabelBeans.add(0, giftLabelBean);
|
giftLabelBeans.add(0, giftLabelBean);
|
||||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), giftLabelBeans, fragmentList));
|
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), giftLabelBeans, fragmentList,roomId));
|
||||||
mBinding.viewPager.setOffscreenPageLimit(0);
|
mBinding.viewPager.setOffscreenPageLimit(0);
|
||||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||||
mBinding.slidingTabLayout.setCurrentTab(1);
|
mBinding.slidingTabLayout.setCurrentTab(1);
|
||||||
@@ -599,18 +612,19 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
|||||||
|
|
||||||
private List<GiftLabelBean> list;
|
private List<GiftLabelBean> list;
|
||||||
private List<Fragment> fragmentList;
|
private List<Fragment> fragmentList;
|
||||||
|
private String roomId;
|
||||||
|
|
||||||
|
public MyFragmentPagerAdapter(FragmentManager fm, List<GiftLabelBean> list, List<Fragment> fragmentList,String roomId) {
|
||||||
public MyFragmentPagerAdapter(FragmentManager fm, List<GiftLabelBean> list, List<Fragment> fragmentList) {
|
|
||||||
super(fm);
|
super(fm);
|
||||||
this.list = list;
|
this.list = list;
|
||||||
this.fragmentList = fragmentList;
|
this.fragmentList = fragmentList;
|
||||||
|
this.roomId = roomId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
GiftLabelBean model = list.get(position);
|
GiftLabelBean model = list.get(position);
|
||||||
Fragment fragment = GiftTwoDetailsFragment.newInstance(model.getId(), 1);
|
Fragment fragment = GiftTwoDetailsFragment.newInstance(model.getId(), 1, roomId);
|
||||||
fragmentList.add(fragment); // 保存 Fragment 实例
|
fragmentList.add(fragment); // 保存 Fragment 实例
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import com.example.moduleroom.databinding.DialogRoomSettingFragmentBinding;
|
|||||||
import com.example.moduleroom.fragment.RoomBackgroundDialogFragment;
|
import com.example.moduleroom.fragment.RoomBackgroundDialogFragment;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
import com.xscm.moduleutil.base.CommonAppContext;
|
import com.xscm.moduleutil.base.CommonAppContext;
|
||||||
|
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||||
import com.xscm.moduleutil.event.EffectEvent;
|
import com.xscm.moduleutil.event.EffectEvent;
|
||||||
import com.xscm.moduleutil.event.MusicEvent;
|
import com.xscm.moduleutil.event.MusicEvent;
|
||||||
import com.xscm.moduleutil.event.RoomOutEvent;
|
import com.xscm.moduleutil.event.RoomOutEvent;
|
||||||
@@ -83,8 +84,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
|||||||
read = 1;
|
read = 1;
|
||||||
} else if (roomInfoResp.getUser_info().getIs_management() != 0) {
|
} else if (roomInfoResp.getUser_info().getIs_management() != 0) {
|
||||||
read = 2;
|
read = 2;
|
||||||
}
|
} else if (roomInfoResp.getUser_info().getIs_host() != 0) {
|
||||||
else if (roomInfoResp.getUser_info().getIs_host() != 0 ) {
|
|
||||||
read = 3;
|
read = 3;
|
||||||
} else {
|
} else {
|
||||||
read = 4;
|
read = 4;
|
||||||
@@ -247,18 +247,21 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
|||||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomLeave) {
|
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomLeave) {
|
||||||
EventBus.getDefault().post(new RoomOutEvent());
|
EventBus.getDefault().post(new RoomOutEvent());
|
||||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSing) {
|
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeSing) {
|
||||||
MvpPre.changeRoomType(roomId, "1");
|
// MvpPre.changeRoomType(roomId, "1");
|
||||||
|
queren("1");
|
||||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction) {
|
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction) {
|
||||||
MvpPre.changeRoomType(roomId, "2");
|
// MvpPre.changeRoomType(roomId, "2");
|
||||||
|
queren("2");
|
||||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy) {
|
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy) {
|
||||||
MvpPre.changeRoomType(roomId, "3");
|
// MvpPre.changeRoomType(roomId, "3");
|
||||||
|
queren("3");
|
||||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl) {
|
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl) {
|
||||||
MvpPre.changeRoomType(roomId, "4");
|
// MvpPre.changeRoomType(roomId, "4");
|
||||||
}
|
queren("4");
|
||||||
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy) {
|
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy) {
|
||||||
MvpPre.changeRoomType(roomId, "7");
|
// MvpPre.changeRoomType(roomId, "7");
|
||||||
}
|
queren("7");
|
||||||
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
|
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
|
||||||
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
|
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
|
||||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomReport) {
|
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomReport) {
|
||||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/report?id=" + SpUtil.getToken() + "&fromType=" + 2 + "&fromId=" + roomId).navigation();
|
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/report?id=" + SpUtil.getToken() + "&fromType=" + 2 + "&fromId=" + roomId).navigation();
|
||||||
@@ -268,6 +271,23 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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") ? "交友" : ""))))),
|
||||||
|
"确认",
|
||||||
|
"取消",
|
||||||
|
v -> {
|
||||||
|
// 点击“确认”按钮时执行删除操作
|
||||||
|
MvpPre.changeRoomType(roomId, type);
|
||||||
|
},
|
||||||
|
v -> {
|
||||||
|
// 点击“取消”按钮时什么都不做
|
||||||
|
}, false, 0).show();
|
||||||
|
}
|
||||||
|
|
||||||
private void upAdapter() {
|
private void upAdapter() {
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ public class RoomWheatGiftSettingFragment extends BaseMvpDialogFragment<RewardGi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
Fragment fragment = GiftTwoDetailsFragment.newInstance("1", 0);
|
Fragment fragment = GiftTwoDetailsFragment.newInstance("1", 0,"");
|
||||||
fragmentList.add(fragment); // 保存 Fragment 实例
|
fragmentList.add(fragment); // 保存 Fragment 实例
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -616,6 +616,9 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
|
|||||||
} else if (message.getMsgType() == 1055) {
|
} else if (message.getMsgType() == 1055) {
|
||||||
EventBus.getDefault().post(message);
|
EventBus.getDefault().post(message);
|
||||||
return;
|
return;
|
||||||
|
}else if (message.getMsgType()==1056 || message.getMsgType()==1057){
|
||||||
|
EventBus.getDefault().post(message);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
EventBus.getDefault().post(message);
|
EventBus.getDefault().post(message);
|
||||||
// easeChatAdapter.addData(new EMMessageInfo(message));
|
// easeChatAdapter.addData(new EMMessageInfo(message));
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import com.xscm.moduleutil.dialog.ConfirmDialog;
|
|||||||
import com.xscm.moduleutil.utils.ColorManager;
|
import com.xscm.moduleutil.utils.ColorManager;
|
||||||
import com.xscm.moduleutil.utils.ImageUtils;
|
import com.xscm.moduleutil.utils.ImageUtils;
|
||||||
import com.xscm.moduleutil.utils.SpUtil;
|
import com.xscm.moduleutil.utils.SpUtil;
|
||||||
|
import com.xscm.moduleutil.widget.RoomFriendshipWheatView;
|
||||||
import com.xscm.moduleutil.widget.RoomMakeWheatView;
|
import com.xscm.moduleutil.widget.RoomMakeWheatView;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@@ -82,56 +83,41 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
private int type;
|
private int type;
|
||||||
RoomFragment parentFragment;
|
RoomFragment parentFragment;
|
||||||
|
|
||||||
public static RoomAuctionFragment newInstance(RoomInfoResp roomInfoResp, int type) {
|
public static RoomAuctionFragment newInstance() {
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
|
||||||
RoomAuctionFragment fragment = new RoomAuctionFragment();
|
RoomAuctionFragment fragment = new RoomAuctionFragment();
|
||||||
args.putSerializable("roomInfo", roomInfoResp);
|
|
||||||
args.putInt("type", type);
|
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
// public static RoomAuctionFragment newInstance(RoomInfoResp roomInfoResp, int type) {
|
||||||
|
//
|
||||||
|
// Bundle args = new Bundle();
|
||||||
|
//
|
||||||
|
// RoomAuctionFragment fragment = new RoomAuctionFragment();
|
||||||
|
// args.putSerializable("roomInfo", roomInfoResp);
|
||||||
|
// args.putInt("type", type);
|
||||||
|
// fragment.setArguments(args);
|
||||||
|
// return fragment;
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(@NonNull Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
roomInfoResp = (RoomInfoResp) getArguments().getSerializable("roomInfo");
|
// roomInfoResp = (RoomInfoResp) getArguments().getSerializable("roomInfo");
|
||||||
type = getArguments().getInt("type");
|
// type = getArguments().getInt("type");
|
||||||
}
|
}
|
||||||
|
///更新数据
|
||||||
@Override
|
public void roomInfoUpdate(RoomInfoResp resp) {
|
||||||
protected RoomAuctionPresenterTow bindPresenter() {
|
roomInfoResp = resp;
|
||||||
return new RoomAuctionPresenterTow(this, getActivity());
|
if (roomInfoResp.getRoom_info().getLabel_id().equals("1")){
|
||||||
|
type=1;
|
||||||
|
}else if (roomInfoResp.getRoom_info().getLabel_id().equals("2")){
|
||||||
|
type=2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initOverlayButtons() {
|
|
||||||
// if (isButtonsInflated) return;
|
|
||||||
|
|
||||||
stub = requireActivity().findViewById(R.id.stub_buttons);
|
|
||||||
if (stub != null) {
|
|
||||||
View inflated = stub.inflate();
|
|
||||||
|
|
||||||
imActionJs = inflated.findViewById(R.id.im_action_ys);
|
|
||||||
imActionYs = inflated.findViewById(R.id.im_action_js);
|
|
||||||
|
|
||||||
if (imActionJs != null && imActionYs != null) {
|
|
||||||
// 设置点击事件
|
|
||||||
imActionJs.setOnClickListener(this::onChock);
|
|
||||||
imActionYs.setOnClickListener(this::onChock);
|
|
||||||
|
|
||||||
// isButtonsInflated = true;
|
|
||||||
} else {
|
|
||||||
// 报错提示:说明 top_overlay_buttons.xml 中没有定义这些 id
|
|
||||||
throw new IllegalStateException("im_action_js or im_action_ys not found in overlay layout");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initData() {
|
|
||||||
initOverlayButtons();
|
initOverlayButtons();
|
||||||
LogUtils.e("lxj", "展示room时间:" + TimeUtils.date2String(new Date()));
|
|
||||||
if (getActivity() instanceof RoomActivity) {
|
if (getActivity() instanceof RoomActivity) {
|
||||||
((RoomActivity) getActivity()).setvisibTop(true);
|
((RoomActivity) getActivity()).setvisibTop(true);
|
||||||
}
|
}
|
||||||
@@ -141,6 +127,15 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
wheatView.setData(roomPitBean);
|
wheatView.setData(roomPitBean);
|
||||||
|
|
||||||
imActionJs.setVisibility(VISIBLE);
|
imActionJs.setVisibility(VISIBLE);
|
||||||
|
}else {
|
||||||
|
RoomPitBean pitBean =new RoomPitBean();
|
||||||
|
pitBean.setUser_id("");
|
||||||
|
pitBean.setPit_number("9");
|
||||||
|
pitBean.setAvatar("");
|
||||||
|
pitBean.setNickname("");
|
||||||
|
pitBean.setSex("");
|
||||||
|
pitBean.setCharm("");
|
||||||
|
wheatView.setData(pitBean);
|
||||||
}
|
}
|
||||||
parentFragment = (RoomFragment) getParentFragment();
|
parentFragment = (RoomFragment) getParentFragment();
|
||||||
|
|
||||||
@@ -213,6 +208,56 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected RoomAuctionPresenterTow bindPresenter() {
|
||||||
|
return new RoomAuctionPresenterTow(this, getActivity());
|
||||||
|
}
|
||||||
|
|
||||||
|
///主持上麦
|
||||||
|
public void auctionData(RoomMessageEvent messageEvent){
|
||||||
|
// wheatView.setData(getPitBean(messageEvent));
|
||||||
|
if (messageEvent.getText().getPit_number().equals("9")) {
|
||||||
|
wheatView.setData(getPitBean(messageEvent));
|
||||||
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
|
imActionJs.setVisibility(View.VISIBLE);
|
||||||
|
imActionYs.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
parentFragment.updateWheatStatus(getPitBean(messageEvent), 9, true, true);
|
||||||
|
} else {
|
||||||
|
getvjs();
|
||||||
|
imActionYs.setVisibility(INVISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initOverlayButtons() {
|
||||||
|
// if (isButtonsInflated) return;
|
||||||
|
|
||||||
|
stub = requireActivity().findViewById(R.id.stub_buttons);
|
||||||
|
if (stub != null) {
|
||||||
|
View inflated = stub.inflate();
|
||||||
|
|
||||||
|
imActionJs = inflated.findViewById(R.id.im_action_ys);
|
||||||
|
imActionYs = inflated.findViewById(R.id.im_action_js);
|
||||||
|
|
||||||
|
if (imActionJs != null && imActionYs != null) {
|
||||||
|
// 设置点击事件
|
||||||
|
imActionJs.setOnClickListener(this::onChock);
|
||||||
|
imActionYs.setOnClickListener(this::onChock);
|
||||||
|
|
||||||
|
// isButtonsInflated = true;
|
||||||
|
} else {
|
||||||
|
// 报错提示:说明 top_overlay_buttons.xml 中没有定义这些 id
|
||||||
|
throw new IllegalStateException("im_action_js or im_action_ys not found in overlay layout");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void getvjs() {
|
private void getvjs() {
|
||||||
if (roomInfoResp.getUser_info().getIs_room_owner() == 1 || roomInfoResp.getUser_info().getIs_management() == 1 || roomInfoResp.getUser_info().getIs_host() == 1) {
|
if (roomInfoResp.getUser_info().getIs_room_owner() == 1 || roomInfoResp.getUser_info().getIs_management() == 1 || roomInfoResp.getUser_info().getIs_host() == 1) {
|
||||||
imActionJs.setVisibility(VISIBLE);
|
imActionJs.setVisibility(VISIBLE);
|
||||||
@@ -351,18 +396,6 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
|
|
||||||
|
|
||||||
private void getTextView() {
|
private void getTextView() {
|
||||||
// int defaultColor = ContextCompat.getColor(requireContext(), com.qxcm.moduleutil.R.color.color_0DFFB9); // 原亲密拍颜色
|
|
||||||
// int selectedColor = Color.WHITE; // 原真爱拍颜色
|
|
||||||
// float defaultSize = 24f; // 亲密拍默认字体大小
|
|
||||||
// float selectedSize = 16f; // 真爱拍默认字体大小
|
|
||||||
// if (type == 1) {
|
|
||||||
// toggleTextStyles(mBinding.qinmi, mBinding.zhenai, defaultColor, selectedColor, defaultSize, selectedSize, type);
|
|
||||||
// }else {
|
|
||||||
// toggleTextStyles(mBinding.qinmi, mBinding.zhenai, defaultColor, selectedColor, defaultSize, selectedSize, type);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
int defaultColor = ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_0DFFB9); // 亲密拍默认颜色
|
int defaultColor = ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_0DFFB9); // 亲密拍默认颜色
|
||||||
int selectedColor = ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white); // 切换到真爱拍的颜色
|
int selectedColor = ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white); // 切换到真爱拍的颜色
|
||||||
float defaultSize = 24f; // 亲密拍默认字体大小
|
float defaultSize = 24f; // 亲密拍默认字体大小
|
||||||
@@ -586,52 +619,29 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void roomInfoEvent(RoomMessageEvent messageEvent) {
|
public void roomInfoEvent(RoomMessageEvent messageEvent) {
|
||||||
boolean b = false;
|
boolean b = false;
|
||||||
if (messageEvent.getMsgType() == 1003) {//上麦
|
// if (messageEvent.getMsgType() == 1003) {//上麦
|
||||||
if (messageEvent.getText().getPit_number().equals("9")) {
|
// if (messageEvent.getText().getPit_number().equals("9")) {
|
||||||
wheatView.setData(getPitBean(messageEvent));
|
// wheatView.setData(getPitBean(messageEvent));
|
||||||
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
|
||||||
imActionJs.setVisibility(View.VISIBLE);
|
|
||||||
imActionYs.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
parentFragment.updateWheatStatus(getPitBean(messageEvent), 9, true, true);
|
|
||||||
// parentFragment.setRoleType(3, 9);
|
|
||||||
// parentFragment.switchMic(2);
|
|
||||||
} else {
|
|
||||||
getvjs();
|
|
||||||
imActionYs.setVisibility(INVISIBLE);
|
|
||||||
// if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
// if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
// parentFragment.setRoleType(3, 0);
|
// imActionJs.setVisibility(View.VISIBLE);
|
||||||
// parentFragment.switchMic(2);
|
// imActionYs.setVisibility(View.VISIBLE);
|
||||||
|
//
|
||||||
|
// parentFragment.updateWheatStatus(getPitBean(messageEvent), 9, true, true);
|
||||||
|
// } else {
|
||||||
|
// getvjs();
|
||||||
|
// imActionYs.setVisibility(INVISIBLE);
|
||||||
// }
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// } else
|
||||||
} else if (messageEvent.getMsgType() == 1004) {
|
if (messageEvent.getMsgType() == 1004) {
|
||||||
if (messageEvent.getText().getPit_number().equals("9")) {
|
if (messageEvent.getText().getPit_number().equals("9")) {
|
||||||
wheatView.setData(getPitBean2(messageEvent, "9"));
|
wheatView.setData(getPitBean2(messageEvent, "9"));
|
||||||
getvjs();
|
getvjs();
|
||||||
imActionYs.setVisibility(GONE);
|
imActionYs.setVisibility(GONE);
|
||||||
|
|
||||||
// RoomPitBean pitBean = roomInfoResp.getRoom_info().getPit_list().get(Integer.parseInt(messageEvent.getText().getPit_number()) - 1);
|
|
||||||
// pitBean.setUser_id("");
|
|
||||||
// pitBean.setAvatar("");
|
|
||||||
// pitBean.setNickname("");
|
|
||||||
// pitBean.setSex("");
|
|
||||||
// pitBean.setCharm("");
|
|
||||||
// roomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(messageEvent.getText().getPit_number()) - 1, pitBean);
|
|
||||||
// if (SpUtil.getUserId() == messageEvent.getText().getFromUserInfo().getUser_id()) {
|
|
||||||
//
|
|
||||||
// AgoraManager.getInstance(getActivity()).ClientRole(false);
|
|
||||||
// AgoraManager.getInstance(getActivity()).muteLocalAudioStream(true);
|
|
||||||
// } else {
|
|
||||||
// b = false;
|
|
||||||
// }
|
|
||||||
//// AgoraManager.getInstance(getActivity()).setEnableAudio(b);
|
|
||||||
// if (parentFragment != null) {
|
|
||||||
// parentFragment.updateWheatStatus(pitBean, Integer.parseInt(messageEvent.getText().getPit_number()), false, b);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
RoomPitBean pitBean = wheatView.pitBean;
|
RoomPitBean pitBean = wheatView.pitBean;
|
||||||
@@ -1053,8 +1063,6 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
|
|
||||||
// TODO: 2025/6/30 上麦,麦位变化
|
// TODO: 2025/6/30 上麦,麦位变化
|
||||||
private RoomPitBean getPitBean(RoomMessageEvent messageEvent) {
|
private RoomPitBean getPitBean(RoomMessageEvent messageEvent) {
|
||||||
RoomFragment parentFragment = (RoomFragment) getParentFragment();
|
|
||||||
boolean b;
|
|
||||||
RoomPitBean pitBean = new RoomPitBean();
|
RoomPitBean pitBean = new RoomPitBean();
|
||||||
pitBean.setPit_number(messageEvent.getText().getPit_number());
|
pitBean.setPit_number(messageEvent.getText().getPit_number());
|
||||||
pitBean.setUser_id(messageEvent.getText().getFromUserInfo().getUser_id() + "");
|
pitBean.setUser_id(messageEvent.getText().getFromUserInfo().getUser_id() + "");
|
||||||
@@ -1063,17 +1071,6 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
|
pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
|
||||||
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
|
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
|
||||||
|
|
||||||
// if (SpUtil.getUserId() == messageEvent.getText().getFromUserInfo().getUser_id()) {
|
|
||||||
// b = true;
|
|
||||||
// AgoraManager.getInstance(getActivity()).ClientRole(true);
|
|
||||||
// AgoraManager.getInstance(getActivity()).muteLocalAudioStream(false);
|
|
||||||
// } else {
|
|
||||||
// b = false;
|
|
||||||
// }
|
|
||||||
if (parentFragment != null) {
|
|
||||||
|
|
||||||
// parentFragment.updateWheatStatus(pitBean, Integer.parseInt(messageEvent.getText().getPit_number()), true, b);
|
|
||||||
}
|
|
||||||
return pitBean;
|
return pitBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1093,18 +1090,18 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
if (!EventBus.getDefault().isRegistered(this)) {
|
// if (!EventBus.getDefault().isRegistered(this)) {
|
||||||
EventBus.getDefault().register(this);
|
// EventBus.getDefault().register(this);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
if (EventBus.getDefault().isRegistered(this)) {
|
// if (EventBus.getDefault().isRegistered(this)) {
|
||||||
EventBus.getDefault().unregister(this);
|
// EventBus.getDefault().unregister(this);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1134,4 +1131,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -278,6 +278,13 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
|||||||
friendshipRoomFragment.roomInfoUpdate(mRoomInfoResp);
|
friendshipRoomFragment.roomInfoUpdate(mRoomInfoResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else if ("2".equals(typeId)){//拍卖房
|
||||||
|
RoomAuctionFragment auctionRoomFragment = (RoomAuctionFragment) getChildFragmentManager()
|
||||||
|
.findFragmentByTag(RoomAuctionFragment.class.getSimpleName());
|
||||||
|
if (auctionRoomFragment != null && auctionRoomFragment.isAdded()){
|
||||||
|
auctionRoomFragment.roomInfoUpdate(mRoomInfoResp);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -376,9 +383,11 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
|||||||
}
|
}
|
||||||
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("2")) {
|
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("2")) {
|
||||||
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1")) {
|
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1")) {
|
||||||
replaceNestedFragment(RoomAuctionFragment.newInstance(mRoomInfoResp, 1), R.id.container);
|
replaceNestedFragment(RoomAuctionFragment.newInstance(), R.id.container);
|
||||||
|
// replaceNestedFragment(RoomAuctionFragment.newInstance(mRoomInfoResp, 1), R.id.container);
|
||||||
} else if (mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) {
|
} else if (mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) {
|
||||||
replaceNestedFragment(RoomAuctionFragment.newInstance(mRoomInfoResp, 2), R.id.container);
|
replaceNestedFragment(RoomAuctionFragment.newInstance(), R.id.container);
|
||||||
|
// replaceNestedFragment(RoomAuctionFragment.newInstance(mRoomInfoResp, 2), R.id.container);
|
||||||
}
|
}
|
||||||
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("6")) {
|
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("6")) {
|
||||||
replaceNestedFragment(RoomCabinFragment.newInstance(mRoomInfoResp), R.id.container);
|
replaceNestedFragment(RoomCabinFragment.newInstance(mRoomInfoResp), R.id.container);
|
||||||
@@ -398,12 +407,8 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
|||||||
replaceNestedFragment(RoomKtvFragment.newInstance(mRoomInfoResp), R.id.container);
|
replaceNestedFragment(RoomKtvFragment.newInstance(mRoomInfoResp), R.id.container);
|
||||||
}
|
}
|
||||||
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("7")) {
|
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("7")) {
|
||||||
// if (getActivity() instanceof RoomActivity) {
|
|
||||||
// ((RoomActivity) getActivity()).changeBackground(com.xscm.moduleutil.R.mipmap.jiaoy_bj);
|
|
||||||
// }
|
|
||||||
replaceNestedFragment(FriendshipRoomFragment.newInstance(), R.id.container);
|
replaceNestedFragment(FriendshipRoomFragment.newInstance(), R.id.container);
|
||||||
}
|
}
|
||||||
// mBinding.inputMenu1.performClick();
|
|
||||||
instView();
|
instView();
|
||||||
setview();
|
setview();
|
||||||
|
|
||||||
@@ -486,7 +491,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
|||||||
if (getActivity() instanceof RoomActivity) {
|
if (getActivity() instanceof RoomActivity) {
|
||||||
((RoomActivity) getActivity()).upRoomInfo(mRoomInfoResp);
|
((RoomActivity) getActivity()).upRoomInfo(mRoomInfoResp);
|
||||||
}
|
}
|
||||||
|
updateSeatViewExchangedWithPitArray(mRoomInfoResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateSeatViewExchangedWithPitArray(RoomInfoResp roomInfoResp) {
|
public void updateSeatViewExchangedWithPitArray(RoomInfoResp roomInfoResp) {
|
||||||
@@ -1139,7 +1144,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void roomInfoEvent(RoomMessageEvent messageEvent) {
|
public void roomInfoEvent(RoomMessageEvent messageEvent) {
|
||||||
if (messageEvent.getMsgType() == 123) {
|
if (messageEvent.getMsgType() == 123) {
|
||||||
// // 获取 PublicScreenEaseChatFragment 实例
|
// // 获取 PublicScreenEaseChatFragment 实例
|
||||||
@@ -1150,28 +1155,31 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
|||||||
// 调用 someMethod 方法
|
// 调用 someMethod 方法
|
||||||
publicScreenEaseChatFragment.someMethod();
|
publicScreenEaseChatFragment.someMethod();
|
||||||
}
|
}
|
||||||
} else if (messageEvent.getMsgType() == 1003) {
|
|
||||||
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
|
||||||
// mBinding.ivWheatFeeding.setImageResource(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up);
|
|
||||||
aBoolean = false;
|
|
||||||
((RoomActivity) getActivity()).ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up);
|
|
||||||
((RoomActivity) getActivity()).setBoolean(aBoolean);
|
|
||||||
mRoomInfoResp.getUser_info().setPit_number(messageEvent.getText().getPit_number() != null ? Integer.parseInt(messageEvent.getText().getPit_number()) : 0);
|
|
||||||
((RoomActivity) getActivity()).setRoleType(3, Integer.parseInt(messageEvent.getText().getPit_number()));
|
|
||||||
((RoomActivity) getActivity()).switchMic(2);
|
|
||||||
}
|
}
|
||||||
} else if (messageEvent.getMsgType() == 1004) {
|
// else if (messageEvent.getMsgType() == 1003) {
|
||||||
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
// if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
// mBinding.ivWheatFeeding.setImageResource(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
//// mBinding.ivWheatFeeding.setImageResource(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up);
|
||||||
aBoolean = true;
|
// aBoolean = false;
|
||||||
((RoomActivity) getActivity()).ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
// ((RoomActivity) getActivity()).ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up);
|
||||||
((RoomActivity) getActivity()).setBoolean(aBoolean);
|
// ((RoomActivity) getActivity()).setBoolean(aBoolean);
|
||||||
mRoomInfoResp.getUser_info().setPit_number(0);
|
// mRoomInfoResp.getUser_info().setPit_number(messageEvent.getText().getPit_number() != null ? Integer.parseInt(messageEvent.getText().getPit_number()) : 0);
|
||||||
((RoomActivity) getActivity()).setRoleType(0, 0);
|
// ((RoomActivity) getActivity()).setRoleType(3, Integer.parseInt(messageEvent.getText().getPit_number()));
|
||||||
((RoomActivity) getActivity()).switchMic(2);
|
// ((RoomActivity) getActivity()).switchMic(2);
|
||||||
}
|
// }
|
||||||
// setRoleType(messageEvent.getRoleType(), messageEvent.getPit_number());
|
// }
|
||||||
} else if (messageEvent.getMsgType() == 1034) {
|
// else if (messageEvent.getMsgType() == 1004) {
|
||||||
|
// if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
|
//// mBinding.ivWheatFeeding.setImageResource(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
||||||
|
// aBoolean = true;
|
||||||
|
// ((RoomActivity) getActivity()).ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
||||||
|
// ((RoomActivity) getActivity()).setBoolean(aBoolean);
|
||||||
|
// mRoomInfoResp.getUser_info().setPit_number(0);
|
||||||
|
// ((RoomActivity) getActivity()).setRoleType(0, 0);
|
||||||
|
// ((RoomActivity) getActivity()).switchMic(2);
|
||||||
|
// }
|
||||||
|
//// setRoleType(messageEvent.getRoleType(), messageEvent.getPit_number());
|
||||||
|
// } else
|
||||||
|
if (messageEvent.getMsgType() == 1034) {
|
||||||
int count = messageEvent.getText().getCount();
|
int count = messageEvent.getText().getCount();
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
((RoomActivity) getActivity()).tvFirst(new SpannableStringBuilder("0人排队"));
|
((RoomActivity) getActivity()).tvFirst(new SpannableStringBuilder("0人排队"));
|
||||||
@@ -1219,4 +1227,12 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
///拍卖房上麦数据
|
||||||
|
public void auctionData(RoomMessageEvent messageEvent){
|
||||||
|
RoomAuctionFragment auctionFragment = (RoomAuctionFragment) getChildFragmentManager()
|
||||||
|
.findFragmentByTag(FriendshipRoomFragment.class.getSimpleName());
|
||||||
|
if (auctionFragment != null)
|
||||||
|
auctionFragment.auctionData(messageEvent);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ public class CardRelationshipPresenter extends BasePresenter<CardRelationshipCon
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getGiftList(String id) {
|
public void getGiftList(String id) {
|
||||||
api.getGiftList(Integer.parseInt(id), new BaseObserver<List<RoonGiftModel>>() {
|
api.getGiftList(Integer.parseInt(id),"", new BaseObserver<List<RoonGiftModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|||||||