1.添加巡乐会房间展示
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.example.moduleroom">
|
||||
|
||||
<application>
|
||||
@@ -16,14 +17,13 @@
|
||||
android:name=".activity.RoomActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity=".RoomTaskAffinity"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:enableOnBackInvokedCallback="false"
|
||||
android:theme="@style/TransparentActivityTheme"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||
/>
|
||||
tools:targetApi="tiramisu" />
|
||||
<!-- <activity-->
|
||||
<!-- android:name=".activity.RoomActivity"-->
|
||||
<!-- android:launchMode="singleInstancePerTask"-->
|
||||
|
||||
@@ -51,6 +51,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -81,6 +82,7 @@ import com.example.moduleroom.fragment.PublicScreenEaseChatFragment;
|
||||
import com.example.moduleroom.fragment.RoomCabinFragment;
|
||||
import com.example.moduleroom.fragment.RoomChartsFragment;
|
||||
import com.example.moduleroom.fragment.RoomNoticeDialogFragment;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.petterp.floatingx.assist.helper.FxScopeHelper;
|
||||
import com.petterp.floatingx.listener.control.IFxControl;
|
||||
import com.tencent.imsdk.v2.V2TIMValueCallback;
|
||||
@@ -517,7 +519,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
@Override
|
||||
public void onExitRoom() {
|
||||
// 调用退出房间方法
|
||||
MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
// MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
|
||||
// 真正退出房间
|
||||
performExitRoom(1);
|
||||
@@ -1034,6 +1036,18 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
// MP4PlaybackCallback mp4PlaybackCallback=MP4PlaybackCallback.getInstance();
|
||||
// mp4PlaybackCallback.setAvatarFrameView(mBinding.svgaGift);
|
||||
// mBinding.svgaGift.setAnimListener(mp4PlaybackCallback);
|
||||
|
||||
mBinding.xlhIm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
FragmentManager fm = getSupportFragmentManager();
|
||||
if (fm != null && !fm.isDestroyed()) {
|
||||
TourClubDialogFragment newDialog = TourClubDialogFragment.newInstance(
|
||||
roomId);
|
||||
newDialog.show(fm, "TourClubDialogFragment");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void onGiftGiveProgressClcik() {
|
||||
@@ -1168,6 +1182,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
enterLandscapeMode();
|
||||
}
|
||||
}
|
||||
|
||||
private void enterLandscapeMode() {
|
||||
isFullScreen = true;
|
||||
|
||||
@@ -1218,11 +1233,11 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
ivQuan.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void enterFullScreen() {
|
||||
isFullScreen = true;
|
||||
|
||||
|
||||
|
||||
// 隐藏系统UI
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(
|
||||
@@ -1426,7 +1441,13 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
public void roomInfoEvent(RoomMessageEvent messageEvent) {
|
||||
if (messageEvent == null) return;
|
||||
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
int msgType = messageEvent.getMsgType();
|
||||
RoomMessageEvent.T text = messageEvent.getText();
|
||||
@@ -1458,31 +1479,10 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
} else if (msgType == 1024) {
|
||||
handleMsgType1024(messageEvent, text);
|
||||
} else if (msgType == 1025) {
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
roomFragment.handleAuctionMessageEvent(messageEvent);
|
||||
} else if (msgType == 1026) {
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
roomFragment.handleAuctionMessageEvent(messageEvent);
|
||||
} else if (msgType == 1027) {
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
roomFragment.handleAuctionMessageEvent(messageEvent);
|
||||
} else if (msgType == 1020) {
|
||||
handleMsgType1020(messageEvent, text);
|
||||
@@ -1505,13 +1505,6 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
} else if (msgType == 1051) {
|
||||
handleMsgType1051(messageEvent, text);
|
||||
} else if (msgType == 1052) {
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
roomFragment.upCabinFragment(text.getTime_day());
|
||||
} else if (msgType == 1053) {
|
||||
handleMsgType1053(messageEvent, text);
|
||||
@@ -1522,22 +1515,21 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
} else if (msgType == 1035) {
|
||||
handleMsgType1035(messageEvent, text);
|
||||
} else if (msgType == 1030 || msgType == 1031 || msgType == 1032 || msgType == 1033 || msgType == 1015 || msgType == 1037) {
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
roomFragment.SingSongEvent(messageEvent);
|
||||
if (msgType == 1032 || msgType == 1033) {
|
||||
setRoleType(3, -11);
|
||||
}
|
||||
} else if (msgType == 125) {
|
||||
handleMsgType125(messageEvent, text);
|
||||
}else if (msgType==1006){
|
||||
handleMsgType1006();
|
||||
} else if (msgType == 1007) {
|
||||
handleMsgType1007();
|
||||
} else if (msgType == 1018) {
|
||||
}else if (msgType == 1017){
|
||||
handleMsgType1017();
|
||||
}
|
||||
else if (msgType == 1018) {
|
||||
handleMsgType1018();
|
||||
} else if (msgType == 126) {
|
||||
handleMsgType126(messageEvent, text);
|
||||
@@ -1548,22 +1540,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
} else if (msgType == 1039) {
|
||||
handleMsgType1039(messageEvent, text);
|
||||
} else if (msgType == 1028) {
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
roomFragment.handleMsgType1028(messageEvent);
|
||||
} else if (msgType == 1058) {
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
if (mRoomInfoResp != null && mRoomInfoResp.getRoom_info() != null) {
|
||||
if (mRoomInfoResp.getRoom_info().getType_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("3") ||
|
||||
mRoomInfoResp.getRoom_info().getType_id().equals("4") || mRoomInfoResp.getRoom_info().getType_id().equals("8")) {
|
||||
@@ -1579,13 +1557,6 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
}
|
||||
} else if (msgType == 1059) {// 1059清除个人魅力 1058在离线
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
if (mRoomInfoResp != null && mRoomInfoResp.getRoom_info() != null) {
|
||||
if (mRoomInfoResp.getRoom_info().getType_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("3") ||
|
||||
mRoomInfoResp.getRoom_info().getType_id().equals("4") || mRoomInfoResp.getRoom_info().getType_id().equals("8")) {
|
||||
@@ -1600,7 +1571,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
roomFragment.friendshipRoomFragmentEvent(messageEvent);
|
||||
}
|
||||
}
|
||||
} else if (msgType == 1056) {
|
||||
} else if (msgType == 1056) {// 1056 抽奖结果
|
||||
GiftLotteryDialog dialog = (GiftLotteryDialog) getSupportFragmentManager()
|
||||
.findFragmentByTag("GiftLotteryDialog");
|
||||
if (dialog != null && dialog.isVisible()) {
|
||||
@@ -1608,6 +1579,17 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
} else {
|
||||
EventBus.getDefault().post(messageEvent.getText().getXlh_data());
|
||||
}
|
||||
|
||||
if (messageEvent.getText().getXlh_data() != null) {
|
||||
if (messageEvent.getText().getXlh_data().getStatus() == 1) {
|
||||
mBinding.xlhRk.setVisibility(View.VISIBLE);
|
||||
xlhDjs(messageEvent.getText().getXlh_data().getEnd_time());
|
||||
} else {
|
||||
mBinding.xlhRk.setVisibility(INVISIBLE);
|
||||
releaseCountDownTimer1();
|
||||
}
|
||||
}
|
||||
|
||||
} else if (msgType == 1057) {
|
||||
TourClubDialogFragment existingFragment = (TourClubDialogFragment) getSupportFragmentManager().findFragmentByTag("TourClubDialogFragment");
|
||||
if (existingFragment != null && existingFragment.isVisible()) {
|
||||
@@ -1616,10 +1598,105 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
LogUtils.e("TourClubDialogFragment", "巡乐会界面未打开");
|
||||
EventBus.getDefault().post(messageEvent);
|
||||
}
|
||||
xlhDjs(messageEvent.getText().getEnd_time());
|
||||
// if (messageEvent.getText().getXlh_data() != null) {
|
||||
// if (messageEvent.getText().getXlh_data().getStatus() == 1) {
|
||||
// mBinding.xlhRk.setVisibility(View.VISIBLE);
|
||||
// xlhDjs(messageEvent.getText().getEnd_time());
|
||||
// } else {
|
||||
// mBinding.xlhRk.setVisibility(View.GONE);
|
||||
// releaseCountDownTimer1();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private long endTime;
|
||||
|
||||
private void xlhDjs(String endTimeStr) {
|
||||
// 获取结束时间并启动倒计时
|
||||
if (endTimeStr != null && !endTimeStr.isEmpty()) {
|
||||
try {
|
||||
// 假设 end_time 是时间戳字符串
|
||||
endTime = Long.parseLong(endTimeStr);
|
||||
countDownTime(endTime);
|
||||
} catch (NumberFormatException e) {
|
||||
// 如果不是时间戳,可能是日期字符串,需要相应解析
|
||||
// 例如:2025-08-26 19:10:47
|
||||
// 可以使用 SimpleDateFormat 解析
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void countDownTime(long time) {
|
||||
try {
|
||||
if (time <= 0) {
|
||||
setTime(0);
|
||||
|
||||
releaseCountDownTimer1();
|
||||
return;
|
||||
}
|
||||
releaseCountDownTimer1();
|
||||
// 获取当前时间的毫秒值
|
||||
long currentTime = System.currentTimeMillis() / 1000L;
|
||||
// 计算倒计时的总秒数
|
||||
long countDownTime = (time - currentTime);
|
||||
Logger.d("@@@", "countDownTime = " + countDownTime);
|
||||
if (countDownTime <= 0) {
|
||||
setTime(0);
|
||||
releaseCountDownTimer1();
|
||||
return;
|
||||
}
|
||||
mCountDownTimer2 = new CountDownTimer(countDownTime * 1000L, 1000L) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
int time1 = (int) (millisUntilFinished / 1000);
|
||||
setTime(time1);
|
||||
// mBinding.tvDjs.setText(time1 + "");
|
||||
if (time1 == 0) {
|
||||
mBinding.xlhRk.setVisibility(INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
setTime(0);
|
||||
}
|
||||
};
|
||||
mCountDownTimer2.start();
|
||||
} catch (Exception e) {
|
||||
Logger.e("countDownTime", e);
|
||||
}
|
||||
}
|
||||
|
||||
private String formatTime(int totalSeconds) {
|
||||
int minutes = (totalSeconds % 3600) / 60;
|
||||
int seconds = totalSeconds % 60;
|
||||
|
||||
return String.format("%02d:%02d", minutes, seconds);
|
||||
}
|
||||
|
||||
@SuppressLint("DefaultLocale")
|
||||
public void setTime(int seconds) {
|
||||
if (seconds == 0) {
|
||||
mBinding.xlhRk.setVisibility(INVISIBLE);
|
||||
return;
|
||||
}
|
||||
String formattedTime = formatTime(seconds);
|
||||
mBinding.tvDjs.setText("倒计时" + formattedTime);
|
||||
|
||||
}
|
||||
|
||||
// TODO: 2025/3/19 释放倒计时器
|
||||
private void releaseCountDownTimer1() {
|
||||
if (mCountDownTimer2 != null) {
|
||||
mCountDownTimer2.cancel();
|
||||
mCountDownTimer2 = null;
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, RoomPitBean> pitMap = new HashMap<>();
|
||||
|
||||
public void handleMsgType1039(RoomMessageEvent messageEvent, RoomMessageEvent.T text) {
|
||||
@@ -2084,6 +2161,9 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
private void handleMsgType1002() {
|
||||
number--;
|
||||
if (number<0){
|
||||
number=0;
|
||||
}
|
||||
mBinding.roomTop.tvNum.setText(number + "");
|
||||
}
|
||||
|
||||
@@ -2314,6 +2394,13 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMsgType1006(){
|
||||
if (mRoomInfoResp!=null && mRoomInfoResp.getUser_info() != null){
|
||||
mRoomInfoResp.getUser_info().setIs_management(1);
|
||||
roomFragment.upRoomInfoData(mRoomInfoResp);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMsgType1018() {
|
||||
if (mRoomInfoResp != null && mRoomInfoResp.getUser_info() != null) {
|
||||
mRoomInfoResp.getUser_info().setIs_host(0);
|
||||
@@ -2322,6 +2409,13 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMsgType1017(){
|
||||
if (mRoomInfoResp!=null && mRoomInfoResp.getUser_info() != null){
|
||||
mRoomInfoResp.getUser_info().setIs_management(0);
|
||||
roomFragment.upRoomInfoData(mRoomInfoResp);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMsgType126(RoomMessageEvent messageEvent, RoomMessageEvent.T text) {
|
||||
if (text == null) return;
|
||||
|
||||
@@ -2532,6 +2626,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
private boolean canSend = true;
|
||||
private boolean aBoolean = true;//上下麦按钮
|
||||
private CountDownTimer mCountDownTimer;
|
||||
private CountDownTimer mCountDownTimer2;
|
||||
|
||||
private void onClick(View view) {
|
||||
int id = view.getId();
|
||||
@@ -2586,6 +2681,10 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
} else if (id == R.id.rl_sett) {//房间设置
|
||||
// RoomSettingFragment.show(mRoomInfoResp, getSupportFragmentManager());
|
||||
if (mRoomInfoResp==null){
|
||||
ToastUtils.showShort("请稍后再试");
|
||||
return;
|
||||
}
|
||||
RoomSettingFragment fragment = RoomSettingFragment.show(mRoomInfoResp, getSupportFragmentManager());
|
||||
if (fragment != null) {
|
||||
addActiveDialogFragment(fragment); // 添加到管理列表
|
||||
@@ -2698,6 +2797,9 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
// 添加前后台状态检测
|
||||
private boolean isAppInForeground() {
|
||||
if (mRoomInfoResp==null){
|
||||
return true;
|
||||
}
|
||||
if (!mRoomInfoResp.getRoom_info().getLabel_id().equals("6")) {
|
||||
ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
|
||||
List<ActivityManager.RunningAppProcessInfo> appProcesses = activityManager.getRunningAppProcesses();
|
||||
@@ -2780,7 +2882,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
// 隐藏Activity而不是销毁它
|
||||
// moveTaskToBack(true);
|
||||
// 使用 moveTaskToBack 将应用最小化
|
||||
moveTaskToBack(true);
|
||||
// moveTaskToBack(true);
|
||||
}
|
||||
|
||||
private void saveMinimizeState() {
|
||||
@@ -3052,7 +3154,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
String text = etContent.getText().toString();
|
||||
if (TextUtils.isEmpty(text)) {
|
||||
com.hjq.toast.ToastUtils.show("请输入评论内容");
|
||||
com.hjq.toast.ToastUtils.show("发送消息不哪呢过为空");
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new RoomInputEvent(text));
|
||||
@@ -3123,7 +3225,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void roomOut(RoomOutEvent roomOutEvent) {
|
||||
MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
// MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
performExitRoom(2);
|
||||
}
|
||||
|
||||
@@ -3242,6 +3344,14 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
setupEffectView();
|
||||
|
||||
if (mRoomInfoResp.getGift_cycle()!=null && mRoomInfoResp.getGift_cycle().getXlh_info()!=null && mRoomInfoResp.getGift_cycle().getXlh_info().getXlh_status()!=null && mRoomInfoResp.getGift_cycle().getXlh_info().getXlh_status().equals("1")){
|
||||
mBinding.xlhRk.setVisibility(View.VISIBLE);
|
||||
xlhDjs(mRoomInfoResp.getGift_cycle().getXlh_info().getEnd_time());
|
||||
} else {
|
||||
mBinding.xlhRk.setVisibility(INVISIBLE);
|
||||
releaseCountDownTimer1();
|
||||
}
|
||||
|
||||
// sharedViewModel.setDataForFragment(mRoomInfoResp);
|
||||
//
|
||||
}
|
||||
@@ -3510,6 +3620,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
super.onResume();
|
||||
CommonAppContext.getInstance().isShow = true;
|
||||
CommonAppContext.getInstance().isPlaying = true;
|
||||
CommonAppContext.getInstance().isRoomJoininj=false;
|
||||
// 当Activity恢复时,重置标记
|
||||
userLeaving = true;
|
||||
// // 正常启动或从后台恢复
|
||||
@@ -4043,6 +4154,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
// 3. 清理 CountDownTimer
|
||||
releaseCountDownTimer();
|
||||
releaseCountDownTimer1();
|
||||
if (giftCountTimer != null) {
|
||||
giftCountTimer.cancel();
|
||||
giftCountTimer = null;
|
||||
|
||||
@@ -83,6 +83,10 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
super.onAttach(context);
|
||||
// roomId=getArguments().getString("roomId");
|
||||
roomInfoResp = (RoomInfoResp) getArguments().getSerializable("roomInfoResp");
|
||||
if (roomInfoResp==null){
|
||||
ToastUtils.show("房间信息为空");
|
||||
return;
|
||||
}
|
||||
roomId = roomInfoResp.getRoom_info().getRoom_id();
|
||||
if (roomInfoResp.getUser_info().getIs_room_owner() != 0) {
|
||||
read = 1;
|
||||
@@ -280,12 +284,20 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU) {
|
||||
queren("8");
|
||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
|
||||
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
|
||||
if (roomInfoResp != null) {
|
||||
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
|
||||
} else {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
|
||||
}
|
||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomReport) {
|
||||
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();
|
||||
if (roomId != null) {
|
||||
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();
|
||||
}else {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("数据错误,请关闭重试");
|
||||
}
|
||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_ALLOWANCE).withString("from", "我的界面").withString("roomId", roomInfoResp.getRoom_info().getRoom_id() + "").navigation();
|
||||
}else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen){//2025年9月22日14:10:25,添加飘屏关闭打开按钮
|
||||
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen) {//2025年9月22日14:10:25,添加飘屏关闭打开按钮
|
||||
if (floatingScreen) {
|
||||
//关闭
|
||||
floatingScreen = false;
|
||||
@@ -344,8 +356,8 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
if (type==RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy){
|
||||
} else {
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -360,8 +372,8 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
if (type==RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy){
|
||||
} else {
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -369,10 +381,10 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
}
|
||||
if (type >= RoomSettingBean.QXRoomSettingTypeRoomLeave &&
|
||||
type <= RoomSettingBean.QXRoomSettingTypeRoomReport
|
||||
) {
|
||||
) {
|
||||
return true;
|
||||
}else {
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy){
|
||||
} else {
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -401,7 +413,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ||
|
||||
type == RoomSettingBean.QXRoomSettingTypeRoomCloseEffects ||
|
||||
type == RoomSettingBean.QXRoomSettingTypeRoomReport ||
|
||||
type== RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen;
|
||||
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -863,15 +863,15 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
|
||||
postAndAddMessage(message);
|
||||
break;
|
||||
|
||||
case 1002:
|
||||
postAndAddMessage(message);
|
||||
break;
|
||||
// case 1002:
|
||||
// postAndAddMessage(message);
|
||||
// break;
|
||||
|
||||
case 123:
|
||||
easeChatAdapter.clearData();
|
||||
postAndAddMessage(message);
|
||||
break;
|
||||
|
||||
case 1002:
|
||||
case 1012:
|
||||
case 1014:
|
||||
case 1013:
|
||||
|
||||
@@ -333,6 +333,9 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
}
|
||||
|
||||
if (userIds.length() > 0 && roomId != null) {
|
||||
if (MvpPre==null){
|
||||
MvpPre = new SingSongPresenter(this, getContext());
|
||||
}
|
||||
MvpPre.userOnlineStatus(userIds.toString(), roomId);
|
||||
} else {
|
||||
// updateWheatData();
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.xscm.moduleutil.bean.PkSwTokenBean;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
@@ -26,7 +27,7 @@ public class SingSongPresenter extends BaseRoomPresenter<SingSongContacts.View>
|
||||
|
||||
@Override
|
||||
public void applyPit(String roomId, String pitNumber) {
|
||||
api.applyPit(roomId, pitNumber, new BaseObserver<String>() {
|
||||
RetrofitClient.getInstance().applyPit(roomId, pitNumber, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
@@ -44,7 +45,7 @@ public class SingSongPresenter extends BaseRoomPresenter<SingSongContacts.View>
|
||||
|
||||
@Override
|
||||
public void setMutePit(String roomId, String pitNumber, String is_mute) {
|
||||
api.setMutePit(roomId, pitNumber, is_mute, new BaseObserver<String>() {
|
||||
RetrofitClient.getInstance().setMutePit(roomId, pitNumber, is_mute, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
@@ -62,7 +63,7 @@ public class SingSongPresenter extends BaseRoomPresenter<SingSongContacts.View>
|
||||
|
||||
@Override
|
||||
public void setLockPit(String roomId, String pitNumber, String is_lock) {
|
||||
api.setLockPit(roomId, pitNumber, is_lock, new BaseObserver<String>() {
|
||||
RetrofitClient.getInstance().setLockPit(roomId, pitNumber, is_lock, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
@@ -81,7 +82,7 @@ public class SingSongPresenter extends BaseRoomPresenter<SingSongContacts.View>
|
||||
/// 请求房间信息,当pk同意的时候,获取对方房间信息,同时请求自己房间信息,做页面的更新 添加一type:1:请求对方信息 2:请求自己房间信息 3:是否接受PK
|
||||
@Override
|
||||
public void postRoomInfo(String roomId, String number,int type) {
|
||||
api.postRoomInfo(roomId, new BaseObserver<RoomInfoResp>() {
|
||||
RetrofitClient.getInstance().postRoomInfo(roomId, new BaseObserver<RoomInfoResp>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
@@ -121,7 +122,7 @@ public class SingSongPresenter extends BaseRoomPresenter<SingSongContacts.View>
|
||||
|
||||
@Override
|
||||
public void endPk(String pk_id, String type, String user_id) {
|
||||
api.endPk(pk_id, type, user_id, new BaseObserver<String>() {
|
||||
RetrofitClient.getInstance().endPk(pk_id, type, user_id, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
@@ -139,7 +140,7 @@ public class SingSongPresenter extends BaseRoomPresenter<SingSongContacts.View>
|
||||
|
||||
@Override
|
||||
public void userOnlineStatus(String userId, String roomid) {
|
||||
api.userOnlineStatus(userId, roomid, new BaseObserver<List<UserOnlineStatusBean>>() {
|
||||
RetrofitClient.getInstance().userOnlineStatus(userId, roomid, new BaseObserver<List<UserOnlineStatusBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
@@ -156,7 +157,7 @@ public class SingSongPresenter extends BaseRoomPresenter<SingSongContacts.View>
|
||||
}
|
||||
|
||||
public void postRoomSwToken(String roomId,int uid) {
|
||||
api.postRoomSwToken(roomId, new BaseObserver<PkSwTokenBean>() {
|
||||
RetrofitClient.getInstance().postRoomSwToken(roomId, new BaseObserver<PkSwTokenBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
|
||||
@@ -483,6 +483,43 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.xscm.moduleutil.widget.DropViewRoom
|
||||
android:id="@+id/xlh_rk"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
android:paddingEnd="@dimen/dp_0"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:gravity="center_vertical|center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@color/transparent"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/xlh_im"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@mipmap/xlh_rk_bj"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_djs"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_gravity="center_vertical"
|
||||
tools:text="倒计时:12:12"
|
||||
android:textColor="#FFEBBD"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:visibility="visible"/>
|
||||
|
||||
|
||||
</com.xscm.moduleutil.widget.DropViewRoom>
|
||||
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.floatingView.Floa
|
||||
android:id="@+id/flaoat"
|
||||
|
||||
Reference in New Issue
Block a user