1、修改背景图、应用log

2、修改房间报错
3、添加青少年模式
This commit is contained in:
2025-09-19 17:40:02 +08:00
parent fc544229fe
commit 867435ee90
85 changed files with 662 additions and 163 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

@@ -28,12 +28,18 @@ public class LaunchPageActivity extends BaseAppCompatActivity<ActivityLaunchPage
// if (shouldRestoreRoom()){ // if (shouldRestoreRoom()){
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", CommonAppContext.getInstance().playId).navigation(); // ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", CommonAppContext.getInstance().playId).navigation();
// } // }
if (SpUtil.getUnderagePassword() != null && !SpUtil.getUnderagePassword().isEmpty()) {
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken())
.withString("type","1").navigation();//type==1青少年模式
}
finish(); finish();
return; return;
} }
} }
private boolean shouldRestoreRoom() { private boolean shouldRestoreRoom() {
// 检查是否应该恢复房间: // 检查是否应该恢复房间:
// 1. 应用有正在播放的房间 // 1. 应用有正在播放的房间
@@ -42,6 +48,7 @@ public class LaunchPageActivity extends BaseAppCompatActivity<ActivityLaunchPage
return CommonAppContext.getInstance().isPlaying return CommonAppContext.getInstance().isPlaying
&& CommonAppContext.getInstance().isShow; && CommonAppContext.getInstance().isShow;
} }
@Override @Override
protected void initData() { protected void initData() {
handler = new Handler(); handler = new Handler();
@@ -78,6 +85,7 @@ public class LaunchPageActivity extends BaseAppCompatActivity<ActivityLaunchPage
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
// 如果 PolicyDialog 仍在显示,则 dismiss 它 // 如果 PolicyDialog 仍在显示,则 dismiss 它
@@ -93,6 +101,7 @@ public class LaunchPageActivity extends BaseAppCompatActivity<ActivityLaunchPage
super.onDestroy(); super.onDestroy();
} }
@Override @Override
protected void initView() { protected void initView() {
@@ -110,14 +119,12 @@ public class LaunchPageActivity extends BaseAppCompatActivity<ActivityLaunchPage
} }
@Override @Override
protected int getLayoutId() { protected int getLayoutId() {
return R.layout.activity_launch_page; return R.layout.activity_launch_page;
} }
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

View File

@@ -30,7 +30,7 @@ isBuildModule=false
android.injected.testOnly=false android.injected.testOnly=false
APP_VERSION_NAME=1.0.2 APP_VERSION_NAME=1.0.2
APP_VERSION_CODE=144 APP_VERSION_CODE=146
org.gradle.jvm.toolchain.useLegacyAdapters=false org.gradle.jvm.toolchain.useLegacyAdapters=false
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15 #org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15

View File

@@ -41,7 +41,7 @@
android:layout_width="@dimen/dp_74" android:layout_width="@dimen/dp_74"
android:layout_height="@dimen/dp_74" android:layout_height="@dimen/dp_74"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:src="@mipmap/me_img_upld_head" android:src="@mipmap/user_wait_header"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

View File

@@ -10,7 +10,10 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.webkit.GeolocationPermissions; import android.webkit.GeolocationPermissions;
import android.webkit.JavascriptInterface; import android.webkit.JavascriptInterface;
@@ -21,9 +24,13 @@ import android.webkit.WebView;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route; import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.LogUtils; import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xscm.moduleutil.R; import com.xscm.moduleutil.R;
import com.xscm.moduleutil.base.CommonAppContext; import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.databinding.ActivityWebViewBinding; import com.xscm.moduleutil.databinding.ActivityWebViewBinding;
@@ -46,6 +53,8 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
public String title; public String title;
public String url; public String url;
@Autowired
public String type;//type=1:青少年模式
private ValueCallback<Uri> mUploadMessage; private ValueCallback<Uri> mUploadMessage;
private ValueCallback<Uri[]> mUploadCallbackAboveL; private ValueCallback<Uri[]> mUploadCallbackAboveL;
private final int REQUEST_FILE_PICKER = 1; private final int REQUEST_FILE_PICKER = 1;
@@ -53,6 +62,8 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
@SuppressLint("SetJavaScriptEnabled") @SuppressLint("SetJavaScriptEnabled")
@Override @Override
protected void initData() { protected void initData() {
WebSettings webSettings = mBinding.webView.getSettings(); WebSettings webSettings = mBinding.webView.getSettings();
// 禁用水平滚动 // 禁用水平滚动
@@ -61,7 +72,7 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
webSettings.setJavaScriptEnabled(true); webSettings.setJavaScriptEnabled(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); //关闭webview中缓存 webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); //关闭webview中缓存
//增加JSBridge //增加JSBridge
mBinding.webView.addJavascriptInterface(new WebAppInterface(this), "Android"); mBinding.webView.addJavascriptInterface(new WebAppInterface(this, type), "Android");
if (title != null && !title.isEmpty()) { if (title != null && !title.isEmpty()) {
if (title.contains("协议")) { if (title.contains("协议")) {
@@ -94,7 +105,6 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
mBinding.webView.setScrollContainer(true); mBinding.webView.setScrollContainer(true);
mBinding.webView.setWebViewClient(new WebViewClient()); mBinding.webView.setWebViewClient(new WebViewClient());
mBinding.webView.setBackgroundColor(Color.TRANSPARENT); mBinding.webView.setBackgroundColor(Color.TRANSPARENT);
mBinding.webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); mBinding.webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
@@ -173,6 +183,35 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
}); });
} }
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getOnBackPressedDispatcher() != null) {
getOnBackPressedDispatcher().addCallback(this, new androidx.activity.OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
// 拦截返回键,显示退出对话框而不是直接退出
showExitRoomDialog();
}
});
}
}
private void showExitRoomDialog() {
if (type != null) {
if (type.equals("1")) {
ARouter.getInstance().build(ARouteConstants.UNDERAGE_ACTIVITY).withInt("type", 1).navigation();
} else {
finish();
}
} else {
finish();
}
}
private void showFileChooser() { private void showFileChooser() {
// 这里可以扩展为显示对话框让用户选择“拍照”或“从相册选择” // 这里可以扩展为显示对话框让用户选择“拍照”或“从相册选择”
Intent intent = new Intent(Intent.ACTION_GET_CONTENT); Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
@@ -214,11 +253,73 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
} }
} }
@Override
public void onBackPressed() {
// 当type==1时禁止返回键和手势返回
// 不执行任何操作,禁止返回
if (type != null) {
if (type.equals("1")) {
ARouter.getInstance().build(ARouteConstants.UNDERAGE_ACTIVITY).withInt("type", 1).navigation();
} else {
finish();
}
return;
} else {
finish();
}
// 正常处理返回键
super.onBackPressed();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
LogUtils.d("MainActivity", "onKeyDown called, keyCode: " + keyCode);
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (type != null) {
if (type.equals("1")) {
ARouter.getInstance().build(ARouteConstants.UNDERAGE_ACTIVITY).withInt("type", 1).navigation();
} else {
finish();
}
} else {
finish();
}
return true; // 消费事件
}
return super.onKeyDown(keyCode, event);
}
// @Override
// public boolean dispatchTouchEvent(MotionEvent ev) {
// // 当type==1时禁止手势滑动返回
// if (type.equals("1")) {
// // 检查是否是边缘滑动返回手势
// if (ev.getAction() == MotionEvent.ACTION_DOWN) {
// // 如果触摸点在屏幕边缘,拦截事件
// if (ev.getX() < 50) { // 左边缘50像素内
// return true; // 拦截事件不传递给子View
// }
// }
// }
// return super.dispatchTouchEvent(ev);
// }
@Override @Override
protected void initView() { protected void initView() {
getWindow().getDecorView().setBackgroundResource(com.xscm.moduleutil.R.color.white); getWindow().getDecorView().setBackgroundResource(com.xscm.moduleutil.R.color.white);
title = getIntent().getStringExtra("title"); title = getIntent().getStringExtra("title");
url = getIntent().getStringExtra("url"); url = getIntent().getStringExtra("url");
type = getIntent().getStringExtra("type");
if (type != null) {
// 当type==1时禁用返回手势滑动
if (type.equals("1")) {
// 禁用边缘滑动返回
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
}
}
}
if (title != null) { if (title != null) {
if (title.equals("举报") || title.equals("等级") || title.equals("公会") || title.equals("邀请") || title.equals("反馈")) { if (title.equals("举报") || title.equals("等级") || title.equals("公会") || title.equals("邀请") || title.equals("反馈")) {
mBinding.topBar.setVisibility(GONE); mBinding.topBar.setVisibility(GONE);
@@ -239,8 +340,6 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
} }
} }
} }
@Override @Override
@@ -250,9 +349,11 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
public class WebAppInterface { public class WebAppInterface {
Context mContext; Context mContext;
String type;
WebAppInterface(Context c) { WebAppInterface(Context c, String type1) {
mContext = c; mContext = c;
type = type1;
} }
// 被 H5 调用的方法 // 被 H5 调用的方法
@@ -263,9 +364,16 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
@JavascriptInterface @JavascriptInterface
public void closeWeb() { public void closeWeb() {
LogUtils.e("value: "); if (type != null) {
if (type.equals("1")) {
ARouter.getInstance().build(ARouteConstants.UNDERAGE_ACTIVITY).withInt("type", 1).navigation();
} else {
finish(); finish();
} }
} else {
finish();
}
}
@JavascriptInterface @JavascriptInterface
public void customerService() { public void customerService() {
@@ -283,6 +391,7 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
public void jumpRoomPage(String room_id) { public void jumpRoomPage(String room_id) {
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", room_id).navigation(); ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", room_id).navigation();
} }
@JavascriptInterface @JavascriptInterface
public void jumpWebPage(String objects) { public void jumpWebPage(String objects) {
// ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).navigation(); // ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).navigation();
@@ -304,6 +413,7 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_C2C); intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_C2C);
mContext.startActivity(intent); mContext.startActivity(intent);
} }
@JavascriptInterface @JavascriptInterface
public void exchange() { public void exchange() {
ARouter.getInstance().build(ARouteConstants.CURRENCY).navigation(); ARouter.getInstance().build(ARouteConstants.CURRENCY).navigation();
@@ -333,6 +443,7 @@ public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBindin
// intent.putExtra("menuName", msg); // intent.putExtra("menuName", msg);
// startActivity(intent); // startActivity(intent);
LogUtils.e("closeWeb"); LogUtils.e("closeWeb");
} }
} }

