Merge branch 'dev-lxj-beta' into dev-lxj

# Conflicts:
#	.idea/.name
#	.idea/vcs.xml
This commit is contained in:
2025-11-05 11:25:39 +08:00
47 changed files with 418 additions and 471 deletions

20
.gitignore vendored
View File

@@ -1,15 +1,9 @@
.idea/
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
build/
local.properties
.gradle/
.externalNativeBuild/
.DS_Store
*.dm
*.log

3
.idea/.gitignore generated vendored
View File

@@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

2
.idea/vcs.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/yusheng-android" vcs="Git" />
</component>
</project>

View File

@@ -66,19 +66,19 @@ android {
// // 测试版配置
beta {
dimension "environment"
// 测试版包名:基础包名 + .betacom.example.myapp.beta
applicationIdSuffix ".beta"
// 测试版版本名1.0-beta
versionNameSuffix "-beta"
// 【测试版应用名称】动态生成带标识的名称
resValue "string", "app_name", "羽声-测试版"
// 【测试版图标】替换为测试专用图标
manifestPlaceholders = [
appIcon: "@mipmap/ic_launcher_app_bat" // 需在main/res/mipmap放置该图标
]
// dimension "environment"
// // 测试版包名:基础包名 + .betacom.example.myapp.beta
// applicationIdSuffix ".beta"
// // 测试版版本名1.0-beta
// versionNameSuffix "-beta"
//
// // 【测试版应用名称】动态生成带标识的名称
// resValue "string", "app_name", "羽声-测试版"
//
// // 【测试版图标】替换为测试专用图标
// manifestPlaceholders = [
// appIcon: "@mipmap/ic_launcher_app_bat" // 需在main/res/mipmap放置该图标
// ]
}
}

View File