View File

@@ -18,6 +18,7 @@ public class RoomSettingBean implements MultiItemEntity {
public static final int QXRoomSettingTypeRoomTypeGirl = 13; public static final int QXRoomSettingTypeRoomTypeGirl = 13;
///交友 房 ///交友 房
public static final int QXRoomSettingTypeRoomTypeJiaoy = 27; public static final int QXRoomSettingTypeRoomTypeJiaoy = 27;
public static final int QXRoomSettingTypeRoomTypeHUYU = 28;
/// 常用工具 /// 常用工具
/// 房间补贴 /// 房间补贴

View File

@@ -41,7 +41,13 @@ public class YouthModelDialog extends BaseDialog<IndexDialogYouthModelBinding> {
Window window = getWindow(); Window window = getWindow();
window.setLayout((int) (ScreenUtils.getScreenWidth() * 315.f / 375), WindowManager.LayoutParams.WRAP_CONTENT); window.setLayout((int) (ScreenUtils.getScreenWidth() * 315.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
mBinding.ivClose.setOnClickListener(v -> dismiss()); mBinding.ivClose.setOnClickListener(v -> dismiss());
mBinding.tvIKnow.setOnClickListener(v -> dismiss()); mBinding.tvIKnow.setOnClickListener(v -> {
ARouter.getInstance().build(ARouteConstants.UNDERAGE_ACTIVITY).withInt("type", 0).navigation();
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken()).navigation();
// dismiss();
});
mBinding.tvOpen.setOnClickListener(v -> { mBinding.tvOpen.setOnClickListener(v -> {
// if (teenagerInfo.getHad_password() == 1) { // if (teenagerInfo.getHad_password() == 1) {

View File

@@ -25,6 +25,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.xscm.moduleutil.R; import com.xscm.moduleutil.R;
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.MqttXlhEnd;
import com.xscm.moduleutil.bean.RoomMessageEvent; 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;
@@ -36,6 +37,7 @@ import com.xscm.moduleutil.event.LotteryEvent;
import com.xscm.moduleutil.utils.ARouteConstants; 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 com.xscm.moduleutil.widget.floatingView.IFloatingView;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
@@ -131,7 +133,9 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
userIdType = LotteryEvent.fromLotteryEvent(giftBagId); userIdType = LotteryEvent.fromLotteryEvent(giftBagId);
heart_id=getArguments().getString("heart_id"); heart_id=getArguments().getString("heart_id");
if (!EventBus.getDefault().isRegistered( this)){
EventBus.getDefault().register(this);
}
} }
@Override @Override
@@ -567,7 +571,14 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
mBinding.pinnacleTime.llHundred.setBackground(getResources().getDrawable(R.mipmap.chou_w)); mBinding.pinnacleTime.llHundred.setBackground(getResources().getDrawable(R.mipmap.chou_w));
} }
} }
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageReceived(MqttXlhEnd event) {
BlindBoxBean.XlhData xlhData =new BlindBoxBean.XlhData();
xlhData.setCurrent_num(0);
xlhData.setCurrent_num(0);
xlhData.setStatus(0);
UpView(xlhData);
}
/// 定时器 /// 定时器
public void startFastAnimate() { public void startFastAnimate() {
if (allViewsArray.isEmpty()) { if (allViewsArray.isEmpty()) {
@@ -1016,6 +1027,11 @@ 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();
} }

View File

@@ -296,7 +296,7 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
private void upTitle(int boxPrice) { private void upTitle(int boxPrice) {
mBinding.tvOne.setText(boxPrice + "币一次"); mBinding.tvOne.setText(boxPrice + "币一次");
mBinding.tvTen.setText((boxPrice * 10) + "币十次"); mBinding.tvTen.setText((boxPrice * 10) + "币十次");
mBinding.tvHundred.setText((boxPrice * 20) + "二十"); mBinding.tvHundred.setText((boxPrice * 100) + "");
} }
// TODO: 2025/8/29 接收im推送过来的消息 // TODO: 2025/8/29 接收im推送过来的消息

View File

@@ -1471,6 +1471,10 @@ public class AgoraManager {
} }
} }
public void setmSongCode(long songCode) {
mSongCode = songCode;
}
public void loadLrc(long songCode) { public void loadLrc(long songCode) {
mSongCode = songCode; mSongCode = songCode;
if (musicContentCenter != null) { if (musicContentCenter != null) {

View File

@@ -9,6 +9,7 @@ public class ARouteConstants {
public static final String USER_ALBUM_DETAIL = "/modulevocal/AlbumDetailActivity"; public static final String USER_ALBUM_DETAIL = "/modulevocal/AlbumDetailActivity";
public static final String CREATE_ALBUM = "/modulevocal/CreateAlbumActivity"; public static final String CREATE_ALBUM = "/modulevocal/CreateAlbumActivity";
public static final String ROOM_DETAILS = "/moduleroom/RoomActivity"; public static final String ROOM_DETAILS = "/moduleroom/RoomActivity";
public static final String UNDERAGE_ACTIVITY = "/modulevocal/UnderageActivity";
public static final String MY_ROOM = "/modulevocal/MyRoomActivity"; public static final String MY_ROOM = "/modulevocal/MyRoomActivity";
public static final String MY_ROOM_DETAILS = "/modulevocal/RoomDetailsActivity"; public static final String MY_ROOM_DETAILS = "/modulevocal/RoomDetailsActivity";

View File

@@ -123,6 +123,8 @@ public class SpUtil {
} }
/** /**
* 保存一个布尔值 * 保存一个布尔值
*/ */
@@ -251,6 +253,14 @@ public class SpUtil {
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put("musicVolume", musicVolume, true); SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put("musicVolume", musicVolume, true);
} }
public static void setUnderagePassword(String password){
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put("underagePassword", password, true);
}
public static String getUnderagePassword(){
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getString("underagePassword");
}
public static Integer getMusicVolume() { public static Integer getMusicVolume() {
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt("musicVolume", 50); return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt("musicVolume", 50);
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

View File

@@ -66,7 +66,8 @@
android:textSize="14sp" android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_content" /> app:layout_constraintTop_toBottomOf="@+id/tv_content"
android:visibility="invisible"/>
<TextView <TextView
android:id="@+id/tv_i_know" android:id="@+id/tv_i_know"
@@ -75,7 +76,7 @@
android:layout_marginTop="@dimen/dp_20" android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/cs" android:background="@drawable/cs"
android:gravity="center" android:gravity="center"
android:text="我知道了" android:text="开启青少年模式"
android:textColor="@color/color_FF333333" android:textColor="@color/color_FF333333"
android:textSize="@dimen/sp_16" android:textSize="@dimen/sp_16"
android:textStyle="bold" android:textStyle="bold"

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 828 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -128,10 +128,11 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
// 延迟2秒重置标记 // 延迟2秒重置标记
mHandler.postDelayed(() -> isExit = false, 2000); mHandler.postDelayed(() -> isExit = false, 2000);
} else { } else {
exitApp();
// 退出应用 // 退出应用
finish(); // finishAll();
android.os.Process.killProcess(android.os.Process.myPid()); // android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0); // System.exit(0);
} }
} }
}); });
@@ -224,14 +225,39 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
mHandler.postDelayed(() -> isExit = false, 2000); mHandler.postDelayed(() -> isExit = false, 2000);
} else { } else {
// 退出应用 // 退出应用
finish(); exitApp();
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
} }
return true; // 消费事件 return true; // 消费事件
} }
return super.onKeyDown(keyCode, event); return super.onKeyDown(keyCode, event);
} }
/**
* 优雅地退出应用,避免闪屏
*/
private void exitApp() {
// 清理资源
if (appUpdateDialog != null && appUpdateDialog.isShowing()) {
appUpdateDialog.dismiss();
appUpdateDialog = null;
}
// 移除所有回调
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
}
// 关闭所有Activity
finishAffinity();
// 延迟杀死进程,确保界面完全关闭
new Handler().postDelayed(() -> {
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
}, 100);
}
@Override @Override
protected void initView() { protected void initView() {
super.initView(); super.initView();

View File

@@ -558,6 +558,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
// EMqttService.cleanSubscribeRoom(roomId); // EMqttService.cleanSubscribeRoom(roomId);
CommonAppContext.getInstance().isPlaying = false; CommonAppContext.getInstance().isPlaying = false;
CommonAppContext.getInstance().isShow = false; CommonAppContext.getInstance().isShow = false;
QXGiftPlayerManager.getInstance(getApplicationContext()).destroyEffectSvga();
cleanupResources(); cleanupResources();
// MvpPre.quitRoom(roomId, SpUtil.getUserId() + ""); // MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
} }
@@ -1172,7 +1173,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
roomFragment.handleMsgType1028(messageEvent); roomFragment.handleMsgType1028(messageEvent);
} else if (msgType == 1059 || msgType == 1058) {// 1059清除个人魅力 1058在离线 } else if (msgType == 1059 || msgType == 1058) {// 1059清除个人魅力 1058在离线
if (mRoomInfoResp != null && mRoomInfoResp.getRoom_info() != null) { 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")) { 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")) {
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1")) { if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1")) {
roomFragment.SingSongEvent(messageEvent); roomFragment.SingSongEvent(messageEvent);
} else { } else {
@@ -1325,7 +1327,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
if ("2".equals(typeId)) { if ("2".equals(typeId)) {
roomFragment.upRoomInfoData(mRoomInfoResp); roomFragment.upRoomInfoData(mRoomInfoResp);
roomFragment.handleAuctionMessageEvent(messageEvent); roomFragment.handleAuctionMessageEvent(messageEvent);
} else if ("3".equals(typeId) || "4".equals(typeId) || "1".equals(typeId)) { } else if ("3".equals(typeId) || "4".equals(typeId) || "1".equals(typeId) || "8".equals(typeId)) {
String labelId = mRoomInfoResp.getRoom_info().getLabel_id(); String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
if ("2".equals(labelId)) { if ("2".equals(labelId)) {
roomFragment.KtvFragmentEvent(messageEvent); roomFragment.KtvFragmentEvent(messageEvent);
@@ -1374,7 +1376,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
if ("2".equals(typeId)) { if ("2".equals(typeId)) {
roomFragment.handleAuctionMessageEvent(messageEvent); roomFragment.handleAuctionMessageEvent(messageEvent);
return; return;
} else if ("1".equals(typeId) || "4".equals(typeId) || "3".equals(typeId)) { } else if ("1".equals(typeId) || "4".equals(typeId) || "3".equals(typeId) || "8".equals(typeId)) {
String labelId = mRoomInfoResp.getRoom_info().getLabel_id(); String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
if ("2".equals(labelId)) { if ("2".equals(labelId)) {
roomFragment.KtvFragmentEvent(messageEvent); roomFragment.KtvFragmentEvent(messageEvent);
@@ -1437,7 +1439,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
AgoraManager.getInstance(RoomActivity.this).desMusic(); AgoraManager.getInstance(RoomActivity.this).desMusic();
// stub.setVisibility(View.GONE); // stub.setVisibility(View.GONE);
if ((mRoomInfoResp.getRoom_info().getType_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("4") || mRoomInfoResp.getRoom_info().getType_id().equals("3")) && if ((mRoomInfoResp.getRoom_info().getType_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("4") ||
mRoomInfoResp.getRoom_info().getType_id().equals("3") || mRoomInfoResp.getRoom_info().getType_id().equals("8")) &&
mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) { mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) {
for (RoomPitBean roomPitBean : mRoomInfoResp.getSong_pit_list()) { for (RoomPitBean roomPitBean : mRoomInfoResp.getSong_pit_list()) {
AgoraManager.getInstance(RoomActivity.this).ClientRole(false); AgoraManager.getInstance(RoomActivity.this).ClientRole(false);
@@ -1506,7 +1509,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
} }
roomFragment.upRoomInfoData(mRoomInfoResp); roomFragment.upRoomInfoData(mRoomInfoResp);
roomFragment.handleAuctionMessageEvent(messageEvent); roomFragment.handleAuctionMessageEvent(messageEvent);
} else if ("3".equals(typeId) || "4".equals(typeId) || "1".equals(typeId)) { } else if ("3".equals(typeId) || "4".equals(typeId) || "1".equals(typeId) || "8".equals(typeId)) {
String labelId = mRoomInfoResp.getRoom_info().getLabel_id(); String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
if ("2".equals(labelId)) { if ("2".equals(labelId)) {
roomFragment.KtvFragmentEvent(messageEvent); roomFragment.KtvFragmentEvent(messageEvent);
@@ -1583,7 +1586,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
} }
roomFragment.upRoomInfoData(mRoomInfoResp); roomFragment.upRoomInfoData(mRoomInfoResp);
roomFragment.handleAuctionMessageEvent(messageEvent); roomFragment.handleAuctionMessageEvent(messageEvent);
} else if ("3".equals(typeId) || "4".equals(typeId) || "1".equals(typeId)) { } else if ("3".equals(typeId) || "4".equals(typeId) || "1".equals(typeId) || "8".equals(typeId)) {
String labelId = mRoomInfoResp.getRoom_info().getLabel_id(); String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
if ("2".equals(labelId)) { if ("2".equals(labelId)) {
roomFragment.KtvFragmentEvent(messageEvent); roomFragment.KtvFragmentEvent(messageEvent);
@@ -1702,7 +1705,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
String typeId = mRoomInfoResp.getRoom_info().getType_id(); String typeId = mRoomInfoResp.getRoom_info().getType_id();
if ("2".equals(typeId)) { if ("2".equals(typeId)) {
roomFragment.handleAuctionMessageEvent(messageEvent); roomFragment.handleAuctionMessageEvent(messageEvent);
} else if ("1".equals(typeId) || "4".equals(typeId) || "3".equals(typeId)) { } else if ("1".equals(typeId) || "4".equals(typeId) || "3".equals(typeId) || "8".equals(typeId)) {
String labelId = mRoomInfoResp.getRoom_info().getLabel_id(); String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
if ("2".equals(labelId)) { if ("2".equals(labelId)) {
roomFragment.KtvFragmentEvent(messageEvent); roomFragment.KtvFragmentEvent(messageEvent);
@@ -1853,7 +1856,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
String typeId = mRoomInfoResp.getRoom_info().getType_id(); String typeId = mRoomInfoResp.getRoom_info().getType_id();
if ("2".equals(typeId)) { if ("2".equals(typeId)) {
roomFragment.handleAuctionMessageEvent(messageEvent); roomFragment.handleAuctionMessageEvent(messageEvent);
} else if ("1".equals(typeId) || "3".equals(typeId) || "4".equals(typeId)) { } else if ("1".equals(typeId) || "3".equals(typeId) || "4".equals(typeId) || "8".equals(typeId)) {
String labelId = mRoomInfoResp.getRoom_info().getLabel_id(); String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
if ("2".equals(labelId)) { if ("2".equals(labelId)) {
roomFragment.KtvFragmentEvent(messageEvent); roomFragment.KtvFragmentEvent(messageEvent);
@@ -2276,8 +2279,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
// 停止屏幕捕获和其他资源 // 停止屏幕捕获和其他资源
// AgoraManager.getInstance(this).stopScreenCapture(); // AgoraManager.getInstance(this).stopScreenCapture();
AgoraManager.getInstance(this).leaveRoom(); AgoraManager.getInstance(this).leaveRoom();
AgoraManager.getInstance(this).stopMusicPlayer(); // AgoraManager.getInstance(this).stopMusicPlayer();
// AgoraManager.getInstance(this).cleanup(); AgoraManager.getInstance(this).cleanup();
MyRoomSingleton.getInstance().onExitRoom(); MyRoomSingleton.getInstance().onExitRoom();
MessageListenerSingleton.quitGroup(roomId); MessageListenerSingleton.quitGroup(roomId);
@@ -2332,8 +2335,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
// 停止屏幕捕获和其他资源 // 停止屏幕捕获和其他资源
// AgoraManager.getInstance(this).stopScreenCapture(); // AgoraManager.getInstance(this).stopScreenCapture();
AgoraManager.getInstance(this).leaveRoom(); AgoraManager.getInstance(this).leaveRoom();
AgoraManager.getInstance(this).stopMusicPlayer(); // AgoraManager.getInstance(this).stopMusicPlayer();
// AgoraManager.getInstance(this).cleanup(); AgoraManager.getInstance(this).cleanup();
MyRoomSingleton.getInstance().onExitRoom(); MyRoomSingleton.getInstance().onExitRoom();
MessageListenerSingleton.quitGroup(roomId); MessageListenerSingleton.quitGroup(roomId);
@@ -2524,7 +2527,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
// label_id 和 type_id 联合判断 // label_id 和 type_id 联合判断
if (Arrays.asList("1", "3", "4").contains(typeId) && "2".equals(labelId)) { if (Arrays.asList("1", "3", "4","8").contains(typeId) && "2".equals(labelId)) {
rl_more.setVisibility(View.GONE); rl_more.setVisibility(View.GONE);
} }
@@ -3100,7 +3103,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
if (mRoomInfoResp != null && mRoomInfoResp.getRoom_info() != null) { if (mRoomInfoResp != null && mRoomInfoResp.getRoom_info() != null) {
if (mRoomInfoResp.getRoom_info().getType_id().equals("1") if (mRoomInfoResp.getRoom_info().getType_id().equals("1")
|| mRoomInfoResp.getRoom_info().getType_id().equals("3") || || mRoomInfoResp.getRoom_info().getType_id().equals("3") ||
mRoomInfoResp.getRoom_info().getType_id().equals("4")) { mRoomInfoResp.getRoom_info().getType_id().equals("4")||
mRoomInfoResp.getRoom_info().getType_id().equals("8")) {
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) { if (mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) {
} else { } else {
@@ -3339,7 +3343,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("2") || mRoomInfoResp.getRoom_info().getType_id().equals("7")) { if (mRoomInfoResp.getRoom_info().getLabel_id().equals("2") || mRoomInfoResp.getRoom_info().getType_id().equals("7")) {
mBinding.rlMore.setVisibility(GONE); mBinding.rlMore.setVisibility(GONE);
// mBinding.rlMisc.setVisibility(GONE); // mBinding.rlMisc.setVisibility(GONE);
} else if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("3") || mRoomInfoResp.getRoom_info().getType_id().equals("4")) { } else if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("3") || mRoomInfoResp.getRoom_info().getType_id().equals("4") ||
mRoomInfoResp.getRoom_info().getType_id().equals("8")) {
mBinding.rlMore.setVisibility(GONE); mBinding.rlMore.setVisibility(GONE);
mBinding.rlMisc.setVisibility(VISIBLE); mBinding.rlMisc.setVisibility(VISIBLE);
} }
@@ -3352,7 +3357,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
public void upHeight() { public void upHeight() {
if (mRoomInfoResp.getRoom_info().getType_id().equals("1")) { 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")) {
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1")) { if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1")) {
maxHeightDp = 333; maxHeightDp = 333;
} else { } else {
@@ -3397,7 +3403,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
setvisibTop(true); setvisibTop(true);
roomFragment.refreshData(mRoomInfoResp, QXRoomSeatViewType.AUCTION); roomFragment.refreshData(mRoomInfoResp, QXRoomSeatViewType.AUCTION);
} else if ("1".equals(typeId) || "3".equals(typeId) || "4".equals(typeId)) { } else if ("1".equals(typeId) || "3".equals(typeId) || "4".equals(typeId) || "8".equals(typeId)) {
if ("2".equals(labelId)) { if ("2".equals(labelId)) {
changeBackgroundColor(mRoomInfoResp.getRoom_info().getRoom_background()); changeBackgroundColor(mRoomInfoResp.getRoom_info().getRoom_background());
setvisibTop(true); setvisibTop(true);

View File

@@ -53,6 +53,8 @@ public class RoomSettingAdapter extends BaseMultiItemQuickAdapter<RoomSettingBea
return com.xscm.moduleutil.R.mipmap.ic_girl; return com.xscm.moduleutil.R.mipmap.ic_girl;
case RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy: case RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy:
return com.xscm.moduleutil.R.mipmap.ic_jiaoy; return com.xscm.moduleutil.R.mipmap.ic_jiaoy;
case RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU:
return com.xscm.moduleutil.R.mipmap.huyu;
// 常用工具 // 常用工具
case RoomSettingBean.QXRoomSettingTypeRoomSubsidy: case RoomSettingBean.QXRoomSettingTypeRoomSubsidy:
return com.xscm.moduleutil.R.mipmap.ic_subsidy; return com.xscm.moduleutil.R.mipmap.ic_subsidy;

View File

@@ -139,9 +139,11 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
dataList.add(new RoomSettingBean("房间类型", null, null, null, -1, read, isSelected, false, false)); dataList.add(new RoomSettingBean("房间类型", null, null, null, -1, read, isSelected, false, false));
dataList.add(new RoomSettingBean("点唱", "ic_sing", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSing, read, isSelected, false, false)); dataList.add(new RoomSettingBean("点唱", "ic_sing", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeSing, read, isSelected, false, false));
dataList.add(new RoomSettingBean("拍卖", "ic_auction", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeAuction, read, isSelected, false, false)); dataList.add(new RoomSettingBean("拍卖", "ic_auction", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeAuction, read, isSelected, false, false));
dataList.add(new RoomSettingBean("男神", "ic_boy", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeBoy, read, isSelected, false, false)); // dataList.add(new RoomSettingBean("男神", "ic_boy", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeBoy, read, isSelected, false, false));
dataList.add(new RoomSettingBean("女神", "ic_girl", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeGirl, read, isSelected, false, false)); // dataList.add(new RoomSettingBean("女神", "ic_girl", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeGirl, read, isSelected, false, false));
dataList.add(new RoomSettingBean(" 交友", "ic_jiaoy", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy, read, isSelected, false, false)); dataList.add(new RoomSettingBean(" 交友", "jiao_y", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU, read, isSelected, false, false));// 添加的新的房间类型 ,交友 ,是原来的男神女神类型
dataList.add(new RoomSettingBean(" 互娱", "ic_jiaoy", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy, read, isSelected, false, false)); //原交友,更改互娱 2025年9月19日11:18:01
dataList.add(new RoomSettingBean("常用工具", null, null, null, -1, read, isSelected, false, false)); dataList.add(new RoomSettingBean("常用工具", null, null, null, -1, read, isSelected, false, false));
dataList.add(new RoomSettingBean("房间补贴", "ic_subsidy", null, null, RoomSettingBean.QXRoomSettingTypeRoomSubsidy, read, isSelected, false, false)); dataList.add(new RoomSettingBean("房间补贴", "ic_subsidy", null, null, RoomSettingBean.QXRoomSettingTypeRoomSubsidy, read, isSelected, false, false));
@@ -259,15 +261,20 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction) { } else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction) {
// MvpPre.changeRoomType(roomId, "2"); // MvpPre.changeRoomType(roomId, "2");
queren("2"); queren("2");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy) { }
// MvpPre.changeRoomType(roomId, "3"); // else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy) {
queren("3"); //// MvpPre.changeRoomType(roomId, "3");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl) { // queren("3");
// MvpPre.changeRoomType(roomId, "4"); // }
queren("4"); // else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl) {
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy) { //// MvpPre.changeRoomType(roomId, "4");
// queren("4");
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy) {
// MvpPre.changeRoomType(roomId, "7"); // MvpPre.changeRoomType(roomId, "7");
queren("7"); queren("7");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU) {
queren("8");
} 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) {
@@ -286,7 +293,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
// 创建并显示确认对话框 // 创建并显示确认对话框
new ConfirmDialog(getActivity(), new ConfirmDialog(getActivity(),
"提示", "提示",
"即将修改房间类型为" + (type.equals("1") ? "点唱" : (type.equals("2") ? "拍卖" : (type.equals("3") ? "男神" : (type.equals("4") ? "女神" : (type.equals("7") ? "交友" : ""))))), "即将修改房间类型为" + (type.equals("1") ? "点唱" : (type.equals("2") ? "拍卖" : (type.equals("3") ? "男神" : (type.equals("4") ? "女神" : (type.equals("7") ? "互娱" : (type.equals("8") ? "交友" : "")))))),
"确认", "确认",
"取消", "取消",
v -> { v -> {
@@ -307,7 +314,8 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
int roleLevel = bean.getRead(); // 角色等级 int roleLevel = bean.getRead(); // 角色等级
boolean onMic = false; // 是否是特定房间 boolean onMic = false; // 是否是特定房间
if (roomInfoResp.getRoom_info().getType_id().equals("1") && roomInfoResp.getRoom_info().getLabel_id().equals("2")) { if ((roomInfoResp.getRoom_info().getType_id().equals("1") || roomInfoResp.getRoom_info().getType_id().equals("3")
|| roomInfoResp.getRoom_info().getType_id().equals("4") || roomInfoResp.getRoom_info().getType_id().equals("8")) && roomInfoResp.getRoom_info().getLabel_id().equals("2")) {
onMic = true; onMic = true;
} }
@@ -319,9 +327,9 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
} }
} }
return true; return true;
} else if (roleLevel == 2 || roleLevel == 3) { } else if (roleLevel == 2 || roleLevel == 3) { // type == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy || type == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl || 2025年9月19日11:21:04将男神女神合并成互娱最总是新添加一个标签
if (type == RoomSettingBean.QXRoomSettingTypeRoomTypeSing || type == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction || if (type == RoomSettingBean.QXRoomSettingTypeRoomTypeSing || type == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeBoy || type == RoomSettingBean.QXRoomSettingTypeRoomTypeGirl || type == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy || type == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy ||
type == RoomSettingBean.QXRoomSettingTypeRoomClearMessage || type == QXRoomSettingTypeRoomOrderMic type == RoomSettingBean.QXRoomSettingTypeRoomClearMessage || type == QXRoomSettingTypeRoomOrderMic
|| type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomBgImage || type == -1) { || type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomBgImage || type == -1) {

View File

@@ -226,10 +226,23 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
private void createKtvFragment() { private void createKtvFragment() {
if (ktvFragment == null) { if (ktvFragment == null) {
ktvFragment = RoomKtvFragment.newInstance(); ktvFragment = RoomKtvFragment.newInstance();
// 确保 Fragment 已添加且处于活跃状态再进行操作
if (isAdded() && getActivity() != null) {
getChildFragmentManager() getChildFragmentManager()
.beginTransaction() .beginTransaction()
.replace(R.id.container, ktvFragment) .replace(R.id.container, ktvFragment)
.commitAllowingStateLoss(); .commitAllowingStateLoss();
} else if (getView() != null) {
// 延迟执行直到 Fragment 处于合适状态
getView().post(() -> {
if (isAdded() && getActivity() != null) {
getChildFragmentManager()
.beginTransaction()
.replace(R.id.container, ktvFragment)
.commitAllowingStateLoss();
}
});
}
} }
} }
@@ -243,10 +256,23 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
private void createRoomAuctionFragment() { private void createRoomAuctionFragment() {
if (roomAuctionFragment == null) { if (roomAuctionFragment == null) {
roomAuctionFragment = RoomAuctionFragment.newInstance(); roomAuctionFragment = RoomAuctionFragment.newInstance();
// 确保 Fragment 已添加且处于活跃状态再进行操作
if (isAdded() && getActivity() != null) {
getChildFragmentManager() getChildFragmentManager()
.beginTransaction() .beginTransaction()
.replace(R.id.container, roomAuctionFragment) .replace(R.id.container, roomAuctionFragment)
.commitAllowingStateLoss(); .commitAllowingStateLoss();
} else if (getView() != null) {
// 延迟执行直到 Fragment 处于合适状态
getView().post(() -> {
if (isAdded() && getActivity() != null) {
getChildFragmentManager()
.beginTransaction()
.replace(R.id.container, roomAuctionFragment)
.commitAllowingStateLoss();
}
});
}
} }
} }
@@ -260,11 +286,23 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
private void createFriendshipRoomFragment() { private void createFriendshipRoomFragment() {
if (friendshipRoomFragment == null) { if (friendshipRoomFragment == null) {
friendshipRoomFragment = FriendshipRoomFragment.newInstance(); friendshipRoomFragment = FriendshipRoomFragment.newInstance();
// replaceNestedFragment(friendshipRoomFragment, R.id.container); // 确保 Fragment 已添加且处于活跃状态再进行操作
if (isAdded() && getActivity() != null) {
getChildFragmentManager() getChildFragmentManager()
.beginTransaction() .beginTransaction()
.replace(R.id.container, friendshipRoomFragment) .replace(R.id.container, friendshipRoomFragment)
.commitAllowingStateLoss(); .commitAllowingStateLoss();
} else if (getView() != null) {
// 延迟执行直到 Fragment 处于合适状态
getView().post(() -> {
if (isAdded() && getActivity() != null) {
getChildFragmentManager()
.beginTransaction()
.replace(R.id.container, friendshipRoomFragment)
.commitAllowingStateLoss();
}
});
}
} }
} }
@@ -278,11 +316,23 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
private void createRoomCabinFragment() { private void createRoomCabinFragment() {
if (roomCabinFragment == null) { if (roomCabinFragment == null) {
roomCabinFragment = RoomCabinFragment.newInstance(); roomCabinFragment = RoomCabinFragment.newInstance();
// replaceNestedFragment(roomCabinFragment, R.id.container); // 确保 Fragment 已添加且处于活跃状态再进行操作
if (isAdded() && getActivity() != null) {
getChildFragmentManager() getChildFragmentManager()
.beginTransaction() .beginTransaction()
.replace(R.id.container, roomCabinFragment) .replace(R.id.container, roomCabinFragment)
.commitAllowingStateLoss(); .commitAllowingStateLoss();
} else if (getView() != null) {
// 延迟执行直到 Fragment 处于合适状态
getView().post(() -> {
if (isAdded() && getActivity() != null) {
getChildFragmentManager()
.beginTransaction()
.replace(R.id.container, roomCabinFragment)
.commitAllowingStateLoss();
}
});
}
} }
} }
@@ -473,7 +523,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
if (auctionRoomFragment != null && auctionRoomFragment.isAdded()) { if (auctionRoomFragment != null && auctionRoomFragment.isAdded()) {
auctionRoomFragment.roomInfoUpdate(mRoomInfoResp); auctionRoomFragment.roomInfoUpdate(mRoomInfoResp);
} }
} else if ("1".equals(typeId) || "3".equals(typeId) || "4".equals(typeId)) { } else if ("1".equals(typeId) || "3".equals(typeId) || "4".equals(typeId) || "8".equals(typeId)) {
if ("2".equals(labelId)) { if ("2".equals(labelId)) {
RoomKtvFragment roomKtvFragment = findFragmentByTag(RoomKtvFragment.class); RoomKtvFragment roomKtvFragment = findFragmentByTag(RoomKtvFragment.class);
if (roomKtvFragment != null && roomKtvFragment.isAdded()) { if (roomKtvFragment != null && roomKtvFragment.isAdded()) {
@@ -557,46 +607,111 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
private void loadSubFragment(QXRoomSeatViewType qxRoomSeatViewType) { private void loadSubFragment(QXRoomSeatViewType qxRoomSeatViewType) {
this.qxRoomSeatViewType = qxRoomSeatViewType; this.qxRoomSeatViewType = qxRoomSeatViewType;
// switch (qxRoomSeatViewType) {
// 检查Fragment是否已经附加到Activity
if (!isAdded() || getActivity() == null) {
// 如果Fragment还没有附加则延迟执行
if (getView() != null) {
getView().post(() -> {
if (isAdded() && getActivity() != null) {
performLoadSubFragment(qxRoomSeatViewType);
}
});
}
return;
}
performLoadSubFragment(qxRoomSeatViewType);
// if (mRoomInfoResp == null || mRoomInfoResp.getRoom_info() == null) return;
// String typeId = mRoomInfoResp.getRoom_info().getType_id();
// String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
// //
// case KTV: // Fragment newFragment = null;
// if (ktvFragment != null && ktvFragment.isAdded()) { //
// ktvFragment.roomInfoUpdate(mRoomInfoResp); // if ("1".equals(typeId)) {
// if ("1".equals(labelId)) {
// singSongFragment = SingSongFragment.newInstance();
// newFragment = singSongFragment;
// } else if ("2".equals(labelId)) {
// ktvFragment = RoomKtvFragment.newInstance();
// newFragment = ktvFragment;
// }
// } else if ("2".equals(typeId)) {
// roomAuctionFragment = RoomAuctionFragment.newInstance();
// newFragment = roomAuctionFragment;
// } else if ("6".equals(typeId)) {
// roomCabinFragment = RoomCabinFragment.newInstance();
// newFragment = roomCabinFragment;
// setviewyc();
// } else if ("3".equals(typeId)) {
// if ("1".equals(labelId)) {
// singSongFragment = SingSongFragment.newInstance();
// newFragment = singSongFragment;
// } else if ("2".equals(labelId)) {
// ktvFragment = RoomKtvFragment.newInstance();
// newFragment = ktvFragment;
// }
// } else if ("4".equals(typeId)) {
// if ("1".equals(labelId)) {
// singSongFragment = SingSongFragment.newInstance();
// newFragment = singSongFragment;
// } else if ("2".equals(labelId)) {
// ktvFragment = RoomKtvFragment.newInstance();
// newFragment = ktvFragment;
// }
// } else if ("7".equals(typeId)) {
// friendshipRoomFragment = FriendshipRoomFragment.newInstance();
// newFragment = friendshipRoomFragment;
// }else if ("8".equals(typeId)){
// if ("1".equals(labelId)) {
// singSongFragment = SingSongFragment.newInstance();
// newFragment = singSongFragment;
// } else if ("2".equals(labelId)) {
// ktvFragment = RoomKtvFragment.newInstance();
// newFragment = ktvFragment;
// }
// }
//
// if (newFragment != null) {
// replaceNestedFragment(newFragment, R.id.container);
// }
//
// setview();
//
// if (mRoomInfoResp.getUser_info().getPit_number() != 0) {
// AgoraManager.getInstance(getActivity()).muteLocalAudioStream(false);
// ((RoomActivity) getActivity()).switchMic(2);
// } else { // } else {
// setqxRoomSeatViewType(qxRoomSeatViewType); // AgoraManager.getInstance(getActivity()).muteLocalAudioStream(true);
// }
// break;
// case AUCTION:
// if (roomAuctionFragment != null && roomAuctionFragment.isAdded()) {
// roomAuctionFragment.roomInfoUpdate(mRoomInfoResp);
// }else {
// setqxRoomSeatViewType(qxRoomSeatViewType);
// }
// break;
// case CABIN:
// if (roomCabinFragment != null && roomCabinFragment.isAdded()) {
// roomCabinFragment.roomInfoUpdate(mRoomInfoResp);
// }else {
// setqxRoomSeatViewType(qxRoomSeatViewType);
// }
// break;
// case FRIEND:
// if (friendshipRoomFragment != null && friendshipRoomFragment.isAdded()) {
// friendshipRoomFragment.roomInfoUpdate(mRoomInfoResp);
// }else {
// setqxRoomSeatViewType(qxRoomSeatViewType);
// }
// break;
// case NORMAL:
// if (singSongFragment != null && singSongFragment.isAdded()) {
// singSongFragment.roomInfoUpdate(mRoomInfoResp);
// }else {
// setqxRoomSeatViewType(qxRoomSeatViewType);
// }
// break;
// default:
// break;
// } // }
// // 延迟执行更新,确保 Fragment 已经添加完成
//// if (getActivity() != null && isAdded()) {
//// getView().post(() -> updateChildFragmentViews());
//// }
//
//// if (getActivity() instanceof RoomActivity) {
//// if (mRoomInfoResp.getRoom_info().getType_id().equals("6")) {
//// ((RoomActivity) getActivity()).changeBackground(com.xscm.moduleutil.R.mipmap.cabin_bj);
//// ((RoomActivity) getActivity()).setvisibTop(false);
//// } else if (mRoomInfoResp.getRoom_info().getType_id().equals("7")) {
//// if (mRoomInfoResp.getRoom_info().getRoom_background() == null || mRoomInfoResp.getRoom_info().getRoom_background().equals("")) {
//// ((RoomActivity) getActivity()).changeBackground(com.xscm.moduleutil.R.mipmap.jiaoy_bj);
//// } else {
//// ((RoomActivity) getActivity()).changeBackgroundColor(mRoomInfoResp.getRoom_info().getRoom_background());
//// }
//// ((RoomActivity) getActivity()).setvisibTop(true);
//// } else {
//// ((RoomActivity) getActivity()).changeBackgroundColor(mRoomInfoResp.getRoom_info().getRoom_background());
//// ((RoomActivity) getActivity()).setvisibTop(true);
//// }
//// }
//
// updateChildFragmentViews();
}
private void performLoadSubFragment(QXRoomSeatViewType qxRoomSeatViewType) {
this.qxRoomSeatViewType = qxRoomSeatViewType;
if (mRoomInfoResp == null || mRoomInfoResp.getRoom_info() == null) return; if (mRoomInfoResp == null || mRoomInfoResp.getRoom_info() == null) return;
String typeId = mRoomInfoResp.getRoom_info().getType_id(); String typeId = mRoomInfoResp.getRoom_info().getType_id();
String labelId = mRoomInfoResp.getRoom_info().getLabel_id(); String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
@@ -637,6 +752,14 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
} else if ("7".equals(typeId)) { } else if ("7".equals(typeId)) {
friendshipRoomFragment = FriendshipRoomFragment.newInstance(); friendshipRoomFragment = FriendshipRoomFragment.newInstance();
newFragment = friendshipRoomFragment; newFragment = friendshipRoomFragment;
}else if ("8".equals(typeId)){
if ("1".equals(labelId)) {
singSongFragment = SingSongFragment.newInstance();
newFragment = singSongFragment;
} else if ("2".equals(labelId)) {
ktvFragment = RoomKtvFragment.newInstance();
newFragment = ktvFragment;
}
} }
if (newFragment != null) { if (newFragment != null) {
@@ -651,31 +774,9 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
} else { } else {
AgoraManager.getInstance(getActivity()).muteLocalAudioStream(true); AgoraManager.getInstance(getActivity()).muteLocalAudioStream(true);
} }
// 延迟执行更新,确保 Fragment 已经添加完成
// if (getActivity() != null && isAdded()) {
// getView().post(() -> updateChildFragmentViews());
// }
// if (getActivity() instanceof RoomActivity) {
// if (mRoomInfoResp.getRoom_info().getType_id().equals("6")) {
// ((RoomActivity) getActivity()).changeBackground(com.xscm.moduleutil.R.mipmap.cabin_bj);
// ((RoomActivity) getActivity()).setvisibTop(false);
// } else if (mRoomInfoResp.getRoom_info().getType_id().equals("7")) {
// if (mRoomInfoResp.getRoom_info().getRoom_background() == null || mRoomInfoResp.getRoom_info().getRoom_background().equals("")) {
// ((RoomActivity) getActivity()).changeBackground(com.xscm.moduleutil.R.mipmap.jiaoy_bj);
// } else {
// ((RoomActivity) getActivity()).changeBackgroundColor(mRoomInfoResp.getRoom_info().getRoom_background());
// }
// ((RoomActivity) getActivity()).setvisibTop(true);
// } else {
// ((RoomActivity) getActivity()).changeBackgroundColor(mRoomInfoResp.getRoom_info().getRoom_background());
// ((RoomActivity) getActivity()).setvisibTop(true);
// }
// }
updateChildFragmentViews(); updateChildFragmentViews();
} }
/// 这是在进入电影放的时候,隐藏下面的和排麦视图 /// 这是在进入电影放的时候,隐藏下面的和排麦视图
public void setviewyc() { public void setviewyc() {
// mBinding.ivSoundEffects.setVisibility(View.GONE); // mBinding.ivSoundEffects.setVisibility(View.GONE);
@@ -693,20 +794,36 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
} }
public void replaceNestedFragment(@NonNull Fragment newFragment, int containerId) { public void replaceNestedFragment(@NonNull Fragment newFragment, int containerId) {
// String tag = newFragment.getClass().getSimpleName(); // 使用类名作为 tag
//
// FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
// callSpecificDestroyMethod(newFragment);
// transaction.replace(containerId, newFragment, tag);
// transaction.commitAllowingStateLoss();
// 检查Fragment是否已经附加到Activity
if (!isAdded() || getActivity() == null) {
// 如果Fragment还没有附加则延迟执行
if (getView() != null) {
getView().post(() -> {
if (isAdded() && getActivity() != null) {
performFragmentReplacement(newFragment, containerId);
}
});
}
return;
}
performFragmentReplacement(newFragment, containerId);
}
private void performFragmentReplacement(@NonNull Fragment newFragment, int containerId) {
String tag = newFragment.getClass().getSimpleName(); // 使用类名作为 tag String tag = newFragment.getClass().getSimpleName(); // 使用类名作为 tag
FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
// 可选:检查是否已有相同类型的 Fragment
// Fragment existing = getChildFragmentManager().findFragmentById(containerId);
// if (existing != null) {
// transaction.remove(existing);
// }
callSpecificDestroyMethod(newFragment); callSpecificDestroyMethod(newFragment);
transaction.replace(containerId, newFragment, tag); transaction.replace(containerId, newFragment, tag);
transaction.commitAllowingStateLoss(); transaction.commitAllowingStateLoss();
} }
/** /**
* 调用特定Fragment的销毁方法 * 调用特定Fragment的销毁方法
* *
@@ -790,7 +907,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
if (auctionRoomFragment != null && auctionRoomFragment.isAdded()) { if (auctionRoomFragment != null && auctionRoomFragment.isAdded()) {
auctionRoomFragment.upRoomInfo(mRoomInfoResp); auctionRoomFragment.upRoomInfo(mRoomInfoResp);
} }
} else if ("1".equals(typeId) || "3".equals(typeId) || "4".equals(typeId)) { } else if ("1".equals(typeId) || "3".equals(typeId) || "4".equals(typeId) || "8".equals(typeId)) {
if ("2".equals(labelId)) { if ("2".equals(labelId)) {
RoomKtvFragment roomKtvFragment = findFragmentByTag(RoomKtvFragment.class); RoomKtvFragment roomKtvFragment = findFragmentByTag(RoomKtvFragment.class);
if (roomKtvFragment != null && roomKtvFragment.isAdded()) { if (roomKtvFragment != null && roomKtvFragment.isAdded()) {

View File

@@ -239,7 +239,9 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
// @Subscribe(threadMode = ThreadMode.MAIN) // @Subscribe(threadMode = ThreadMode.MAIN)
// public void roomAgoraIsOPen(AgoraIsOPen isOPen) { // public void roomAgoraIsOPen(AgoraIsOPen isOPen) {
// if (isOPen.isOpen()) { // if (isOPen.isOpen()) {
// // mKaraokeView.reset();
// AgoraManager.getInstance(getActivity()).stopMusicPlayer();
// AgoraManager.getInstance(getActivity()).setmSongCode(0);
// AgoraManager.getInstance(getActivity()).loadLrc(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code())); // AgoraManager.getInstance(getActivity()).loadLrc(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()));
// } // }
// } // }
@@ -691,6 +693,10 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
roomDefaultWheatView.setData(pitBean); roomDefaultWheatView.setData(pitBean);
roomInfoResp.setSong_user_info(musicSongBean); roomInfoResp.setSong_user_info(musicSongBean);
// mKaraokeView.reset();
// AgoraManager.getInstance(getActivity()).stopMusicPlayer();
// AgoraManager.getInstance(getActivity()).setmSongCode(0);
if (messageEvent.getText().getSongInfo().getUser_id().equals(SpUtil.getUserId() + "")) { if (messageEvent.getText().getSongInfo().getUser_id().equals(SpUtil.getUserId() + "")) {
// AgoraManager.getInstance(getActivity()).stopMuisc(); // AgoraManager.getInstance(getActivity()).stopMuisc();
LogUtils.e("推送过来的code", messageEvent.getText().getSongInfo().getSong_code()); LogUtils.e("推送过来的code", messageEvent.getText().getSongInfo().getSong_code());
@@ -699,6 +705,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
} else { } else {
// AgoraManager.getInstance(getActivity()).stopMuisc(); // AgoraManager.getInstance(getActivity()).stopMuisc();
if (AgoraManager.getInstance(getActivity()).isOnJoin()) { if (AgoraManager.getInstance(getActivity()).isOnJoin()) {
AgoraManager.getInstance(getActivity()).loadLrc(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code())); AgoraManager.getInstance(getActivity()).loadLrc(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()));
} }
// AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(messageEvent.getText().getSongInfo().getSong_code()), 2); // AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(messageEvent.getText().getSongInfo().getSong_code()), 2);

View File

@@ -1,26 +1,201 @@
package com.example.modulevocal.activity; package com.example.modulevocal.activity;
import android.view.View;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.ToastUtils;
import com.example.modulevocal.R; import com.example.modulevocal.R;
import com.example.modulevocal.databinding.ActivityUnderageBinding; import com.example.modulevocal.databinding.ActivityUnderageBinding;
import com.example.modulevocal.presenter.UnderagePresenter; import com.example.modulevocal.presenter.UnderagePresenter;
import com.xscm.moduleutil.activity.BaseMvpActivity; import com.xscm.moduleutil.activity.BaseMvpActivity;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.utils.ARouteConstants;
import com.xscm.moduleutil.utils.ColorManager; import com.xscm.moduleutil.utils.ColorManager;
import com.xscm.moduleutil.utils.SpUtil;
import com.xscm.moduleutil.widget.SplitEditText;
/**
* @author qx
* @data 2025/9/19
* @description: 未成年模式设置
*/
@Route(path = ARouteConstants.UNDERAGE_ACTIVITY)
public class UnderageActivity extends BaseMvpActivity<UnderagePresenter, ActivityUnderageBinding> { public class UnderageActivity extends BaseMvpActivity<UnderagePresenter, ActivityUnderageBinding> {
private static final String PREF_UNDERAGE_PASSWORD = "underagePassword";
private String firstPassword = ""; // 用于存储首次输入的密码
private boolean isConfirming = false; // 标识是否处于确认密码阶段
@Autowired
public int type ; // 0-设置密码模式1-验证密码模式
@Override @Override
protected void initData() { protected void initData() {
} }
@Override @Override
protected void initView() { protected void initView() {
super.initView(); super.initView();
mBinding.topBar.setTitle("未成年人模式"); mBinding.topBar.setTitle("未成年人模式");
mBinding.text.setTextColor(ColorManager.getInstance().getPrimaryColorInt()); mBinding.text.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
if (type == 1) {
// 验证密码模式
mBinding.meMim.setText("请输入监护密码");
mBinding.text.setVisibility(View.GONE);
} else {
// 设置密码模式
mBinding.meMim.setText("请输入监护密码");
mBinding.text.setVisibility(android.view.View.GONE);
}
mBinding.verificationcodeview.setOnInputListener(new SplitEditText.OnInputListener() {
@Override
public void onInputFinished(String content) {
// 当输入完成4位数字时自动处理
handlePasswordInput(content);
}
@Override
public void onInputChanged(String text) {
}
});
}
/**
* 处理密码输入完成后的逻辑
*
* @param password 输入的密码
*/
private void handlePasswordInput(String password) {
if (type == 1) {
// 验证密码模式
verifyPassword(password);
} else {
// 设置密码模式
setupPassword(password);
}
// if (!isConfirming) {
// // 第一次输入密码,保存并清空输入框
// firstPassword = password;
// isConfirming = true;
//
// // 清空输入框
// mBinding.verificationcodeview.setText("");
//
// // 更改提示文字
// mBinding.meMim.setText("请再次输入监护密码");
// } else {
// // 第二次输入密码,进行对比
// if (firstPassword.equals(password)) {
// // 密码一致,保存到本地并跳转页面
// savePassword(password);
// navigateToNextPage();
// } else {
// // 密码不一致,提示并重新设置
// ToastUtils.showShort("两次输入的密码不一致,请重新设置");
// resetPasswordInput();
// }
// }
}
/**
* 验证密码type=1时使用
* @param inputPassword 用户输入的密码
*/
private void verifyPassword(String inputPassword) {
// 从本地获取已保存的密码
String savedPassword = SpUtil.getUnderagePassword();
if (savedPassword.isEmpty()) {
// 尚未设置密码
ToastUtils.showShort("尚未设置监护密码");
mBinding.verificationcodeview.setText(""); // 清空输入框
return;
}
if (savedPassword.equals(inputPassword)) {
// 密码正确,关闭页面
// ToastUtils.showShort("密码验证成功");
ARouter.getInstance().build(ARouteConstants.ME).navigation();
finishAll();
} else {
// 密码错误,提示并清空输入框
ToastUtils.showShort("密码错误,请重新输入");
mBinding.verificationcodeview.setText(""); // 清空输入框
}
}
/**
* 设置密码type=0时使用
* @param password 输入的密码
*/
private void setupPassword(String password) {
if (!isConfirming) {
// 第一次输入密码,保存并清空输入框
firstPassword = password;
isConfirming = true;
// 清空输入框
mBinding.verificationcodeview.setText("");
// 更改提示文字
mBinding.meMim.setText("请再次输入监护密码");
} else {
// 第二次输入密码,进行对比
if (firstPassword.equals(password)) {
// 密码一致,保存到本地并跳转页面
savePassword(password);
navigateToNextPage();
} else {
// 密码不一致,提示并重新设置
ToastUtils.showShort("两次输入的密码不一致,请重新设置");
resetPasswordInput();
}
}
}
/**
* 保存密码到本地
*
* @param password 要保存的密码
*/
private void savePassword(String password) {
SpUtil.setUnderagePassword(password);
}
/**
* 重置密码输入状态
*/
private void resetPasswordInput() {
firstPassword = "";
isConfirming = false;
// 清空输入框
mBinding.verificationcodeview.setText("");
// 恢复提示文字
mBinding.meMim.setText("请输入监护密码");
}
/**
* 跳转到下一个页面
*/
private void navigateToNextPage() {
// ToastUtils.showShort("密码设置成功");
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/teenage?id=" + SpUtil.getToken())
.withString("type", "1").navigation();
mBinding.verificationcodeview.setText("");
finish();
// 这里可以添加页面跳转逻辑
finishAll();
} }
@Override @Override

View File

@@ -78,13 +78,14 @@
android:id="@+id/text" android:id="@+id/text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="忘记密码?请联系客服" android:text="确认"
android:textColor="#0DFFB9" android:textColor="#0DFFB9"
app:layout_constraintTop_toBottomOf="@+id/rel_code_show" app:layout_constraintTop_toBottomOf="@+id/rel_code_show"
android:gravity="center" android:gravity="center"
android:layout_marginTop="@dimen/dp_21" android:layout_marginTop="@dimen/dp_21"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/> app:layout_constraintEnd_toEndOf="parent"
android:visibility="gone"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -33,7 +33,7 @@
android:layout_width="@dimen/dp_24" android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24" android:layout_height="@dimen/dp_24"
android:layout_marginRight="@dimen/dp_11" android:layout_marginRight="@dimen/dp_11"
android:src="@mipmap/image_yq" /> android:src="@drawable/image_yq" />
<ImageView <ImageView
android:id="@+id/iv_kf" android:id="@+id/iv_kf"
@@ -41,7 +41,7 @@
android:layout_height="@dimen/dp_24" android:layout_height="@dimen/dp_24"
android:layout_marginRight="@dimen/dp_11" android:layout_marginRight="@dimen/dp_11"
android:layout_toRightOf="@+id/iv_hb" android:layout_toRightOf="@+id/iv_hb"
android:src="@mipmap/custom" /> android:src="@drawable/custom" />
<ImageView <ImageView
android:id="@+id/iv_sz" android:id="@+id/iv_sz"