@@ -408,7 +408,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
.setPrivacyTextSize(11)
.setPrivacyAlertContentVerticalMargin(20)
.setPrivacyMargin(39)
.setPrivacyState(true)
.setPrivacyState(false)
.setCheckboxHidden(false)
.setCheckedImgPath("ic_agreement_selected")
.setUncheckedImgPath("ic_agreement_unselect")
@@ -485,20 +485,20 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
}
String phone = mBinding.edPhone.getText().toString().trim();
if (TextUtils.isEmpty(phone)) {
com.blankj.utilcode.util.ToastUtils.showShort("请输入手机号");
ToastUtils.show("请输入手机号");
return;
}
if (type == 1) {
String code = mBinding.edPassword.getText().toString().trim();
if (TextUtils.isEmpty(code)) {
com.blankj.utilcode.util.ToastUtils.showShort("请输入验证码");
ToastUtils.show("请输入验证码");
return;
}
MvpPre.login(phone, "", code, 1);
} else if (type == 2) {
String password = mBinding.edPasswordCode.getText().toString().trim();
if (TextUtils.isEmpty(password)) {
com.blankj.utilcode.util.ToastUtils.showShort("请输入密码");
ToastUtils.show("请输入密码");
return;
}
MvpPre.login(phone, password, "", 2);
@@ -525,7 +525,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
} else if (id == R.id.tv_send_code) {
String phone = mBinding.edPhone.getText().toString().trim();
if (TextUtils.isEmpty(phone)) {
com.blankj.utilcode.util.ToastUtils.showShort("请输入手机号");
ToastUtils.show("请输入手机号");
return;
}
sendCodeSuccess(phone);

View File

@@ -28,8 +28,8 @@ isBuildModule=false
#org.gradle.deamon=false
android.injected.testOnly=false
APP_VERSION_NAME=1.0.5.7
APP_VERSION_CODE=47
APP_VERSION_NAME=1.0.5.9
APP_VERSION_CODE=49
org.gradle.jvm.toolchain.useLegacyAdapters=false
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15

View File

@@ -286,7 +286,29 @@
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_24"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="邀请码"
android:textColor="#73000000"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" (非必填)"
android:textColor="#33000000"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

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

View File

@@ -1118,7 +1118,7 @@ public class AgoraManager {
case PLAYER_STATE_OPEN_COMPLETED:
LogUtils.e("lxj", "播放");
musicPlayer.play();
musicPlayer.selectAudioTrack(0);//播放原生
// musicPlayer.selectAudioTrack(0);//播放原生
break;
case PLAYER_STATE_PAUSING_INTERNAL:
LogUtils.e("lxj", "关闭");
@@ -1257,7 +1257,7 @@ public class AgoraManager {
case PLAYER_STATE_OPEN_COMPLETED:
LogUtils.e("lxj", "播放");
musicPlayer.play();
musicPlayer.selectAudioTrack(0);
// musicPlayer.selectAudioTrack(0);
break;
case PLAYER_STATE_PAUSING_INTERNAL:
LogUtils.e("lxj", "关闭");
@@ -1354,21 +1354,31 @@ public class AgoraManager {
*/
public void setMusicVolume(int volume) {
if (rtcEngine != null) {
rtcEngine.adjustRecordingSignalVolume(volume);
rtcEngine.adjustRecordingSignalVolume(volume);//调整采集信号音量
// musicPlayer.adjustPublishSignalVolume(volume);//调节远端用户听到的音量。 参数是0-400
}
}
/**
* 设置伴奏阴凉
* 设置伴奏音量
*
* @param volume
*/
public void settPlayoutVolume(int volume) {
public void setPlayoutVolume(int volume) {
if (musicPlayer != null) {
musicPlayer.adjustPlayoutVolume(volume);
musicPlayer.adjustPublishSignalVolume(volume);
musicPlayer.adjustPlayoutVolume(volume);//调节本地播放音量。 参数是0-100
musicPlayer.adjustPublishSignalVolume(volume*2);//调节远端用户听到的音量。 参数是0-400
}
}
/**
* 伴奏音量
* @param volume
*/
public void setAdjustPublishSignalVolume(int volume){
musicPlayer.adjustPublishSignalVolume(volume);//调节远端用户听到的音量。 参数是0-400
}
/**
* 设置音效

View File

@@ -0,0 +1,77 @@
package com.xscm.moduleutil.rtc;
import java.util.HashMap;
import java.util.Map;
/**
* com.xscm.moduleutil.rtc
* qx
* 2025/11/3
* 声网声音管理类
*/
public class VolumeManager {
private static VolumeManager instance;
private Map<String, Integer> userMusicVolumeMap = new HashMap<>();
private Map<String, Integer> userPlayoutVolumeMap = new HashMap<>();
private Map<String, Boolean> userPlayoutBzMap = new HashMap<>();
private String currentUserId;
private VolumeManager() {}
public static VolumeManager getInstance() {
if (instance == null) {
synchronized (VolumeManager.class) {
if (instance == null) {
instance = new VolumeManager();
}
}
}
return instance;
}
public void setCurrentUserId(String userId) {
this.currentUserId = userId;
}
public void saveCurrentVolumes(int musicVolume, int playoutVolume) {
if (currentUserId != null) {
userMusicVolumeMap.put(currentUserId, musicVolume);
userPlayoutVolumeMap.put(currentUserId, playoutVolume);
}
}
public void clearCurrentVolumes() {
if (currentUserId != null) {
userMusicVolumeMap.remove(currentUserId);
userPlayoutVolumeMap.remove(currentUserId);
}
userPlayoutBzMap.clear();
}
public void saveBz(String userId, boolean bz){
userPlayoutBzMap.clear();
userPlayoutBzMap.put(userId, bz);
}
public boolean getBz(String userId){
Boolean bz = userPlayoutBzMap.get(userId);
if (bz == null) {
bz = true; // 默认值原唱 false 伴奏
}
return bz;
}
public int[] getUserVolumes(String userId) {
Integer musicVolume = userMusicVolumeMap.get(userId);
Integer playoutVolume = userPlayoutVolumeMap.get(userId);
if (musicVolume == null) {
musicVolume = 100; // 默认值
}
if (playoutVolume == null) {
playoutVolume = 50; // 默认值
}
return new int[]{musicVolume, playoutVolume};
}
}

View File

@@ -49,7 +49,7 @@ public enum EnvironmentEnum {
private final String mqttUrl;//MQTT服务器地址
private final String H5Url;//h5地址
private final int shelf;//是否上架0平台更新1上架发布到对应的应用商城
private final int shelf;//是否上架0平台更新1上架发布到对应的应用商城上架的初始是没有趣味的需要点击6次才可以打开趣味
EnvironmentEnum(String serverUrl, String ALI_AUTH_KEY, String ossEndPoint, String ossaAcessKeyId,
String ossAccessKeySecret, String ossBucketName, String ossBaseUrl, String wxAppId,

View File

@@ -30,26 +30,6 @@ public class EnvironmentPrefs {
// 获取当前选择的环境,默认根据构建变体决定
public EnvironmentEnum getSelectedEnvironment() {
// // 检查是否是debug版本开发版本
// if (BuildConfig.DEBUG) {
// return EnvironmentEnum.TEST;
// }
//
// // 检查flavor类型
// if ("dev".equals(BuildConfig.FLAVOR)) {
// return EnvironmentEnum.TEST;
// }
//
// // 检查包名判断是否为开发版本
// try {
// String packageName = CommonAppContext.getInstance().getPackageName();
// if (packageName.contains(".test") || packageName.contains(".dev")) {
// return EnvironmentEnum.TEST;
// }
// } catch (Exception e) {
// // 忽略异常
// }
// 默认使用生产环境
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.PRODUCTION.name());
try {

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -178,6 +178,7 @@
<color name="color_DFFFFE">#DFFFFE</color>
<color name="color_F9FAFA">#F9FAFA</color>
<color name="color_528AFF">#528AFF</color>
<color name="color_EFEFEF">#EFEFEF</color>
<color name="color_FF666666">#FF666666</color>
<color name="color_FF576FFF">#FF576FFF</color>
<color name="color_FF7685D6">#FF7685D6</color>

View File

@@ -2655,10 +2655,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
addActiveDialogFragment(fragment) // 添加到管理列表
}
} else if (id == R.id.rl_misc) { //设置点歌
if (mRoomInfoResp!!.room_info.label_id == "1") {
queren()
} else {
// RequestDialogFragment.show(roomId, mRoomInfoResp, 1, getSupportFragmentManager());
// if (mRoomInfoResp!!.room_info.label_id == "1") {
// queren()
// } else {
val fragment = RequestDialogFragment.show(
roomId, mRoomInfoResp, 1,
supportFragmentManager
@@ -2666,7 +2665,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if (fragment != null) {
addActiveDialogFragment(fragment) // 添加到管理列表
}
}
// }
} else if (id == R.id.rl_gift) { //礼物
// RoomGiftDialogFragment.show(mRoomInfoResp, null, roomId, 0, "", getSupportFragmentManager());
val fragment = RoomGiftDialogFragment.show(
@@ -3103,6 +3102,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if ("1" != typeId) {
rl_more?.visibility = View.GONE
}
if ("1"==typeId && "2" == labelId){
rl_misc?.visibility = View.VISIBLE
}
}
fun isMute(is_mute: Int) {

View File

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

View File

@@ -11,6 +11,8 @@ public class RoomSettingContacts {
void changeRoomSuccess(String s,int position,RoomSettingBean bean);
void changeRoomType(String s);
void agreeSong(String s);
}
public interface IRoomPre extends IPresenter {
@@ -18,5 +20,7 @@ public class RoomSettingContacts {
void changeRoom(String roomId, String userId, int position, RoomSettingBean bean);
void changeRoomType(String roomId,String type);//修改房间类型 type1点唱、2拍卖、3男神、4女神
void agreeSong(String roomId, String type);
}
}

View File

@@ -151,6 +151,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
// dataList.add(new RoomSettingBean("女神", "ic_girl", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeGirl, 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("练歌房", "ic_liang", null, null, RoomSettingBean.QXRoomSettingTypeRoomTypeLianG, read, isSelected, false, false)); //练歌房,原点歌房,同意的时候,走同意点歌的逻辑
dataList.add(new RoomSettingBean("常用工具", null, null, null, -1, read, isSelected, false, false));
@@ -165,7 +166,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
dataList.add(new RoomSettingBean("发红包", "ic_red", null, null, RoomSettingBean.QXRoomSettingTypeRoomFloatingRed, read, isSelected, false, false));
// dataList.add(new RoomSettingBean("离开房间", "ic_leave", null, null, RoomSettingBean.QXRoomSettingTypeRoomLeave, read, isSelected, false, false));
// dataList.add(new RoomSettingBean("分享房间", "ic_share", null, null, RoomSettingBean.QXRoomSettingTypeRoomShare, read, isSelected, false, false));
dataList.add(new RoomSettingBean("调音台", "ic_my_dress", null, null, RoomSettingBean.QXRoomSettingTypeRoomMyDress, read, isSelected, false, false));
// dataList.add(new RoomSettingBean("调音台", "ic_my_dress", null, null, RoomSettingBean.QXRoomSettingTypeRoomMyDress, read, isSelected, false, false));
dataList.add(new RoomSettingBean("房间设置", "ic_room_setting", null, null, RoomSettingBean.QXRoomSettingTypeRoomSetting, read, isSelected, false, false));
// dataList.add(new RoomSettingBean("房间欢迎语", "ic_welcome", null, null, RoomSettingBean.QXRoomSettingTypeRoomWelcome,read,isSelected, false));
dataList.add(new RoomSettingBean("关闭特效", "ic_close_effects", null, null, RoomSettingBean.QXRoomSettingTypeRoomCloseEffects, read, isSelected, false, effectOn));
@@ -236,9 +237,11 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
((RoomActivity) getActivity()).clearData();
}
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
TunerDialogFragment.show(roomId, getChildFragmentManager());
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCompere) {//主持设置
}
// else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomMyDress) {
// TunerDialogFragment.show(roomId, getChildFragmentManager());
// }
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomCompere) {//主持设置
RoomHostFragment.newInstance(roomId).show(getChildFragmentManager(), "RoomHostFragment");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomBgImage) {//背景图片
RoomBackgroundDialogFragment.newInstance(roomId).show(getChildFragmentManager(), "RoomBackgroundDialogFragment");
@@ -287,7 +290,10 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
queren("7");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU) {
queren("8");
} else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
}else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG){
queren("-1");
}
else if (bean.getType() == RoomSettingBean.QXRoomSettingTypeRoomSetting) {
if (roomInfoResp != null) {
ARouter.getInstance().build(ARouteConstants.CREATED_ROOM).withSerializable("roomInfoResp", roomInfoResp).navigation();
} else {
@@ -341,12 +347,16 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
// 创建并显示确认对话框
new ConfirmDialog(getActivity(),
"提示",
"即将修改房间类型为" + (type.equals("1") ? "点唱" : (type.equals("2") ? "拍卖" : (type.equals("3") ? "男神" : (type.equals("4") ? "女神" : (type.equals("7") ? "互娱" : (type.equals("8") ? "交友" : "")))))),
"即将修改房间类型为" + (type.equals("1") ? "点唱" : (type.equals("2") ? "拍卖" : (type.equals("3") ? "男神" : (type.equals("4") ? "女神" : (type.equals("7") ? "互娱" : (type.equals("8") ? "交友" :(type.equals("-1") ? "练歌房" : ""))))))),
"确认",
"取消",
v -> {
if (type.equals("-1")) {
MvpPre.agreeSong(roomId,"1");
} else
// 点击“确认”按钮时执行删除操作
MvpPre.changeRoomType(roomId, type);
},
v -> {
// 点击“取消”按钮时什么都不做
@@ -370,11 +380,11 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
// 房主显示全部
if (roleLevel == 1) {
if (onMic) {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress || type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG ) {
return false;
}
} else {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress || type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG) {
return false;
}
}
@@ -383,14 +393,15 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
if (type == RoomSettingBean.QXRoomSettingTypeRoomTypeSing || type == RoomSettingBean.QXRoomSettingTypeRoomTypeAuction ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeHUYU ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeJiaoy ||
type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG ||
type == RoomSettingBean.QXRoomSettingTypeRoomClearMessage || type == QXRoomSettingTypeRoomOrderMic || type == RoomSettingBean.QXRoomSettingTypeRoomFloatingScreen
|| type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomBgImage || type == -1) {
if (onMic) {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress || type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG) {
return false;
}
} else {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress || type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG) {
return false;
}
}
@@ -401,7 +412,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
) {
return true;
} else {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress || type == RoomSettingBean.QXRoomSettingTypeRoomTypeLianG) {
return false;
}
}
@@ -427,7 +438,7 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
else { // 普通用户只显示更多操作中的特定条目
return type == RoomSettingBean.QXRoomSettingTypeRoomLeave ||
type == RoomSettingBean.QXRoomSettingTypeRoomShare ||
type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ||
type == RoomSettingBean.QXRoomSettingTypeRoomCloseEffects ||
type == RoomSettingBean.QXRoomSettingTypeRoomReport ||
type == RoomSettingBean.QXRoomSettingTypeRoomFloatingRed||
@@ -497,4 +508,10 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
ToastUtils.show(s);
dismiss();
}
@Override
public void agreeSong(String s) {
ToastUtils.show(s);
dismiss();
}
}

View File

@@ -25,6 +25,7 @@ import com.xscm.moduleutil.bean.MixerResp;
import com.xscm.moduleutil.bean.room.RoomApplyListBean;
import com.xscm.moduleutil.rtc.AgoraManager;
import com.xscm.moduleutil.rtc.RtcConstants;
import com.xscm.moduleutil.rtc.VolumeManager;
import com.xscm.moduleutil.utils.SpUtil;
import java.util.ArrayList;
@@ -94,6 +95,12 @@ public class TunerDialogFragment extends BaseMvpDialogFragment<WheatPresenter, R
// RtcManager.getInstance().setTone(item.getId());
// }
// });
// 初始化音量管理器
VolumeManager volumeManager = VolumeManager.getInstance();
String currentUserId = SpUtil.getUserId() + "";
volumeManager.setCurrentUserId(currentUserId);
mBinding.swMonitoring.setChecked(SpUtil.getAuricularBack() == 1 ? true : false);//设置耳返开启还是关闭
mBinding.swMonitoring.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
@@ -103,51 +110,68 @@ public class TunerDialogFragment extends BaseMvpDialogFragment<WheatPresenter, R
SpUtil.setAuricularBack(b ? 1 : 0);
}
});
int progress = SpUtil.getMusicVolume();
if (progress == 0) {
progress = 100;
}
mBinding.seekBar1.setProgress(progress);
// 设置 seekBar1 的默认进度为 100
// mBinding.seekBar1.setProgress(100);
// 更新对应的 TextView 显示内容
mBinding.tvSeekbarValue.setText("人声" + progress + "%");
// volumeManager.getUserVolumes(currentUserId);
// int progress = SpUtil.getMusicVolume();
// if (progress == 0) {
// progress = 100; // 默认值改为100
// }
// mBinding.seekBar1.setMax(200); // 设置最大值为200
// mBinding.seekBar1.setProgress(progress);
// // 转换为百分比显示 (200代表100%100代表50%)
// int percentage = (int) ((progress / 200.0) * 100);
// mBinding.tvSeekbarValue.setText("人声" + percentage + "%");
// 获取新演唱者的音量设置
int[] volumes = volumeManager.getUserVolumes(currentUserId);
int musicVolume = volumes[0];
int playoutVolume = volumes[1];
updateVolumeUI(musicVolume, playoutVolume);
mBinding.seekBar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
mBinding.tvSeekbarValue.setText("人声" + progress + "%");
SpUtil.setMusicVolume(progress);
AgoraManager.getInstance(getContext()).setMusicVolume(progress);
// 转换为百分比显示 (200代表100%100代表50%)
int percentage = (int) ((progress / 200.0) * 100);
mBinding.tvSeekbarValue.setText("人声" + percentage + "%");
SpUtil.setMusicVolume(progress); // 保存原始值(0-200)
AgoraManager.getInstance(getContext()).setMusicVolume(progress); // 使用原始值(0-200)
// 保存当前用户的音量设置
volumeManager.saveCurrentVolumes(
mBinding.seekBar1.getProgress(),
mBinding.seekBar2.getProgress()
);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
int progress2 = SpUtil.gettPlayoutVolume();
if (progress2 == 0) {
progress2 = 100;
}
// 设置 seekBar1 的默认进度为 100
mBinding.seekBar2.setProgress(progress2);
// 更新对应的 TextView 显示内容
mBinding.tvSeekbarValue2.setText("伴奏" + progress2 + "%");
// int progress2 = SpUtil.gettPlayoutVolume();
// if (progress2 == 0) {
// progress2 = 100;
// }
// // 设置 seekBar1 的默认进度为 100
// mBinding.seekBar2.setProgress(progress2);
// // 更新对应的 TextView 显示内容
// mBinding.tvSeekbarValue2.setText("伴奏" + progress2 + "%");
mBinding.seekBar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
mBinding.tvSeekbarValue2.setText("伴奏" + progress + "%");
SpUtil.settPlayoutVolume(progress);
AgoraManager.getInstance(getContext()).settPlayoutVolume(progress);
AgoraManager.getInstance(getContext()).setPlayoutVolume(progress);
// 保存当前用户的音量设置
volumeManager.saveCurrentVolumes(
mBinding.seekBar1.getProgress(),
mBinding.seekBar2.getProgress()
);
}
@Override
@@ -208,7 +232,24 @@ public class TunerDialogFragment extends BaseMvpDialogFragment<WheatPresenter, R
}
/**
* 更新音量UI显示
* @param musicVolume 人声音量
* @param playoutVolume 伴奏音量
*/
public void updateVolumeUI(int musicVolume, int playoutVolume) {
// 更新人声音量
int musicPercentage = (int) ((musicVolume / 200.0) * 100);
mBinding.seekBar1.setMax(200);
mBinding.seekBar1.setProgress(musicVolume);
mBinding.tvSeekbarValue.setText("人声" + musicPercentage + "%");
AgoraManager.getInstance(getContext()).setMusicVolume(musicVolume); // 使用原始值(0-200)
// 更新伴奏音量
mBinding.seekBar2.setProgress(playoutVolume);
// int playoutPercentage = (int) ((playoutVolume / 200.0) * 100);
mBinding.tvSeekbarValue2.setText("伴奏" + playoutVolume + "%");
AgoraManager.getInstance(getContext()).setPlayoutVolume(playoutVolume);
}
@Override
protected WheatPresenter bindPresenter() {

View File

@@ -123,7 +123,7 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
if (view.getId() == R.id.room_item_head) {
CharmRankingResp item = cAdapter.getItem(position);
RoomUserInfoFragment.show(roomId,item.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
RoomUserInfoFragment.show(roomId,item.getUser_id(), "", getHostUser(), false, 3, 0, getChildFragmentManager());
// ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id()).withBoolean("returnRoom", true).navigation();
}
@@ -136,7 +136,7 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
if (view.getId() == R.id.room_item_head) {
CharmRankingResp item = wAdapter.getItem(position);
RoomUserInfoFragment.show(roomId,item.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
RoomUserInfoFragment.show(roomId,item.getUser_id(), "", getHostUser(), false, 3, 0, getChildFragmentManager());
// WealthRankingResp.ListsBean item = wAdapter.getItem(position);
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", item.getUser_id()).withBoolean("returnRoom", true).navigation();
}
@@ -193,7 +193,7 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
mBinding.roomRankTop1HeadIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RoomUserInfoFragment.show(roomId,listsBean.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
RoomUserInfoFragment.show(roomId,listsBean.getUser_id(), "", getHostUser(), false, 3, 0, getChildFragmentManager());
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", listsBean.getUser_id()).withBoolean("returnRoom", true).navigation();
}
@@ -209,7 +209,7 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
mBinding.roomRankTop2HeadIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RoomUserInfoFragment.show(roomId,listsBean.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
RoomUserInfoFragment.show(roomId,listsBean.getUser_id(), "", getHostUser(), false, 3, 0, getChildFragmentManager());
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", listsBean.getUser_id()).withBoolean("returnRoom", true).navigation();
}
@@ -247,7 +247,7 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
mBinding.roomRankTop3HeadIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RoomUserInfoFragment.show(roomId,listsBean.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
RoomUserInfoFragment.show(roomId,listsBean.getUser_id(), "", getHostUser(), false, 3, 0, getChildFragmentManager());
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", listsBean.getUser_id()).withBoolean("returnRoom", true).navigation();
}

View File

@@ -14,6 +14,7 @@ import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import app.dinus.com.loadingdrawable.render.scenery.ElectricFanLoadingRenderer;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
@@ -22,19 +23,18 @@ import com.example.moduleroom.R;
import com.example.moduleroom.activity.RoomActivity;
import com.example.moduleroom.contacts.RoomContacts;
import com.example.moduleroom.databinding.FragmentRoomKtvBinding;
import com.example.moduleroom.dialog.RoomCharmDialog;
import com.example.moduleroom.dialog.RoomGiftDialogFragment;
import com.example.moduleroom.dialog.RoomOnlineDialogFragment;
import com.example.moduleroom.dialog.RoomUserInfoFragment;
import com.example.moduleroom.dialog.*;
import com.example.moduleroom.presenter.RoomPresenter;
import com.xscm.moduleutil.base.BaseMvpFragment;
import com.xscm.moduleutil.bean.*;
import com.xscm.moduleutil.bean.room.RoomInfoResp;
import com.xscm.moduleutil.bean.room.RoomOnline;
import com.xscm.moduleutil.bean.room.RoomPitBean;
import com.xscm.moduleutil.bean.room.RoomUserBean;
import com.xscm.moduleutil.rtc.AgoraManager;
import com.xscm.moduleutil.rtc.MusicFileBean;
import com.xscm.moduleutil.rtc.MusicPlayBean;
import com.xscm.moduleutil.rtc.VolumeManager;
import com.xscm.moduleutil.utils.ClickUtils;
import com.xscm.moduleutil.utils.ImageUtils;
import com.xscm.moduleutil.utils.SpUtil;
@@ -66,6 +66,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
private MusicSongBean musicSongBean;
RoomFragment parentFragment;
BaseQuickAdapter<RoomPitBean, BaseViewHolder> adapter;
VolumeManager volumeManager ;
private RoomOnline online;
public RoomKtvFragment() {}
@@ -89,36 +90,12 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// 设置触摸委托以扩大点击区域
// view.post(() -> {
// View muZc = view.findViewById(R.id.mu_zc);
// ViewGroup parent = (ViewGroup) muZc.getParent();
//
// Rect bounds = new Rect();
// muZc.getHitRect(bounds);
// // 扩展点击区域
// bounds.top -=55;
// bounds.bottom += 50;
// bounds.left -= 30;
// bounds.right += 30;
//
// parent.setTouchDelegate(new TouchDelegate(bounds, muZc));
// });
}
private SharedViewModel sharedViewModel;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
//
// // 观察专门给子Fragment的数据
// sharedViewModel.getChildFragmentData().observe(getViewLifecycleOwner(), data -> {
// if (data != null) {
// // 处理数据
// roomInfoUpdate(data);
// }
// });
return super.onCreateView(inflater, container, savedInstanceState);
}
@@ -172,8 +149,9 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
}
}
// AgoraManager.getInstance(getActivity()).stopMuisc()
if (roomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "")) {
did = roomInfoResp.getSong_user_info().getDid();
if (roomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "")) {
setBz();
AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()), 1);
} else {
if (AgoraManager.getInstance(getActivity()).isOnJoin()) {
@@ -195,6 +173,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
pitBean.setCharm(roomInfoResp.getSong_user_info().getCharm());
pitBean.setDress(roomInfoResp.getSong_user_info().getDress());
roomDefaultWheatView.setData(pitBean);
} else {
RoomKtvWheatView roomDefaultWheatView = mBinding.muYc;
RoomPitBean pitBean = new RoomPitBean();
@@ -248,16 +227,31 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
}
// @Subscribe(threadMode = ThreadMode.MAIN)
// public void roomAgoraIsOPen(AgoraIsOPen 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()));
// }
// }
private void setBz(){
if (volumeManager.getBz(SpUtil.getUserId()+"")){
AgoraManager.getInstance(getActivity()).selectAudioTrack(0);
mBinding.imBz.setImageResource(com.xscm.moduleutil.R.mipmap.accompany_on);
mBinding.tvBz.setText("原唱");
isRotate = false;
}else {
AgoraManager.getInstance(getActivity()).selectAudioTrack(1);
mBinding.imBz.setImageResource(com.xscm.moduleutil.R.mipmap.accompany_off);
mBinding.tvBz.setText("伴奏");
isRotate = true;
}
}
// TODO: 2025/11/3 设置音量和伴奏
private void setAgorVolumes(){
// 获取新演唱者的音量设置
int[] volumes = volumeManager.getUserVolumes(SpUtil.getUserId()+"");
int musicVolume = volumes[0];
int playoutVolume = volumes[1];
AgoraManager.getInstance(getContext()).setMusicVolume(musicVolume); // 使用原始值(0-200
AgoraManager.getInstance(getContext()).setPlayoutVolume(playoutVolume);
}
@Override
public void onStart() {
@@ -281,6 +275,8 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
@Override
protected void initData() {
volumeManager=VolumeManager.getInstance();
setAgorVolumes();
upData();
}
@@ -313,33 +309,42 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
private void sv() {
RoomKtvWheatView roomDefaultWheatView = mBinding.muZc;
if (roomInfoResp.getSong_user_info() != null) {
if (roomInfoResp.getUser_info().getIs_host() == 1 && roomInfoResp.getUser_info().getPit_number() == 9) {
// 缓存 userId 字符串,避免重复拼接
String userIdStr = SpUtil.getUserId() + "";
// 提前获取相关对象引用,避免多次调用 getter
MusicSongBean songUserInfo = roomInfoResp.getSong_user_info();
RoomUserBean userInfo = roomInfoResp.getUser_info();
if (songUserInfo != null) {
if (userInfo != null && userInfo.getIs_host() == 1 && userInfo.getPit_number() == 9) {
setVisibilityView(1);
} else if (roomInfoResp.getSong_user_info().getIs_hot() == 1) {
} else if (songUserInfo.getIs_hot() == 1) {
setVisibilityView(1);
} else if (roomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "") && roomDefaultWheatView.getUserId().equals(SpUtil.getUserId() + "")) {
} else if (songUserInfo.getUser_id().equals(userIdStr) && roomDefaultWheatView.getUserId().equals(userIdStr)) {
setVisibilityView(4);
} else if (roomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "")) {
} else if (songUserInfo.getUser_id().equals(userIdStr)) {
setVisibilityView(2);
} else {
setVisibilityView(3);
}
} else {
if (roomInfoResp.getUser_info().getIs_host() == 1 && roomInfoResp.getUser_info().getPit_number() == 9) {
if (userInfo != null && userInfo.getIs_host() == 1 && userInfo.getPit_number() == 9) {
setVisibilityView(1);
} else {
setVisibilityView(3);
}
}
if (roomDefaultWheatView.getUserId().equals(SpUtil.getUserId() + "")) {
if (mBinding.muYc.getUserId().equals(SpUtil.getUserId() + "")) {
if (roomDefaultWheatView.getUserId().equals(userIdStr)) {
if (mBinding.muYc.getUserId().equals(userIdStr)) {
setVisibilityView(4);
} else {
setVisibilityView(1);
}
}
}
@Override
@@ -357,7 +362,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
startRotateAnimation();
mBinding.llBz.setOnClickListener(this::onClick);
mBinding.llDs.setOnClickListener(this::onClick);
mBinding.llJs.setOnClickListener(this::onClick);
mBinding.llTiaoyt.setOnClickListener(this::onClick);
mBinding.llQg.setOnClickListener(this::onClick);
mBinding.llSz.setOnClickListener(this::onClick);
adapter = new BaseQuickAdapter<RoomPitBean, BaseViewHolder>(R.layout.item_room_charm_rank) {
@@ -535,25 +540,25 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
if (type == 1) {
mBinding.llBz.setVisibility(View.GONE);
mBinding.llDs.setVisibility(View.VISIBLE);
mBinding.llJs.setVisibility(View.VISIBLE);
mBinding.llTiaoyt.setVisibility(View.GONE);
mBinding.llQg.setVisibility(View.VISIBLE);
mBinding.llSz.setVisibility(View.GONE);
} else if (type == 2) {
mBinding.llBz.setVisibility(View.VISIBLE);
mBinding.llDs.setVisibility(View.GONE);
mBinding.llJs.setVisibility(View.GONE);
mBinding.llTiaoyt.setVisibility(View.VISIBLE);
mBinding.llQg.setVisibility(View.VISIBLE);
mBinding.llSz.setVisibility(View.GONE);
} else if (type == 3) {
mBinding.llBz.setVisibility(View.GONE);
mBinding.llDs.setVisibility(View.VISIBLE);
mBinding.llJs.setVisibility(View.GONE);
mBinding.llTiaoyt.setVisibility(View.GONE);
mBinding.llQg.setVisibility(View.GONE);
mBinding.llSz.setVisibility(View.GONE);
} else if (type == 4) {
mBinding.llBz.setVisibility(View.VISIBLE);
mBinding.llDs.setVisibility(View.GONE);
mBinding.llJs.setVisibility(View.VISIBLE);
mBinding.llTiaoyt.setVisibility(View.VISIBLE);
mBinding.llQg.setVisibility(View.VISIBLE);
mBinding.llSz.setVisibility(View.GONE);
@@ -562,8 +567,9 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
private void onClick(View view) {
int id = view.getId();
if (id == R.id.ll_js) {
MvpPre.endSong(roomInfoResp.getRoom_info().getRoom_id());
if (id == R.id.ll_tiaoyt) {
// MvpPre.endSong(roomInfoResp.getRoom_info().getRoom_id());
TunerDialogFragment.show(roomInfoResp.getRoom_info().getRoom_id(), getChildFragmentManager());
} else if (id == R.id.ll_sz) {
} else if (id == R.id.ll_qg) {
@@ -590,11 +596,13 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
mBinding.imBz.setImageResource(com.xscm.moduleutil.R.mipmap.accompany_on);
mBinding.tvBz.setText("原唱");
isRotate = false;
volumeManager.saveBz(SpUtil.getUserId()+"",true);
} else {
AgoraManager.getInstance(getActivity()).selectAudioTrack(1);
mBinding.imBz.setImageResource(com.xscm.moduleutil.R.mipmap.accompany_off);
mBinding.tvBz.setText("伴奏");
isRotate = true;
volumeManager.saveBz(SpUtil.getUserId()+"",false);
}
}
}
@@ -636,8 +644,10 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
@Subscribe(threadMode = ThreadMode.MAIN)
public void roomInfoEvent(MusicFileBean messageEvent) {
LogUtils.e("roomInfoEvent", messageEvent.getFileData());
LyricsModel mLyricsModel = KaraokeView.parseLyricsData(messageEvent.getFileData());
if (mLyricsModel != null) {
setBz();
mKaraokeView.setLyricsData(mLyricsModel);
mBinding.lyricsView.setVisibility(View.VISIBLE);
mBinding.tvJz.setVisibility(View.GONE);
@@ -690,6 +700,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
}
} else if (messageEvent.getText().getAction() == 2) {//切歌
if (messageEvent.getText().getSongInfo() != null) {
musicSongBean = messageEvent.getText().getSongInfo();
did = messageEvent.getText().getSongInfo().getDid();
duration = messageEvent.getText().getSongInfo().getDuration();
@@ -712,12 +723,16 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
// AgoraManager.getInstance(getActivity()).setmSongCode(0);
if (messageEvent.getText().getSongInfo().getUser_id().equals(SpUtil.getUserId() + "")) {
AgoraManager.getInstance(getActivity());
AgoraManager.stopMuisc();
LogUtils.e("推送过来的code", messageEvent.getText().getSongInfo().getSong_code());
AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(messageEvent.getText().getSongInfo().getSong_code()), 1);
setAgorVolumes();
} else {
volumeManager.saveBz(SpUtil.getUserId()+"",true);
volumeManager.clearCurrentVolumes();
// AgoraManager.getInstance(getActivity()).stopMuisc();
if (AgoraManager.getInstance(getActivity()).isOnJoin()) {
@@ -735,15 +750,8 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
if (roomInfoResp.getUser_info().getPit_number() > 0) {
} else {
// if (mBinding.muZc.pitBean.getUser_id().equals(SpUtil.getUserId() + "")) {
// ((RoomActivity) getActivity()).setRoleType(2, -1);
// ((RoomActivity) getActivity()).switchMic(2);
// } else {
((RoomActivity) getActivity()).setRoleType(0, 0);
((RoomActivity) getActivity()).switchMic(2);
// }
}
}
}
@@ -760,6 +768,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
((RoomActivity) getActivity()).setRoleType(0, 0);
did = "";
mBinding.muName.setText("");
volumeManager.clearCurrentVolumes();
}
if (messageEvent.getText().getNextInfo() != null) {
mBinding.muXName.setText(messageEvent.getText().getNextInfo().getSong_name());
@@ -899,29 +908,6 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
// 更新麦位列表数据
adapter.setNewData(roomInfoResp.getSong_pit_list());
// RoomPitBean pitBean = mBinding.muYc.pitBean;
// if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(pitBean.getUser_id())) {
// pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.muYc.setCharm(pitBean.getCharm());
// }
//
// if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(mBinding.muZc.pitBean.getUser_id())) {
// mBinding.muZc.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.muZc.setCharm(mBinding.muZc.pitBean.getCharm());
// return;
// }
// if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(mBinding.muJb.pitBean.getUser_id())) {
// mBinding.muJb.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.muJb.setCharm(mBinding.muJb.pitBean.getCharm());
// return;
// }
// for (int i = 0; i < roomInfoResp.getSong_pit_list().size(); i++) {
// if (roomInfoResp.getSong_pit_list().get(i).getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
// roomInfoResp.getSong_pit_list().get(i).setCharm(messageEvent.getText().getToUserInfo().getCharm());
// }
// }
// adapter.setNewData(roomInfoResp.getSong_pit_list());
}
/**
@@ -1063,261 +1049,6 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
adapter.setNewData(roomInfoResp.getSong_pit_list());
}
// public void roomInfoEvent(RoomMessageEvent messageEvent) {
// boolean b = false;
// RoomFragment parentFragment = (RoomFragment) getParentFragment();
// if (messageEvent.getMsgType() == 1013) {
// LogUtils.e("@@", messageEvent);
// if (messageEvent.getText().getAction() == 3) {//下一首变化
// if (messageEvent.getText().getNextInfo() != null) {
// mBinding.muXName.setText(messageEvent.getText().getNextInfo().getSong_name());
// } else {
// mBinding.muXName.setText("暂无歌曲");
// }
// } else if (messageEvent.getText().getAction() == 2) {//切歌
// if (messageEvent.getText().getSongInfo() != null) {
// musicSongBean = messageEvent.getText().getSongInfo();
// did = messageEvent.getText().getSongInfo().getDid();
// duration = messageEvent.getText().getSongInfo().getDuration();
// mBinding.muName.setText(messageEvent.getText().getSongInfo().getSong_name());
// ImageUtils.loadHeadCC(messageEvent.getText().getSongInfo().getPoster(), mBinding.musicPoster);
// ImageUtils.loadHeadCC(messageEvent.getText().getSongInfo().getPoster(), mBinding.muBj);
// RoomKtvWheatView roomDefaultWheatView = mBinding.muYc;
// RoomPitBean pitBean = new RoomPitBean();
// pitBean.setPit_number("-1");
// pitBean.setAvatar(messageEvent.getText().getSongInfo().getAvatar());
// pitBean.setNickname(messageEvent.getText().getSongInfo().getNickname());
// pitBean.setUser_id(messageEvent.getText().getSongInfo().getUser_id());
// pitBean.setCharm(messageEvent.getText().getSongInfo().getCharm());
// roomDefaultWheatView.setData(pitBean);
// roomInfoResp.setSong_user_info(musicSongBean);
//
// if (messageEvent.getText().getSongInfo().getUser_id().equals(SpUtil.getUserId() + "")) {
// AgoraManager.getInstance(getActivity()).stopMuisc();
// LogUtils.e("推送过来的code", messageEvent.getText().getSongInfo().getSong_code());
// AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(messageEvent.getText().getSongInfo().getSong_code()), 1);
//
// } else {
// AgoraManager.getInstance(getActivity()).stopMuisc();
// AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(messageEvent.getText().getSongInfo().getSong_code()), 2);
// }
// if (getActivity() instanceof RoomActivity) {
//// if (parentFragment != null) {
// if (messageEvent.getText().getSongInfo().getUser_id().equals(SpUtil.getUserId() + "")) {
//// parentFragment.setRoleType(3, -1);
//// parentFragment.switchMic(1);
//
// ((RoomActivity) getActivity()).setRoleType(3, -1);
// ((RoomActivity) getActivity()).switchMic(1);
//
// } else {
// if (mBinding.muZc.pitBean.getUser_id().equals(SpUtil.getUserId() + "")) {
//// parentFragment.setRoleType(2, -1);
//// parentFragment.switchMic(2);
// ((RoomActivity) getActivity()).setRoleType(2, -1);
// ((RoomActivity) getActivity()).switchMic(2);
// } else {
//// parentFragment.setRoleType(0, 0);
//// parentFragment.switchMic(2);
// ((RoomActivity) getActivity()).setRoleType(0, 0);
// ((RoomActivity) getActivity()).switchMic(2);
// }
// }
// }
//
//// if (roomInfoResp.getUser_info().getIs_host() == 1 && roomInfoResp.getUser_info().getPit_number() == 9) {
//// setVisibilityView(1);
//// } else if (messageEvent.getText().getSongInfo().getUser_id().equals(SpUtil.getUserId() + "") && roomInfoResp.getUser_info().getIs_host() == 1 && roomInfoResp.getUser_info().getPit_number() == 9) {
//// setVisibilityView(1);
//// } else if (messageEvent.getText().getSongInfo().getUser_id().equals(SpUtil.getUserId() + "")) {
//// setVisibilityView(2);
//// } else if (roomInfoResp.getUser_info().getIs_host() == 1 && roomInfoResp.getUser_info().getPit_number() == 9) {
//// setVisibilityView(1);
//// } else {
//// setVisibilityView(3);
//// }
//
// } else {
// did = "";
// mBinding.muName.setText("无");
// }
// if (messageEvent.getText().getNextInfo() != null) {
// mBinding.muXName.setText(messageEvent.getText().getNextInfo().getSong_name());
// } else {
// mBinding.muXName.setText("无");
// }
//// if (parentFragment != null) {
//// parentFragment.mus();
//// }
// }
// sv();
// } else if (messageEvent.getMsgType() == 1003) {
//
// if (messageEvent.getText().getPit_number().equals("9") || messageEvent.getText().getPit_number().equals("10")) {
//
// RoomPitBean pitBean = new RoomPitBean();
// pitBean.setPit_number(messageEvent.getText().getPit_number());
// pitBean.setUser_id(messageEvent.getText().getFromUserInfo().getUser_id() + "");
// pitBean.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
// pitBean.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
// pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
// pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
// pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
//
// if (pitBean.getPit_number().equals("9")) {
// RoomKtvWheatView roomDefaultWheatView = mBinding.muZc;
// roomDefaultWheatView.setData(pitBean);
// } else if (pitBean.getPit_number().equals("10")) {
// RoomKtvWheatView roomDefaultWheatView = mBinding.muJb;
// roomDefaultWheatView.setData(pitBean);
// }
// if (SpUtil.getUserId() == messageEvent.getText().getFromUserInfo().getUser_id()) {
// b = true;
// AgoraManager.getInstance(getActivity()).ClientRole(true);
// AgoraManager.getInstance(getActivity()).muteLocalAudioStream(false);
// } else {
// b = false;
// }
// if (parentFragment != null) {
// parentFragment.updateWheatStatus(pitBean, Integer.parseInt(pitBean.getPit_number()), true, b);
// }
// } else {
// RoomPitBean pitBean = new RoomPitBean();
// pitBean.setPit_number(messageEvent.getText().getPit_number());
// pitBean.setUser_id(messageEvent.getText().getFromUserInfo().getUser_id() + "");
// pitBean.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
// pitBean.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
// pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
// pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
// pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
// roomInfoResp.getSong_pit_list().add(pitBean);
// }
// adapter.setNewData(roomInfoResp.getSong_pit_list());
// sv();
// } else if (messageEvent.getMsgType() == 1004) {
//
// if (messageEvent.getText().getPit_number().equals("9") || messageEvent.getText().getPit_number().equals("10")) {
// RoomPitBean pitBean = new RoomPitBean();
// pitBean.setPit_number(messageEvent.getText().getPit_number());
// pitBean.setUser_id("");
// pitBean.setAvatar("");
// pitBean.setNickname("");
// pitBean.setSex("");
// pitBean.setCharm("");
// if (pitBean.getPit_number().equals("9")) {
// RoomKtvWheatView roomDefaultWheatView = mBinding.muZc;
// roomDefaultWheatView.setData(pitBean);
// } else if (pitBean.getPit_number().equals("10")) {
// RoomKtvWheatView roomDefaultWheatView = mBinding.muJb;
// roomDefaultWheatView.setData(pitBean);
// }
// if (SpUtil.getUserId() == messageEvent.getText().getFromUserInfo().getUser_id()) {
// b = true;
// AgoraManager.getInstance(getActivity()).ClientRole(false);
// AgoraManager.getInstance(getActivity()).muteLocalAudioStream(true);
// } else {
// b = false;
// }
//// AgoraManager.getInstance(getActivity()).setEnableAudio(b);
// if (parentFragment != null) {
// parentFragment.updateWheatStatus(pitBean, Integer.parseInt(messageEvent.getText().getPit_number()), false, b);
// }
// } else {
// for (int i = 0; i < roomInfoResp.getSong_pit_list().size(); i++) {
// if (roomInfoResp.getSong_pit_list().get(i).getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
// roomInfoResp.getSong_pit_list().remove(i);
// break;
// }
// }
// adapter.setNewData(roomInfoResp.getSong_pit_list());
// }
// sv();
// } else if (messageEvent.getMsgType() == 1019) {
//// RoomCharmRankBean charmRankBean=messageEvent.getText().getUserCharmList().get(0);
//// RoomPitBean pitBean=mBinding.muYc.pitBean;
//// pitBean.setCharm(charmRankBean.getCharm());
//// mBinding.muYc.setData(pitBean);
// LogUtils.e("1019", messageEvent);
//// adapter.setNewData(messageEvent.getText().getUserCharmList());
// } else if (messageEvent.getMsgType() == 1021) {
// RoomPitBean pitBean = mBinding.muYc.pitBean;
// pitBean.setCharm("0");
// mBinding.muYc.setData(pitBean);
// pitBean = mBinding.muZc.pitBean;
// pitBean.setCharm("0");
// mBinding.muZc.setData(pitBean);
// pitBean = mBinding.muJb.pitBean;
// pitBean.setCharm("0");
// mBinding.muJb.setData(pitBean);
//
// for (int i = 0; i < roomInfoResp.getSong_pit_list().size(); i++) {
// roomInfoResp.getSong_pit_list().get(i).setCharm("0");
// }
// adapter.setNewData(roomInfoResp.getSong_pit_list());
//
// } else if (messageEvent.getMsgType() == 1005) {
// RoomPitBean pitBean = mBinding.muYc.pitBean;
// if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(pitBean.getUser_id())) {
// pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.muYc.setData(pitBean);
// }
//
// if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(mBinding.muZc.pitBean.getUser_id())) {
// mBinding.muZc.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.muZc.setData(mBinding.muZc.pitBean);
// return;
// }
// if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(mBinding.muJb.pitBean.getUser_id())) {
// mBinding.muJb.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.muJb.setData(mBinding.muJb.pitBean);
// return;
// }
// for (int i = 0; i < roomInfoResp.getSong_pit_list().size(); i++) {
// if (roomInfoResp.getSong_pit_list().get(i).getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
// roomInfoResp.getSong_pit_list().get(i).setCharm(messageEvent.getText().getToUserInfo().getCharm());
// }
// }
// adapter.setNewData(roomInfoResp.getSong_pit_list());
// } else if (messageEvent.getMsgType() == 1035) {
// RoomPitBean pitBean = mBinding.muZc.pitBean;
// if (pitBean.getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
// pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
// pitBean.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
// pitBean.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
// pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
// pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
// mBinding.muZc.setData(pitBean);
// }
// RoomPitBean pitBean1 = mBinding.muJb.pitBean;
// if (pitBean1.getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
// pitBean1.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
// pitBean1.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
// pitBean1.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
// pitBean1.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
// pitBean1.setDress(messageEvent.getText().getFromUserInfo().getDress());
// mBinding.muJb.setData(pitBean1);
// }
// RoomPitBean pitBean2 = mBinding.muYc.pitBean;
// if (pitBean2.getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
// pitBean2.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
// pitBean2.setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
// pitBean2.setNickname(messageEvent.getText().getFromUserInfo().getNickname());
// pitBean2.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
// pitBean2.setDress(messageEvent.getText().getFromUserInfo().getDress());
// mBinding.muYc.setData(pitBean2);
// }
// for (int i = 0; i < roomInfoResp.getSong_pit_list().size(); i++) {
// if (roomInfoResp.getSong_pit_list().get(i).getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
// roomInfoResp.getSong_pit_list().get(i).setCharm(messageEvent.getText().getFromUserInfo().getCharm());
// roomInfoResp.getSong_pit_list().get(i).setAvatar(messageEvent.getText().getFromUserInfo().getAvatar());
// roomInfoResp.getSong_pit_list().get(i).setNickname(messageEvent.getText().getFromUserInfo().getNickname());
// roomInfoResp.getSong_pit_list().get(i).setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
// roomInfoResp.getSong_pit_list().get(i).setDress(messageEvent.getText().getFromUserInfo().getDress());
// }
// }
// adapter.setNewData(roomInfoResp.getSong_pit_list());
// }
// }
@Override
public void roomInfo(RoomInfoResp resp) {

View File

@@ -1257,7 +1257,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
}
public void event1021(RoomMessageEvent message) {
if (roomInfoRespPk != null || roomInfoRespPk.getPk_info() != null) {
if (roomInfoRespPk != null && roomInfoRespPk.getPk_info() != null) {
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()){
pitBean.setCharm("0");
if (pitBean.getUser_id()!=null && !pitBean.getUser_id().isEmpty() && !pitBean.getUser_id().equals("0")) {

View File

@@ -11,6 +11,7 @@ import com.xscm.moduleutil.presenter.BasePresenter;
import java.lang.ref.WeakReference;
import io.reactivex.disposables.Disposable;
import org.jetbrains.annotations.NotNull;
public class RoomSettingPresenter extends BasePresenter<RoomSettingContacts.View> implements RoomSettingContacts.IRoomPre{
RoomSettingContacts.View mView;
@@ -70,4 +71,25 @@ public class RoomSettingPresenter extends BasePresenter<RoomSettingContacts.View
}
});
}
@Override
public void agreeSong(String roomId, String type) {
if (api== null){
api = RetrofitClient.getInstance();
}
api.agreeSong(roomId, type, new BaseObserver<String>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
}
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().agreeSong(s);
}
});
}
}

View File

@@ -192,10 +192,10 @@
<ImageView
android:id="@+id/im_bz"
android:layout_width="@dimen/dp_13"
android:layout_height="@dimen/dp_16"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_gravity="center"
android:src="@mipmap/accompany_on"/>
android:src="@mipmap/accompany_off"/>
<TextView
android:id="@+id/tv_bz"
@@ -217,8 +217,8 @@
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_13"
android:layout_height="@dimen/dp_16"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_gravity="center"
android:src="@mipmap/muisc_reward"/>
@@ -228,7 +228,7 @@
android:layout_gravity="center"
android:gravity="center"
android:text="打赏"
android:textColor="@color/colorPrimary"
android:textColor="@color/color_EFEFEF"
android:textSize="@dimen/sp_10"/>
</LinearLayout>
@@ -241,8 +241,8 @@
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_13"
android:layout_height="@dimen/dp_16"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_gravity="center"
android:src="@mipmap/muisc_switch"/>
@@ -252,12 +252,12 @@
android:layout_gravity="center"
android:gravity="center"
android:text="切歌"
android:textColor="@color/colorPrimary"
android:textColor="@color/color_EFEFEF"
android:textSize="@dimen/sp_10"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_js"
android:id="@+id/ll_tiaoyt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -265,18 +265,18 @@
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_13"
android:layout_height="@dimen/dp_16"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_gravity="center"
android:src="@mipmap/muisc_end"/>
android:src="@mipmap/muisc_tyt"/>
<TextView
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_14"
android:layout_gravity="center"
android:gravity="center"
android:text="结束"
android:textColor="@color/colorPrimary"
android:text="调音台"
android:textColor="@color/color_EFEFEF"
android:textSize="@dimen/sp_10"/>
</LinearLayout>

View File

@@ -0,0 +1,26 @@
package com.example.moduletablayout;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.moduletablayout", appContext.getPackageName());
}
}

View File

@@ -0,0 +1,17 @@
package com.example.moduletablayout;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@@ -63,3 +63,4 @@ include ':tuicore'
include ':moduleroom'
include ':Loadinglibrary'

View File

@@ -119,7 +119,7 @@ public class TUIC2CChatFragment extends TUIBaseChatFragment {
@Override
public boolean onMenuItemClick(android.view.MenuItem item) {
if ("举报".equals(item.getTitle())) {
ARouter.getInstance().build("/moduleUtil/WebViewActivity").withString("url", "https://vespa.qxyushen.top/h5/web/index.html#/pages/feedback/report?id=?id="+getToken()+"&fromType=1&fromId="+ getUserInfo().getUser_id()).navigation();
ARouter.getInstance().build("/moduleUtil/WebViewActivity").withString("url", "https://vespa.qxyushen.top/h5/web/index.html#/pages/feedback/report?id="+getToken()+"&fromType=1&fromId="+ getUserInfo().getUser_id()).navigation();
return true;
}
return false;