代码合并 至 2025.11.3 20:29
@@ -3,15 +3,9 @@ agp = "8.4.0"
|
||||
alipayAlipaysdkAndroid = "15.8.33"
|
||||
arouterApiVersion = "1.5.2"
|
||||
comJacktuotuoCustomviewVerificationcodeview2 = "1.0.5"
|
||||
comLiulishuoOkdownloadOkdownload4 = "1.0.7"
|
||||
comLiulishuoOkdownloadSqlite3 = "1.0.7"
|
||||
comLiulishuoOkdownloadOkhttp3 = "1.0.7"
|
||||
comLiulishuoOkdownloadFiledownloader3 = "1.0.7"
|
||||
custompopwindow = "2.1.1"
|
||||
databindingRuntimeVersion = "7.0.2"
|
||||
easypermissions = "3.0.0"
|
||||
easyProtectorRelease = "1.1.2"
|
||||
egameAnimplayer = "2.0.8"
|
||||
flexboxVersion = "1.0.0"
|
||||
githubBannerviewpagerVersion = "3.5.12"
|
||||
githubGlide = "4.12.0"
|
||||
@@ -20,28 +14,23 @@ githubPhotoview = "2.3.0"
|
||||
githubRealtimeblurviewVersion = "1.2.1"
|
||||
githubShadowlayout = "3.3.1"
|
||||
gradle = "8.8.0"
|
||||
#gradle = "8.5.0-alpha04"
|
||||
greendaoGradlePlugin = "3.3.0"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.1.5"
|
||||
espressoCore = "3.5.1"
|
||||
appcompat = "1.6.1"
|
||||
libraryVersion = "1.4"
|
||||
lombok = "1.18.32"
|
||||
marqueeview = "1.1.0"
|
||||
material = "1.10.0"
|
||||
activity = "1.8.0"
|
||||
constraintlayout = "2.1.4"
|
||||
arouter = "1.0.2"
|
||||
|
||||
arouterAnnotation = "1.0.6"
|
||||
arouterCompiler = "1.5.2"
|
||||
arouterApi = "1.5.2"
|
||||
comSquareupRetrofit2Retrofit3 = "2.9.0"
|
||||
fastjson = "1.2.60"
|
||||
githubBaserecyclerviewadapterhelper = "2.9.50"
|
||||
gsonVersion = "2.10.1"
|
||||
eventbusAnnotationProcessorVersion = "3.3.1"
|
||||
eventbusVersion = "3.3.1"
|
||||
logger = "2.2.0"
|
||||
loggingInterceptorVersion = "3.10.0"
|
||||
@@ -49,35 +38,25 @@ multidex = "2.0.1"
|
||||
ossAndroidSdkVersion = "2.9.21"
|
||||
permissionx = "1.7.1"
|
||||
persistentcookiejar = "v1.0.1"
|
||||
picture_libraryVersion = "v2.6.0"
|
||||
reactivexRxjava = "2.2.21"
|
||||
retrofit2KotlinCoroutinesAdapterVersion = "0.9.2"
|
||||
roundedimageview = "2.3.0"
|
||||
rxandroid = "2.1.1"
|
||||
scwangSmartrefreshlayout = "1.1.0-alpha-20"
|
||||
scwangSmartrefreshheader = "1.1.0-alpha-20"
|
||||
singledateandtimepicker = "2.2.7"
|
||||
svgaplayerAndroid = "2.5.13"
|
||||
toastVersion = "8.2"
|
||||
togglebuttonLibraryVersion = "1.0.0"
|
||||
utilcode = "1.30.6"
|
||||
databindingRuntime = "8.8.0"
|
||||
datastoreCoreAndroid = "1.1.5"
|
||||
kotlin = "2.0.0"
|
||||
lifecycleRuntimeKtx = "2.6.1"
|
||||
activityCompose = "1.8.0"
|
||||
composeBom = "2024.04.01"
|
||||
kotlinVersion = "1.9.24"
|
||||
coreKtx = "1.10.1"
|
||||
lifecycleLivedataKtx = "2.6.1"
|
||||
lifecycleViewmodelKtx = "2.6.1"
|
||||
webpdecoder = "1.6.4.9.0"
|
||||
wechatSdkAndroid = "6.8.30"
|
||||
xbanner = "1.7.0"
|
||||
appcompatVersion = "1.3.1"
|
||||
legacySupportV4 = "1.0.0"
|
||||
fragmentKtx = "1.5.6"
|
||||
cosAndroidLite = "5.9.46"
|
||||
interpolator = "1.0.0"
|
||||
|
||||
[libraries]
|
||||
@@ -89,19 +68,12 @@ com-github-bumptech-glide-glide = { module = "com.github.bumptech.glide:glide",
|
||||
com-github-mmin18-realtimeblurview = { module = "com.github.mmin18:realtimeblurview", version.ref = "githubRealtimeblurviewVersion" }
|
||||
com-github-zhpanvip-bannerviewpager = { module = "com.github.zhpanvip:bannerviewpager", version.ref = "githubBannerviewpagerVersion" }
|
||||
com-jacktuotuo-customview-verificationcodeview3 = { module = "com.jacktuotuo.customview:verificationcodeview", version.ref = "comJacktuotuoCustomviewVerificationcodeview2" }
|
||||
#com-liulishuo-okdownload-filedownloader4 = { module = "com.liulishuo.okdownload:filedownloader", version.ref = "comLiulishuoOkdownloadFiledownloader3" }
|
||||
#com-liulishuo-okdownload-okhttp4 = { module = "com.liulishuo.okdownload:okhttp", version.ref = "comLiulishuoOkdownloadOkhttp3" }
|
||||
#com-liulishuo-okdownload-sqlite4 = { module = "com.liulishuo.okdownload:sqlite", version.ref = "comLiulishuoOkdownloadSqlite3" }
|
||||
#com-liulishuo-okdownload-okdownload6 = { module = "com.liulishuo.okdownload:okdownload", version.ref = "comLiulishuoOkdownloadOkdownload4" }
|
||||
#custompopwindow = { module = "com.github.pinguo-zhouwei:CustomPopwindow", version.ref = "custompopwindow" }
|
||||
databinding-runtime-v702 = { module = "androidx.databinding:databinding-runtime", version.ref = "databindingRuntimeVersion" }
|
||||
dpa-oss-android-sdk = { module = "com.aliyun.dpa:oss-android-sdk", version.ref = "ossAndroidSdkVersion" }
|
||||
easy-protector-release = { module = "com.lahm.library:easy-protector-release", version.ref = "easyProtectorRelease" }
|
||||
easypermissions = { module = "pub.devrel:easypermissions", version.ref = "easypermissions" }
|
||||
#egame-animplayer = { module = "com.egame.vap:animplayer", version.ref = "egameAnimplayer" }
|
||||
github-photoview = { module = "com.github.chrisbanes:PhotoView", version.ref = "githubPhotoview" }
|
||||
github-shadowlayout = { module = "com.github.lihangleo2:ShadowLayout", version.ref = "githubShadowlayout" }
|
||||
#glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "githubGlide" }
|
||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
|
||||
greendao-gradle-plugin = { module = "org.greenrobot:greendao-gradle-plugin", version.ref = "greendaoGradlePlugin" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
@@ -113,7 +85,6 @@ marqueeview = { module = "com.sunfusheng:marqueeview", version.ref = "marqueevie
|
||||
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
|
||||
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
|
||||
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
|
||||
#arouter-api = { module = "com.alibaba:arouter-api", version.ref = "arouterApi" }
|
||||
arouter-compiler = { module = "com.alibaba:arouter-compiler", version.ref = "arouterCompiler" }
|
||||
arouter-annotation = { module = "com.alibaba:arouter-annotation", version.ref = "arouterAnnotation" }
|
||||
com-scwang-smartrefresh-smartrefreshheader = { module = "com.scwang.smartrefresh:SmartRefreshHeader", version.ref = "scwangSmartrefreshheader" }
|
||||
@@ -124,39 +95,22 @@ github-baserecyclerviewadapterhelper = { module = "com.github.CymChad:BaseRecycl
|
||||
hjq-toast = { module = "com.hjq:toast", version.ref = "toastVersion" }
|
||||
jakewharton-retrofit2-kotlin-coroutines-adapter = { module = "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter", version.ref = "retrofit2KotlinCoroutinesAdapterVersion" }
|
||||
greenrobot-eventbus = { module = "org.greenrobot:eventbus", version.ref = "eventbusVersion" }
|
||||
#greenrobot-eventbus-annotation-processor = { module = "org.greenrobot:eventbus-annotation-processor", version.ref = "eventbusAnnotationProcessorVersion" }
|
||||
google-gson = { module = "com.google.code.gson:gson", version.ref = "gsonVersion" }
|
||||
logger = { module = "com.orhanobut:logger", version.ref = "logger" }
|
||||
multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
|
||||
#numberprogressbar-library = { module = "com.daimajia.numberprogressbar:library", version.ref = "libraryVersion" }
|
||||
okhttp3-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "loggingInterceptorVersion" }
|
||||
permissionx = { module = "com.guolindev.permissionx:permissionx", version.ref = "permissionx" }
|
||||
persistentcookiejar = { module = "com.github.franmontiel:PersistentCookieJar", version.ref = "persistentcookiejar" }
|
||||
#pictureselector-picture_library = { module = "com.github.LuckSiege.PictureSelector:picture_library", version.ref = "picture_libraryVersion" }
|
||||
reactivex-rxjava = { module = "io.reactivex.rxjava2:rxjava", version.ref = "reactivexRxjava" }
|
||||
roundedimageview = { module = "com.makeramen:roundedimageview", version.ref = "roundedimageview" }
|
||||
rxandroid = { module = "io.reactivex.rxjava2:rxandroid", version.ref = "rxandroid" }
|
||||
#singledateandtimepicker = { module = "com.github.florent37:singledateandtimepicker", version.ref = "singledateandtimepicker" }
|
||||
squareup-converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "comSquareupRetrofit2Retrofit3" }
|
||||
retrofit2-adapter-rxjava2 = { module = "com.squareup.retrofit2:adapter-rxjava2", version.ref = "comSquareupRetrofit2Retrofit3" }
|
||||
svgaplayer-android = { module = "com.github.yyued:SVGAPlayer-Android", version.ref = "svgaplayerAndroid" }
|
||||
utilcode = { module = "com.blankj:utilcode", version.ref = "utilcode" }
|
||||
#databinding-runtime = { group = "androidx.databinding", name = "databinding-runtime", version.ref = "databindingRuntime" }
|
||||
#datastore-core-android = { group = "androidx.datastore", name = "datastore-core-android", version.ref = "datastoreCoreAndroid" }
|
||||
#lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
||||
#activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
||||
#compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
||||
#ui = { group = "androidx.compose.ui", name = "ui" }
|
||||
#ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
||||
#ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
|
||||
#ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
||||
#ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
|
||||
#ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
||||
#material3 = { group = "androidx.compose.material3", name = "material3" }
|
||||
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycleLivedataKtx" }
|
||||
lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" }
|
||||
#webpdecoder = { module = "com.zlc.glide:webpdecoder", version.ref = "webpdecoder" }
|
||||
wechat-sdk-android = { module = "com.tencent.mm.opensdk:wechat-sdk-android", version.ref = "wechatSdkAndroid" }
|
||||
xbanner = { module = "com.github.xiaohaibin:XBanner", version.ref = "xbanner" }
|
||||
zcw-togglebutton-library = { module = "com.zcw:togglebutton-library", version.ref = "togglebuttonLibraryVersion" }
|
||||
@@ -170,8 +124,6 @@ androidx-interpolator = { group = "androidx.interpolator", name = "interpolator"
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
android-library = { id = "com.android.library", version.ref = "agp" }
|
||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVersion" }
|
||||
#kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinVersion" }
|
||||
#alibaba-arouter = { id = "com.alibaba.arouter", version.ref = "arouter" }
|
||||
greendao-plugin = { id = "org.greenrobot.greendao", version.ref = "greendaoGradlePlugin" }
|
||||
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlinVersion" }
|
||||
kotlin-android-extensions = { id = "org.jetbrains.kotlin.android.extensions", version.ref = "kotlinVersion" }
|
||||
|
||||
@@ -67,8 +67,6 @@ dependencies {
|
||||
implementation project(':moduletablayout')
|
||||
implementation libs.activity
|
||||
implementation libs.constraintlayout
|
||||
implementation libs.androidx.appcompat
|
||||
implementation libs.androidx.appcompat
|
||||
testImplementation libs.junit
|
||||
androidTestImplementation libs.ext.junit
|
||||
androidTestImplementation libs.espresso.core
|
||||
@@ -169,14 +167,15 @@ dependencies {
|
||||
|
||||
//播放器
|
||||
//腾讯直播sdk
|
||||
api('com.tencent.liteav:LiteAVSDK_Professional:10.9.0.13102')
|
||||
api('com.google.android.exoplayer:exoplayer-core:2.19.1')
|
||||
api('com.google.android.exoplayer:exoplayer-ui:2.19.1')
|
||||
// api('com.tencent.liteav:LiteAVSDK_Professional:10.9.0.13102')
|
||||
// api('com.google.android.exoplayer:exoplayer-core:2.19.1')
|
||||
// api('com.google.android.exoplayer:exoplayer-ui:2.19.1')
|
||||
api("com.egame.vap:animplayer:2.0.8")
|
||||
api("com.liulishuo.okdownload:okdownload:1.0.7")
|
||||
|
||||
api('com.zlc.glide:webpdecoder:1.6.4.9.0')
|
||||
api('com.jungly:gridPasswordView:0.3')
|
||||
// 带有气泡的提示框,目前没有使用,暂不使用,使用位置是在RoomTipsView
|
||||
api('com.cpiz.bubbleview:bubbleview:1.0.2')
|
||||
|
||||
// 集成音频 SDK声网
|
||||
|
||||
@@ -165,7 +165,11 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
adjustFontScale(getResources().getConfiguration());
|
||||
CrashHandler.init(this);
|
||||
|
||||
|
||||
if (currentEnvironment.getShelf()==1){
|
||||
if (SpUtil.getShelf()!=1) {
|
||||
SpUtil.setShelf(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void adjustFontScale(Configuration configuration) {
|
||||
@@ -438,7 +442,7 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
initARouter();
|
||||
if (SpUtil.isAgreePolicy()) {
|
||||
checkInEmulator();
|
||||
UtilConfig.checkInEmulator();
|
||||
// UtilConfig.checkInEmulator();
|
||||
AgoraManager.getInstance(this);
|
||||
AgoraManager.init(currentEnvironment.getSwSdkAppId());
|
||||
MessageListenerSingleton.getInstance();
|
||||
|
||||
@@ -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;
|
||||
|
||||
/// 常用工具
|
||||
/// 房间补贴
|
||||
|
||||
@@ -72,16 +72,50 @@ public class MessageListenerSingleton {
|
||||
|
||||
private List<PublicScreenMessageListener> publicScreenListeners = new ArrayList<>();
|
||||
|
||||
// 添加监听器
|
||||
// 添加监听器 // 替换原有的 addPublicScreenMessageListener 方法
|
||||
public void addPublicScreenMessageListener(PublicScreenMessageListener listener) {
|
||||
if (listener == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (publicScreenListeners) {
|
||||
if (!publicScreenListeners.contains(listener)) {
|
||||
try {
|
||||
publicScreenListeners.add(listener);
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("MessageListener", "添加 PublicScreenMessageListener 失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 移除监听器
|
||||
// 同时修改 removePublicScreenMessageListener 方法
|
||||
public void removePublicScreenMessageListener(PublicScreenMessageListener listener) {
|
||||
if (listener == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (publicScreenListeners) {
|
||||
try {
|
||||
publicScreenListeners.remove(listener);
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("MessageListener", "移除 PublicScreenMessageListener 失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 修改 notify 方法以增加保护
|
||||
private void notifyPublicScreenListeners(RoomMessageEvent message) {
|
||||
synchronized (publicScreenListeners) {
|
||||
// 创建副本以避免并发修改异常
|
||||
List<PublicScreenMessageListener> listenersCopy = new ArrayList<>(publicScreenListeners);
|
||||
for (PublicScreenMessageListener listener : listenersCopy) {
|
||||
try {
|
||||
listener.onPublicScreenMessageReceived(message);
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("MessageListener", "通知 PublicScreenMessageListener 失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private MessageListenerSingleton() {
|
||||
|
||||
@@ -362,6 +362,46 @@ public class AgoraManager {
|
||||
// 填入用于鉴权的 Token
|
||||
contentCenterConfiguration.token = SpUtil.getRtmToken();
|
||||
|
||||
// 创建 IAgoraMusicContentCenterEventHandler,用于 SDK 向客户端发送音乐内容中心事件通知
|
||||
// contentCenterConfiguration.eventHandler = new IMusicContentCenterEventHandler() {
|
||||
// @Override
|
||||
// public void onPreLoadEvent(String requestId, long songCode, int percent, String lyricUrl, int status, int errorCode) {
|
||||
// LogUtils.e("@@@1", "requestId: " + requestId + ", songCode: " + songCode + ", percent: " + percent + ", lyricUrl: " + lyricUrl + ", status: " + status + ", errorCode: " + errorCode);
|
||||
// if (!lyricUrl.isEmpty() && percent == 100 && !isBjMusic) {
|
||||
// getLyricsInstance(lyricUrl);
|
||||
// }
|
||||
//// musicPlayer.open(songCode, 0);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onMusicCollectionResult(String requestId, int page, int pageSize, int total, Music[] list, int errorCode) {
|
||||
// LogUtils.e("@@@2", "requestId: " + requestId + ", page: " + page + ", pageSize: " + pageSize + ", total: " + total);
|
||||
// MusicBean musicBean = new MusicBean();
|
||||
// musicBean.setMusicList(Arrays.asList(list));
|
||||
// musicBean.setPage(page);
|
||||
// EventBus.getDefault().post(musicBean);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onMusicChartsResult(String requestId, MusicChartInfo[] list, int errorCode) {
|
||||
// LogUtils.e("@@@", "requestId: " + requestId);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onLyricResult(String requestId, long songCode, String lyricUrl, int errorCode) {
|
||||
// LogUtils.e("@@@22", "requestId: " + requestId + ", songCode: " + songCode + ", lyricUrl: " + lyricUrl + ", errorCode: " + errorCode);
|
||||
// if (lyricUrl != null && !isBjMusic) {
|
||||
// getLyricsInstance(lyricUrl);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onSongSimpleInfoResult(String requestId, long songCode, String simpleInfo, int errorCode) {
|
||||
// LogUtils.e("@@@", "requestId: " + requestId + ", songCode: " + songCode + ", simpleInfo: " + simpleInfo + ", errorCode: " + errorCode);
|
||||
// }
|
||||
// };
|
||||
// 初始化 IAgoraMusicContentCenter
|
||||
|
||||
musicContentCenter.initialize(contentCenterConfiguration);
|
||||
if (musicPlayer != null) {
|
||||
musicPlayer = null;
|
||||
@@ -373,8 +413,15 @@ public class AgoraManager {
|
||||
if (state == 0) {
|
||||
musicPlayer.stop();
|
||||
musicPlayer.open(songCode, 0);
|
||||
// getLyricsInstance(lyricUrl);
|
||||
}
|
||||
LogUtils.e("AgoraManager", "isPreload2: " + songCode, "percent: " + percent);
|
||||
|
||||
// if (!lyricUrl.isEmpty() && percent == 100 && !isBjMusic) {
|
||||
// musicPlayer.stop();
|
||||
// musicPlayer.open(songCode, 0);
|
||||
//// getLyricsInstance(lyricUrl);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -426,12 +473,19 @@ public class AgoraManager {
|
||||
|
||||
@Override
|
||||
public void onUserJoined(int uid, int elapsed) {//远端用户加入频道
|
||||
// for (IRtcEngineEventHandler handler : eventHandlers) {
|
||||
// if (handler != null) {
|
||||
// handler.onUserJoined(uid, elapsed);
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
for (SoundLevelUpdateListener listener : soundLevelUpdateListeners) {
|
||||
if (listener != null) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
// 远程用户音量变化
|
||||
listener.userJoined(uid, elapsed);
|
||||
// }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -446,13 +500,19 @@ public class AgoraManager {
|
||||
|
||||
@Override
|
||||
public void onUserOffline(int uid, int reason) {//远端用户离开频道
|
||||
// for (IRtcEngineEventHandler handler : eventHandlers) {
|
||||
// if (handler != null) {
|
||||
// handler.onUserOffline(uid, reason);
|
||||
// }
|
||||
for (SoundLevelUpdateListener listener : soundLevelUpdateListeners) {
|
||||
if (listener != null) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
// 远程用户音量变化
|
||||
listener.userOffline(uid, reason);
|
||||
// }
|
||||
});
|
||||
}
|
||||
// }
|
||||
}
|
||||
SurfaceView renderView = null;
|
||||
rtcEngine.setupRemoteVideo(new VideoCanvas(null, Constants.RENDER_MODE_FIT, uid));
|
||||
@@ -475,6 +535,7 @@ public class AgoraManager {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
// 远程用户音量变化
|
||||
listener.onRemoteSoundLevelUpdate(uid > 0 ? String.valueOf(uid) : SpUtil.getUserId() + "", volume);
|
||||
// }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -644,8 +705,39 @@ public class AgoraManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void joinChannelEx(String token, String channelId, int uid,String pkUserIds) {
|
||||
if (rtcEngine == null) {
|
||||
init(CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId());
|
||||
}
|
||||
if (rtcEngine != null) {
|
||||
options.clientRoleType = Constants.CLIENT_ROLE_BROADCASTER;
|
||||
options.channelProfile = Constants.CHANNEL_PROFILE_LIVE_BROADCASTING;
|
||||
options.publishMicrophoneTrack = true; // 是否发布麦克风音频
|
||||
options.enableAudioRecordingOrPlayout = true;
|
||||
options.autoSubscribeAudio = true;
|
||||
connection = new RtcConnection();
|
||||
connection.channelId = channelId;
|
||||
connection.localUid = SpUtil.getUserId();
|
||||
pkRoomId = channelId;
|
||||
pkUserId = Integer.parseInt(pkUserIds);
|
||||
// rtcEngine.joinChannelEx(token, connection, options, getDefaultEventHandler());
|
||||
// muteAllRemoteAudioStreamsEx(true);
|
||||
// muteAllRemoteAudioStreamsExUserId(false);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveChannelEx(String mRoomId, int uid) {
|
||||
if (rtcEngine != null) {
|
||||
RtcConnection connection = new RtcConnection();
|
||||
connection.channelId = mRoomId;
|
||||
connection.localUid = uid;
|
||||
// rtcEngine.leaveChannelEx(connection);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateChannelMediaOptions() {
|
||||
|
||||
if (rtcEngine != null) {
|
||||
options.clientRoleType = Constants.CLIENT_ROLE_BROADCASTER;
|
||||
// options.autoSubscribeVideo = true;
|
||||
@@ -665,8 +757,30 @@ public class AgoraManager {
|
||||
|
||||
public void post() {
|
||||
if (rtcEngine != null) {
|
||||
// rtcEngine.setParameters("{\"che.video.mobile_1080p\":true}");
|
||||
// rtcEngine.setClientRole(Constants.CLIENT_ROLE_BROADCASTER);
|
||||
//
|
||||
// /*Enable video module*/
|
||||
// rtcEngine.enableVideo();
|
||||
// // Setup video encoding configs
|
||||
// rtcEngine.setVideoEncoderConfiguration(new VideoEncoderConfiguration(
|
||||
// VD_640x360,
|
||||
// FRAME_RATE_FPS_15,
|
||||
// STANDARD_BITRATE,
|
||||
// ORIENTATION_MODE_ADAPTIVE
|
||||
// ));
|
||||
// /*Set up to play remote sound with receiver*/
|
||||
// rtcEngine.setDefaultAudioRoutetoSpeakerphone(true);
|
||||
|
||||
ScreenCaptureParameters screenCaptureParameters = new ScreenCaptureParameters();
|
||||
// screenCaptureParameters.captureVideo = true;
|
||||
// screenCaptureParameters.videoCaptureParameters.width = 1440;
|
||||
// screenCaptureParameters.videoCaptureParameters.height = 1940;
|
||||
// screenCaptureParameters.videoCaptureParameters.framerate = 15;
|
||||
// screenCaptureParameters.captureAudio = true;
|
||||
// screenCaptureParameters.audioCaptureParameters.captureSignalVolume = 50;
|
||||
//// screenCaptureParameters.videoCaptureParameters.bitrate = 500;
|
||||
// rtcEngine.startScreenCapture(screenCaptureParameters);
|
||||
WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
Display display = manager.getDefaultDisplay();
|
||||
|
||||
@@ -693,6 +807,26 @@ public class AgoraManager {
|
||||
}
|
||||
|
||||
|
||||
public void setExternalMediaProjection(MediaProjection[] mediaProjection){
|
||||
rtcEngine.setExternalMediaProjection(mediaProjection[0]);
|
||||
}
|
||||
|
||||
public void isPost(){
|
||||
if (rtcEngine != null){
|
||||
ScreenCaptureParameters screenCaptureParameters = new ScreenCaptureParameters();
|
||||
|
||||
// 设置新的屏幕共享参数
|
||||
screenCaptureParameters.captureVideo = true;
|
||||
screenCaptureParameters.videoCaptureParameters.width = 1280;
|
||||
screenCaptureParameters.videoCaptureParameters.height = 720;
|
||||
screenCaptureParameters.videoCaptureParameters.framerate = 30;
|
||||
|
||||
// 更新屏幕共享参数
|
||||
rtcEngine.updateScreenCaptureParameters(screenCaptureParameters);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void isMute(int index) {
|
||||
if (rtcEngine != null) {
|
||||
}
|
||||
@@ -704,6 +838,13 @@ public class AgoraManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void stopMusicPlayer() {
|
||||
if (musicPlayer != null) {
|
||||
musicPlayer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 完全销毁实例(只在应用退出时调用)
|
||||
*/
|
||||
@@ -826,6 +967,23 @@ public class AgoraManager {
|
||||
return isLocalAudioEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加事件监听器(用于全局回调)
|
||||
*/
|
||||
// public void addEventHandler(IRtcEngineEventHandler handler) {
|
||||
// if (handler != null && !eventHandlers.contains(handler)) {
|
||||
// eventHandlers.add(handler);
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 移除事件监听器
|
||||
*/
|
||||
// public void removeEventHandler(IRtcEngineEventHandler handler) {
|
||||
// if (handler != null) {
|
||||
// eventHandlers.remove(handler);
|
||||
// }
|
||||
// }
|
||||
public void addSoundLevelListener(SoundLevelUpdateListener listener) {
|
||||
if (soundLevelUpdateListeners != null) {
|
||||
soundLevelUpdateListeners.add(listener);
|
||||
@@ -838,12 +996,6 @@ public class AgoraManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void removeAllSoundLevelListener() {
|
||||
if (soundLevelUpdateListeners != null) {
|
||||
soundLevelUpdateListeners.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void searchMusic(String keyword, int page) {
|
||||
if (musicContentCenter == null) {
|
||||
musicContentCenter = IAgoraMusicContentCenter.create(rtcEngine);
|
||||
@@ -966,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", "关闭");
|
||||
@@ -1105,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", "关闭");
|
||||
@@ -1202,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
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置音效
|
||||
|
||||
@@ -50,11 +50,16 @@ public class DateSelectDialog extends BaseBottomSheetDialog<MeDialogDateSelectBi
|
||||
@Override
|
||||
public void initData() {
|
||||
setYear();
|
||||
mBinding.pickerViewYear.setSelectedItemPosition(yearList.size());
|
||||
setMonth(TimeUtils.getYear());
|
||||
mBinding.pickerViewMonth.setSelectedItemPosition(monthList.size());
|
||||
setDay(TimeUtils.getYear(), TimeUtils.getMonth());
|
||||
mBinding.pickerViewDay.setSelectedItemPosition(dayList.size());
|
||||
int defaultYearPos = yearList.size() - 1; // 默认选中最新的年份(16年前)
|
||||
mBinding.pickerViewYear.setSelectedItemPosition(defaultYearPos);
|
||||
|
||||
// 获取默认年份
|
||||
int defaultYear = yearList.get(defaultYearPos).getDate();
|
||||
setMonth(defaultYear);
|
||||
mBinding.pickerViewMonth.setSelectedItemPosition(0);
|
||||
|
||||
setDay(defaultYear, 1);
|
||||
mBinding.pickerViewDay.setSelectedItemPosition(0);
|
||||
}
|
||||
|
||||
public void setData(String y, String m, String d) {
|
||||
@@ -124,41 +129,56 @@ public class DateSelectDialog extends BaseBottomSheetDialog<MeDialogDateSelectBi
|
||||
|
||||
|
||||
private List<DateBean> getDay(int year, int month) {
|
||||
int day = TimeUtils.getDaysByYearMonth(year, month);
|
||||
if (year == TimeUtils.getYear() && month == TimeUtils.getMonth()) {
|
||||
day = TimeUtils.getDay();
|
||||
int dayLimit = TimeUtils.getDaysByYearMonth(year, month);
|
||||
int currentYear = TimeUtils.getYear();
|
||||
int currentMonth = TimeUtils.getMonth();
|
||||
int currentDay = TimeUtils.getDay();
|
||||
|
||||
// 如果是最大年份且是最大月份,则日期不能超过当前日期
|
||||
if (year == currentYear - 16 && month == currentMonth) {
|
||||
dayLimit = currentDay;
|
||||
}
|
||||
|
||||
List<DateBean> dayList = new ArrayList<>();
|
||||
for (int i = 1; i <= day; i++) {
|
||||
for (int i = 1; i <= dayLimit; i++) {
|
||||
if (i <= 9) {
|
||||
dayList.add(new DateBean("0" + i, i));
|
||||
} else {
|
||||
dayList.add(new DateBean(String.valueOf(i), i));
|
||||
}
|
||||
}
|
||||
|
||||
return dayList;
|
||||
}
|
||||
|
||||
private List<DateBean> getMonth(int year) {
|
||||
List<DateBean> mothList = new ArrayList<>();
|
||||
int month = 12;
|
||||
if (year == TimeUtils.getYear()) {
|
||||
month = TimeUtils.getMonth();
|
||||
List<DateBean> monthList = new ArrayList<>();
|
||||
int currentYear = TimeUtils.getYear();
|
||||
int currentMonth = TimeUtils.getMonth();
|
||||
|
||||
int monthLimit = 12;
|
||||
// 如果是最大年份(16年前),则月份不能超过当前月份
|
||||
if (year == currentYear - 16) {
|
||||
monthLimit = currentMonth;
|
||||
}
|
||||
for (int i = 1; i <= month; i++) {
|
||||
|
||||
for (int i = 1; i <= monthLimit; i++) {
|
||||
if (i <= 9) {
|
||||
mothList.add(new DateBean("0" + i, i));
|
||||
monthList.add(new DateBean("0" + i, i));
|
||||
} else {
|
||||
mothList.add(new DateBean(String.valueOf(i), i));
|
||||
monthList.add(new DateBean(String.valueOf(i), i));
|
||||
}
|
||||
}
|
||||
return mothList;
|
||||
return monthList;
|
||||
}
|
||||
|
||||
private List<DateBean> getYear() {
|
||||
int year = TimeUtils.getYear();
|
||||
int currentYear = TimeUtils.getYear();
|
||||
int minYear = currentYear - 100; // 最小年份设为100年前
|
||||
int maxYear = currentYear - 16; // 最大年份设为16年前
|
||||
|
||||
List<DateBean> yearList = new ArrayList<>();
|
||||
for (int i = 1900; i <= year; i++) {
|
||||
for (int i = minYear; i <= maxYear; i++) {
|
||||
yearList.add(new DateBean(String.valueOf(i), i));
|
||||
}
|
||||
return yearList;
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.xscm.moduleutil.utils;
|
||||
|
||||
import android.Manifest;
|
||||
import android.graphics.Color;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.AbsoluteSizeSpan;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.luck.picture.lib.interfaces.OnPermissionDescriptionListener;
|
||||
import com.luck.picture.lib.permissions.PermissionConfig;
|
||||
import com.luck.picture.lib.utils.DensityUtil;
|
||||
import com.luck.picture.lib.widget.MediumBoldTextView;
|
||||
|
||||
/**
|
||||
* com.xscm.moduleutil.utils
|
||||
* qx
|
||||
* 2025/10/30
|
||||
*/
|
||||
// PermissionDescriptionHelper.java
|
||||
public class PermissionDescriptionHelper {
|
||||
private static final String TAG_EXPLAIN_VIEW = "TAG_EXPLAIN_VIEW";
|
||||
|
||||
public static class PermissionDescriptionListener implements OnPermissionDescriptionListener {
|
||||
@Override
|
||||
public void onPermissionDescription(Fragment fragment, String[] permissionArray) {
|
||||
View rootView = fragment.requireView();
|
||||
if (rootView instanceof ViewGroup) {
|
||||
addPermissionDescription(false, (ViewGroup) rootView, permissionArray);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(Fragment fragment) {
|
||||
removePermissionDescription((ViewGroup) fragment.requireView());
|
||||
}
|
||||
}
|
||||
|
||||
public static OnPermissionDescriptionListener createListener() {
|
||||
return new PermissionDescriptionListener();
|
||||
}
|
||||
|
||||
public static void addPermissionDescription(boolean isHasSimpleXCamera, ViewGroup viewGroup, String[] permissionArray) {
|
||||
int dp10 = DensityUtil.dip2px(viewGroup.getContext(), 10);
|
||||
int dp15 = DensityUtil.dip2px(viewGroup.getContext(), 15);
|
||||
MediumBoldTextView view = new MediumBoldTextView(viewGroup.getContext());
|
||||
view.setTag(TAG_EXPLAIN_VIEW);
|
||||
view.setTextSize(14);
|
||||
view.setTextColor(Color.parseColor("#333333"));
|
||||
view.setPadding(dp10, dp15, dp10, dp15);
|
||||
view.setBackgroundColor(Color.WHITE); // 添加背景色确保可见
|
||||
|
||||
String title;
|
||||
String explain;
|
||||
|
||||
if (TextUtils.equals(permissionArray[0], PermissionConfig.CAMERA[0])) {
|
||||
title = "相机权限使用说明";
|
||||
explain = "相机权限使用说明\n用户app用于拍照/录视频";
|
||||
} else if (TextUtils.equals(permissionArray[0], Manifest.permission.RECORD_AUDIO)) {
|
||||
if (isHasSimpleXCamera) {
|
||||
title = "麦克风权限使用说明";
|
||||
explain = "麦克风权限使用说明\n用户app用于录视频时采集声音";
|
||||
} else {
|
||||
title = "录音权限使用说明";
|
||||
explain = "录音权限使用说明\n用户app用于采集声音";
|
||||
}
|
||||
}else if (TextUtils.equals(permissionArray[0], Manifest.permission.ACCESS_FINE_LOCATION)){
|
||||
title = "定位权限";
|
||||
explain = "定位权限使用说明\n用户app获取当前位置,方便更好的推荐附近玩乐";
|
||||
}
|
||||
else {
|
||||
title = "存储权限使用说明";
|
||||
explain = "存储权限使用说明\n用户app写入/下载/保存/读取/修改/删除图片、视频、文件等信息";
|
||||
}
|
||||
int startIndex = 0;
|
||||
int endOf = startIndex + title.length();
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(explain);
|
||||
builder.setSpan(new AbsoluteSizeSpan(DensityUtil.dip2px(viewGroup.getContext(), 16)), startIndex, endOf, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new ForegroundColorSpan(0xFF333333), startIndex, endOf, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
view.setText(builder);
|
||||
view.setBackground(ContextCompat.getDrawable(viewGroup.getContext(), com.xscm.moduleutil.R.drawable.ps_demo_permission_desc_bg));
|
||||
|
||||
// 确保视图可见
|
||||
view.setVisibility(View.VISIBLE);
|
||||
view.setZ(9999); // 提高Z轴确保在最上层
|
||||
|
||||
if (isHasSimpleXCamera) {
|
||||
RelativeLayout.LayoutParams layoutParams =
|
||||
new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
layoutParams.topMargin = DensityUtil.getStatusBarHeight(viewGroup.getContext());
|
||||
layoutParams.leftMargin = dp10;
|
||||
layoutParams.rightMargin = dp10;
|
||||
viewGroup.addView(view, layoutParams);
|
||||
} else {
|
||||
ConstraintLayout.LayoutParams layoutParams =
|
||||
new ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.WRAP_CONTENT);
|
||||
// 修改约束设置,确保视图位置正确
|
||||
layoutParams.topToTop = ConstraintSet.PARENT_ID;
|
||||
layoutParams.leftToLeft = ConstraintSet.PARENT_ID;
|
||||
layoutParams.rightToRight = ConstraintSet.PARENT_ID;
|
||||
layoutParams.leftMargin = dp10;
|
||||
layoutParams.rightMargin = dp10;
|
||||
layoutParams.topMargin = DensityUtil.dip2px(viewGroup.getContext(), 50);
|
||||
viewGroup.addView(view, layoutParams);
|
||||
}
|
||||
|
||||
// 强制刷新布局
|
||||
viewGroup.requestLayout();
|
||||
viewGroup.postInvalidate();
|
||||
}
|
||||
|
||||
public static void removePermissionDescription(ViewGroup viewGroup) {
|
||||
if (viewGroup != null) {
|
||||
View tagExplainView = viewGroup.findViewWithTag(TAG_EXPLAIN_VIEW);
|
||||
if (tagExplainView != null) {
|
||||
viewGroup.removeView(tagExplainView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,4 +32,6 @@ public class SPConstants {
|
||||
public static final String USER_INFO = "userInfo";
|
||||
|
||||
public static final String FLOATING_SCREEN = "floatingScreen";
|
||||
|
||||
public static final String SHELF="shelf";
|
||||
}
|
||||
|
||||
@@ -327,7 +327,13 @@ public class SpUtil {
|
||||
String s = SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getString(SPConstants.EMQTT_CLIENT_ID);
|
||||
return s;
|
||||
}
|
||||
|
||||
public static void setShelf(int shelf){
|
||||
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put(SPConstants.SHELF, shelf);
|
||||
}
|
||||
public static int getShelf(){
|
||||
int shelf=SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt(SPConstants.SHELF);
|
||||
return shelf;
|
||||
}
|
||||
|
||||
//获取SharedPreferences音乐轮播方式
|
||||
public static int getPlayPattern() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.xscm.moduleutil.utils.config;
|
||||
|
||||
public enum EnvironmentEnum {
|
||||
// "https://vespa.qxyushen.top/",
|
||||
// "https://vespa.qxyushen.top/",
|
||||
PRODUCTION(//生产环境
|
||||
"https://vespa.qxyushen.top/",
|
||||
"KvNmqZc+VMzO4CfGMd5zmG6w6OFwpFO/19TwXUWfHDOBgmnl9DgIuE+kbrjNNnxqhtP3pH7bBrnSaSeFtunr72q6sgpLsfuswcUroMvz2slaTBcNzCaLi+GSnM3gB/GdO47mwLdk+iYBTvPUOCIuT608Z29z09w+vPeUDoMCHJBGXu6uh7Nj6PtV1dfGoUvByk1ZF0WYVjIqKDcb3tXY4jonFh3XAWhzMy8xKwN6F2nuK2IcdIwaSPsvuMZmhatP6f9kOE+vnfweyCHS3RxiG474WIoZGJM8omrl3/pOVqE=",
|
||||
@@ -14,7 +14,8 @@ public enum EnvironmentEnum {
|
||||
1600096860,
|
||||
"3e8f3add448d4692bc1d04c75ffe801b",
|
||||
"tcp://81.70.45.221",
|
||||
"https://vespa.qxyushen.top/h5"),
|
||||
"https://vespa.qxyushen.top/h5",
|
||||
0),
|
||||
TEST(//测试环境
|
||||
"https://test.vespa.qxyushen.top/",
|
||||
"6rdWuz058oq5OahdbFiGEybUcdahd12J83L34Uc7MrPIrxtFG+rXiwDvRcqNvjwbClbbmvMrmxKVkIysFByBsl0Qe9kqd2w8T/nhK5G6eXXlk2V9AjYCieIU+jRnjZBB+Cfechr6rCGJ2aeBARIsXcRPW7wm9WFK9euh5T+v6Pyte68yNaNdcYCll3+U4/uCEog7HygCnMIbAU+kqoPdmn2H+51YOHW+VsnsHd4w1+I3f8Tt0xLIXGM4GWnQueZ5GR46GTWiSYMy8dCIh9SPIMRyC91GosVcfGPMJSdcXqc=",
|
||||
@@ -27,7 +28,8 @@ public enum EnvironmentEnum {
|
||||
1600096890,
|
||||
"02f7339ec98947deaeab173599891932",
|
||||
"tcp://1.13.181.248",
|
||||
"https://tmd.xscmmidi.site/h5");
|
||||
"https://test.vespa.qxyushen.top/h5",
|
||||
1);
|
||||
|
||||
private final String serverUrl;//服务器地址
|
||||
private final String ALI_AUTH_KEY;//阿里云授权key
|
||||
@@ -47,10 +49,11 @@ public enum EnvironmentEnum {
|
||||
private final String mqttUrl;//MQTT服务器地址
|
||||
|
||||
private final String H5Url;//h5地址
|
||||
private final int shelf;//是否上架,0:平台更新,1:上架,发布到对应的应用商城
|
||||
|
||||
EnvironmentEnum(String serverUrl, String ALI_AUTH_KEY, String ossEndPoint, String ossaAcessKeyId,
|
||||
String ossAccessKeySecret, String ossBucketName, String ossBaseUrl, String wxAppId,
|
||||
int sdkAppId, String swSdkAppId,String mqttUrl,String H5Url) {
|
||||
int sdkAppId, String swSdkAppId,String mqttUrl,String H5Url,int shelf) {
|
||||
this.serverUrl = serverUrl;
|
||||
this.ALI_AUTH_KEY = ALI_AUTH_KEY;
|
||||
this.ossEndPoint = ossEndPoint;
|
||||
@@ -63,6 +66,11 @@ public enum EnvironmentEnum {
|
||||
this.swSdkAppId = swSdkAppId;
|
||||
this.mqttUrl = mqttUrl;
|
||||
this.H5Url = H5Url;
|
||||
this.shelf = shelf;
|
||||
}
|
||||
|
||||
public int getShelf() {
|
||||
return shelf;
|
||||
}
|
||||
|
||||
public String getH5Url() {
|
||||
|
||||
@@ -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.TEST.name());
|
||||
try {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GmsLocationProvider implements LocationProvider {
|
||||
callback.onFailed("无法获取位置");
|
||||
}
|
||||
})
|
||||
.addOnFailureListener(e -> callback.onFailed("Google Play 定位失败:" + e.getMessage()));
|
||||
.addOnFailureListener(e -> callback.onFailed("Google Play 定位失败:" ));
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.xscm.moduleutil.presenter.RewardGiftContacts;
|
||||
import com.xscm.moduleutil.presenter.RewardGiftPresenter;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.GifAvatarOvalView;
|
||||
import com.xscm.moduleutil.widget.floatingView.IFloatingView;
|
||||
|
||||
@@ -198,6 +199,17 @@ public class RewardGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPr
|
||||
|
||||
@Override
|
||||
public void getGiftLabel(List<GiftLabelBean> giftLabelBeans) {
|
||||
|
||||
if (giftLabelBeans == null) return;
|
||||
if (SpUtil.getShelf()==1){
|
||||
for (GiftLabelBean giftLabelBean1 : giftLabelBeans){
|
||||
if (giftLabelBean1.getId().equals("2")){
|
||||
giftLabelBeans.remove(giftLabelBean1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), giftLabelBeans,fragmentList,""));
|
||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
mBinding.slidingTabLayout.setCurrentTab(0);
|
||||
|
||||
BIN
moduleUtil/src/main/res/drawable-xxxhdpi/ic_topbar_back_dark.png
Normal file
|
After Width: | Height: | Size: 705 B |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:useLevel="false">
|
||||
<corners android:radius="15dp" />
|
||||
<solid android:color="@color/ps_color_white" />
|
||||
|
||||
</shape>
|
||||
BIN
moduleUtil/src/main/res/mipmap-hdpi/accompany_off.webp
Normal file
|
After Width: | Height: | Size: 858 B |
BIN
moduleUtil/src/main/res/mipmap-hdpi/accompany_on.webp
Normal file
|
After Width: | Height: | Size: 822 B |
BIN
moduleUtil/src/main/res/mipmap-hdpi/icon_liang.webp
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
moduleUtil/src/main/res/mipmap-hdpi/muisc_reward.webp
Normal file
|
After Width: | Height: | Size: 738 B |
BIN
moduleUtil/src/main/res/mipmap-hdpi/muisc_switch.webp
Normal file
|
After Width: | Height: | Size: 556 B |
BIN
moduleUtil/src/main/res/mipmap-hdpi/muisc_tyt.webp
Normal file
|
After Width: | Height: | Size: 692 B |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/accompany_off.webp
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/accompany_on.webp
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/icon_liang.webp
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/muisc_reward.webp
Normal file
|
After Width: | Height: | Size: 988 B |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/muisc_switch.webp
Normal file
|
After Width: | Height: | Size: 646 B |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/muisc_tyt.webp
Normal file
|
After Width: | Height: | Size: 754 B |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/accompany_off.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/accompany_on.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/icon_liang.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/muisc_reward.webp
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/muisc_switch.webp
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/muisc_tyt.webp
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
@@ -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>
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.xscm.moduleutil.utils.DateSelectDialog;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageLoader;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
|
||||
@@ -200,6 +201,7 @@ public class ImproveInfoActivity extends BaseMvpActivity<ImproveInfoPresenter, A
|
||||
.setSelectorUIStyle(new PictureSelectorStyle())
|
||||
.isGif(false)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setMaxSelectNum(1)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(false)
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.xscm.modulemain.activity.main.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
@@ -16,6 +17,7 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.ImageView;
|
||||
@@ -23,6 +25,8 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.blankj.utilcode.util.FragmentUtils;
|
||||
@@ -65,6 +69,7 @@ import com.xscm.moduleutil.event.UnreadCountEvent;
|
||||
import com.xscm.moduleutil.utils.BackgroundManager;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageLoader;
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.location.LocationProvider;
|
||||
import com.xscm.moduleutil.utils.location.SystemLocationProvider;
|
||||
@@ -496,15 +501,15 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
|
||||
private void requestGpsPermissions() {
|
||||
PermissionDescriptionHelper.addPermissionDescription(false, (ViewGroup) mBinding.getRoot(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION});
|
||||
PermissionX.init(this)
|
||||
// 请求精确位置权限(包含GPS定位能力)
|
||||
.permissions(
|
||||
Manifest.permission.ACCESS_FINE_LOCATION
|
||||
)
|
||||
.permissions(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
// 权限请求结果回调
|
||||
.request(new RequestCallback() {
|
||||
@Override
|
||||
public void onResult(boolean allGranted, List<String> grantedList, List<String> deniedList) {
|
||||
PermissionDescriptionHelper.removePermissionDescription((ViewGroup) mBinding.getRoot());
|
||||
if (allGranted) {
|
||||
// Toast.makeText(MainActivity.this, "GPS权限已授予,可开始定位", Toast.LENGTH_SHORT).show();
|
||||
initLocation(); // 启动GPS定位逻辑
|
||||
@@ -515,6 +520,82 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
});
|
||||
}
|
||||
|
||||
private static final int REQUEST_CODE_LOCATION_PERMISSION = 1001;
|
||||
|
||||
private void requestLocationPermission() {
|
||||
// 检查是否已拥有权限
|
||||
if (ContextCompat.checkSelfPermission(
|
||||
this,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION
|
||||
) == PackageManager.PERMISSION_GRANTED) {
|
||||
// 已授权,执行定位相关任务
|
||||
performLocationTask();
|
||||
}
|
||||
// 判断是否需要展示解释性说明
|
||||
else if (ActivityCompat.shouldShowRequestPermissionRationale(
|
||||
this,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION
|
||||
)) {
|
||||
// 展示自定义的解释对话框
|
||||
showPermissionExplanationDialog();
|
||||
}
|
||||
else {
|
||||
// 首次请求,或用户选择了"不再询问",直接请求权限
|
||||
directlyRequestPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
private void showPermissionExplanationDialog() {
|
||||
new AlertDialog.Builder(this)
|
||||
.setTitle("需要位置权限")
|
||||
.setMessage("我们使用您的位置信息来为您提供周边的地图导航服务、展示订单热力图,并为您推荐附近的订单。此功能需要获取您的位置信息。")
|
||||
.setPositiveButton("同意", (dialog, which) -> {
|
||||
// 用户点击同意后,请求权限
|
||||
directlyRequestPermissions();
|
||||
})
|
||||
.setNegativeButton("取消", (dialog, which) -> {
|
||||
// 处理用户取消的情况
|
||||
})
|
||||
.show();
|
||||
}
|
||||
|
||||
private void directlyRequestPermissions() {
|
||||
String[] permissionsToRequest;
|
||||
|
||||
// 根据Android版本决定请求的权限
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
// Android 10 (API 29) 及以上,可以同时请求前台和后台定位权限(注意:在Android 11及以后,策略有变)
|
||||
permissionsToRequest = new String[] {
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION
|
||||
// 在Android 11上,不建议在此同时申请后台权限
|
||||
};
|
||||
} else {
|
||||
// Android 9及以下
|
||||
permissionsToRequest = new String[] {
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION
|
||||
};
|
||||
}
|
||||
|
||||
ActivityCompat.requestPermissions(
|
||||
this,
|
||||
permissionsToRequest,
|
||||
REQUEST_CODE_LOCATION_PERMISSION // 定义你的请求码,例如 1001
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private void performLocationTask() {
|
||||
// 执行定位任务
|
||||
initLocation();
|
||||
}
|
||||
|
||||
private void handlePermissionDenial() {
|
||||
// 处理权限被拒绝的情况
|
||||
Toast.makeText(this, "位置权限被拒绝,相关功能无法使用", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(UnreadCountEvent event) {
|
||||
long aLong = event.getALong();
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -37,6 +38,7 @@ import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper;
|
||||
import com.xscm.moduleutil.utils.location.LocationProvider;
|
||||
import com.xscm.moduleutil.utils.location.LocationServiceFactory;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
@@ -141,7 +143,7 @@ public class ReleaseActivity extends BaseMvpActivity<ReleasePresenter, ActivityR
|
||||
mBinding.tvFb.setOnClickListener(this::onClick);
|
||||
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
PermissionDescriptionHelper.addPermissionDescription(false, (ViewGroup) mBinding.getRoot(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION});
|
||||
// 请求定位权限
|
||||
ActivityCompat.requestPermissions(
|
||||
(Activity) this,
|
||||
@@ -201,22 +203,11 @@ public class ReleaseActivity extends BaseMvpActivity<ReleasePresenter, ActivityR
|
||||
|
||||
private void startChoosePhoto(int mimeType, int requestCode, boolean isVideo, int type) {
|
||||
|
||||
// PictureSelector.create(this)
|
||||
// .openGallery(mimeType)
|
||||
// .isGif(isVideo)
|
||||
// .imageEngine(GlideEngine.createGlideEngine())
|
||||
// .maxSelectNum(type)
|
||||
// .isPreviewImage(true)
|
||||
// .isCamera(true)
|
||||
// .setOutputCameraPath(Constants.FILE_PATH)
|
||||
// .isCompress(true)
|
||||
// .setPictureStyle(MyPictureParameterStyle.Companion.selectPicture())
|
||||
// .forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
PictureSelector.create(this)
|
||||
.openGallery(mimeType)
|
||||
.isGif(isVideo)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setMaxSelectNum(type)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(false)
|
||||
@@ -352,7 +343,7 @@ public class ReleaseActivity extends BaseMvpActivity<ReleasePresenter, ActivityR
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
PermissionDescriptionHelper.removePermissionDescription((ViewGroup) mBinding.getRoot());
|
||||
if (requestCode == 1001) {
|
||||
LocationProvider provider = LocationServiceFactory.createBestProvider(this);
|
||||
provider.getLastKnownLocation(this, new LocationProvider.LocationCallback() {
|
||||
@@ -364,7 +355,7 @@ public class ReleaseActivity extends BaseMvpActivity<ReleasePresenter, ActivityR
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorMessage) {
|
||||
Toast.makeText(ReleaseActivity.this, "定位失败:" + errorMessage, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(ReleaseActivity.this, "定位失败:", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -150,6 +150,7 @@ import com.xscm.moduleutil.service.MyRoomSingleton
|
||||
import com.xscm.moduleutil.utils.ARouteConstants
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper
|
||||
import com.xscm.moduleutil.utils.QXRedPacketManager
|
||||
import com.xscm.moduleutil.utils.SpUtil
|
||||
import com.xscm.moduleutil.utils.SystemUtils
|
||||
@@ -431,6 +432,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
override fun initData() {
|
||||
if (!EasyPermissions.hasPermissions(this, *permissions)) {
|
||||
PermissionDescriptionHelper.addPermissionDescription(
|
||||
false,
|
||||
mBinding?.root as ViewGroup,
|
||||
permissions
|
||||
)
|
||||
EasyPermissions.requestPermissions(
|
||||
this, "请开启录音使用权限",
|
||||
1, *permissions
|
||||
@@ -2350,10 +2356,6 @@ 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());
|
||||
val fragment = RequestDialogFragment.show(
|
||||
roomId, mRoomInfoResp, 1,
|
||||
supportFragmentManager
|
||||
@@ -2361,7 +2363,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if (fragment != null) {
|
||||
addActiveDialogFragment(fragment) // 添加到管理列表
|
||||
}
|
||||
}
|
||||
} else if (id == R.id.rl_gift) { //礼物
|
||||
val fragment = RoomGiftDialogFragment.show(
|
||||
mRoomInfoResp, null, roomId, 0, "",
|
||||
@@ -2642,15 +2643,16 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
fun setRoleType(roleType: Int, pit_number: Int) {
|
||||
val rl_voice = mBinding?.rlVoive // 注意:原拼写错误已修正 喇叭
|
||||
val rl_mic = mBinding?.rlMic//麦克风
|
||||
val rl_more = mBinding?.rlMore //PK
|
||||
val rl_misc = mBinding?.rlMisc //音乐
|
||||
val rl_voice = mBinding?.rlVoive // 喇叭
|
||||
val rl_mic = mBinding?.rlMic // 麦克风
|
||||
val rl_more = mBinding?.rlMore // PK按钮
|
||||
val rl_misc = mBinding?.rlMisc // 音乐按钮
|
||||
val rl_message = mBinding?.rlMessage // 消息按钮
|
||||
|
||||
rl_voice?.visibility = View.GONE
|
||||
rl_mic?.visibility = View.GONE
|
||||
rl_more?.visibility = View.GONE
|
||||
rl_misc?.visibility = View.GONE
|
||||
rl_mic?.visibility = View.GONE
|
||||
|
||||
// 空指针保护
|
||||
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null || mRoomInfoResp!!.user_info == null) {
|
||||
@@ -2661,83 +2663,99 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
val labelId = mRoomInfoResp!!.room_info.label_id
|
||||
val userPitNumber = mRoomInfoResp!!.user_info.pit_number
|
||||
|
||||
// 特殊房间类型处理(优先级最高)
|
||||
// 情况1: typeId = 6 时,只显示消息按钮
|
||||
if ("6" == typeId) {
|
||||
mBinding?.rlMessage?.visibility = View.GONE
|
||||
return // 全部隐藏,无需继续处理
|
||||
rl_message?.visibility = View.GONE
|
||||
return
|
||||
} else {
|
||||
mBinding?.rlMessage?.visibility = View.VISIBLE
|
||||
rl_message?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
|
||||
// 根据角色类型显示按钮
|
||||
when (roleType) {
|
||||
1, 2, 3 -> {
|
||||
// 角色类型1,2,3显示全部按钮(但受其他条件限制)
|
||||
rl_voice?.visibility = View.VISIBLE
|
||||
rl_mic?.visibility =
|
||||
if (pit_number != 0) View.VISIBLE else View.GONE
|
||||
rl_more?.visibility =
|
||||
if (pit_number == 9) View.VISIBLE else View.GONE
|
||||
rl_misc?.visibility = View.VISIBLE
|
||||
|
||||
// 麦克风显示条件
|
||||
if (userPitNumber != 0) {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
// PK按钮显示条件:typeId=1且labelId=1且userPitNumber=9
|
||||
if ("1" == typeId && "1" == labelId && userPitNumber == 9) {
|
||||
rl_more?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
// 音乐按钮不显示
|
||||
rl_misc?.visibility = View.GONE
|
||||
}
|
||||
|
||||
0 -> {
|
||||
// 角色类型0显示喇叭和麦克风
|
||||
rl_voice?.visibility = View.VISIBLE
|
||||
rl_mic?.visibility =
|
||||
if (pit_number != 0) View.VISIBLE else View.GONE
|
||||
rl_misc?.visibility = View.VISIBLE
|
||||
|
||||
// 麦克风显示条件
|
||||
if (userPitNumber != 0) {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
rl_misc?.visibility = View.GONE
|
||||
}
|
||||
|
||||
5 -> {
|
||||
// 角色类型5只显示喇叭
|
||||
rl_voice?.visibility = View.VISIBLE
|
||||
rl_more?.visibility = View.GONE
|
||||
rl_misc?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
if (roleType != 5) {
|
||||
rl_misc?.visibility = View.VISIBLE
|
||||
if (userPitNumber == 9) {
|
||||
rl_more?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// label_id 和 type_id 联合判断
|
||||
if (mutableListOf<String>("1").contains(typeId) && "1" == labelId) {
|
||||
rl_more?.visibility = View.VISIBLE
|
||||
rl_misc?.visibility = View.VISIBLE
|
||||
} else {
|
||||
rl_more?.visibility = View.GONE
|
||||
rl_misc?.visibility = View.GONE
|
||||
}
|
||||
|
||||
// mic 显示逻辑
|
||||
if (userPitNumber > 0) {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
if (CommonAppContext.getInstance().isMai) {
|
||||
switchMic(1)
|
||||
} else {
|
||||
switchMic(2)
|
||||
}
|
||||
} else {
|
||||
if (pit_number == 888) {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
switchMic(2)
|
||||
} else if (pit_number == -1) {
|
||||
rl_mic?.visibility = View.VISIBLE // 原代码此处缺少 View. 前缀,已补全
|
||||
switchMic(1)
|
||||
} else {
|
||||
rl_mic?.visibility = View.GONE
|
||||
switchMic(2)
|
||||
else -> {
|
||||
// 其他角色类型不显示任何功能按钮
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 情况3: 麦克风的特殊显示逻辑
|
||||
when {
|
||||
userPitNumber > 0 -> {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
if (CommonAppContext.getInstance().isMai) {
|
||||
switchMic(1) // 打开麦克风
|
||||
} else {
|
||||
switchMic(2) // 关闭麦克风
|
||||
}
|
||||
}
|
||||
|
||||
pit_number == 888 -> {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
switchMic(2) // 关闭麦克风
|
||||
}
|
||||
|
||||
pit_number == -1 -> {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
switchMic(1) // 打开麦克风
|
||||
}
|
||||
|
||||
else -> {
|
||||
rl_mic?.visibility = View.GONE
|
||||
switchMic(2) // 关闭麦克风
|
||||
}
|
||||
}
|
||||
// 情况4: 特殊typeId隐藏PK和音乐按钮
|
||||
if ("7" == typeId || "2" == typeId) {
|
||||
rl_more?.visibility = View.GONE
|
||||
rl_misc?.visibility = View.GONE
|
||||
}
|
||||
// 最终确认:typeId不等于1的情况,都不展示PK按钮
|
||||
if ("1" != typeId) {
|
||||
rl_more?.visibility = View.GONE
|
||||
}
|
||||
|
||||
if ("1"==typeId && "2" == labelId){
|
||||
rl_misc?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
fun isMute(is_mute: Int) {
|
||||
@@ -3818,12 +3836,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance(this,mRoomInfoResp)
|
||||
roomFragment = RoomFragment.newInstance(this, mRoomInfoResp)
|
||||
supportFragmentManager
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment!!)
|
||||
.commitAllowingStateLoss()
|
||||
}else {
|
||||
} else {
|
||||
roomFragment!!.refreshData(mRoomInfoResp, qxType)
|
||||
}
|
||||
}
|
||||
@@ -4152,12 +4170,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, perms: List<String>) {
|
||||
PermissionDescriptionHelper.removePermissionDescription(mBinding?.root as ViewGroup)
|
||||
if (perms.contains(Manifest.permission.RECORD_AUDIO)) {
|
||||
Log.d("Permission", "录音权限已授权")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPermissionsDenied(requestCode: Int, perms: List<String>) {
|
||||
PermissionDescriptionHelper.removePermissionDescription(mBinding?.root as ViewGroup)
|
||||
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
|
||||
AppSettingsDialog.Builder(this).build().show()
|
||||
} else {
|
||||
|
||||
@@ -18,5 +18,7 @@ public class RoomSettingContacts {
|
||||
void changeRoom(String roomId, String userId, int position, RoomSettingBean bean);
|
||||
|
||||
void changeRoomType(String roomId,String type);//修改房间类型 type:1点唱、2拍卖、3男神、4女神
|
||||
|
||||
void agreeSong(String roomId, String type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,17 +457,15 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
pitBean.setSex(fromUserInfo.getSex() + "");
|
||||
pitBean.setCharm(fromUserInfo.getCharm());
|
||||
pitBean.setDress(fromUserInfo.getDress());
|
||||
mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean = pitBean;
|
||||
if (userId == SpUtil.getUserId() && pitNumber.equals("9")) {
|
||||
myPitNumber = 9;
|
||||
|
||||
mWheatViews.get(Integer.parseInt(pitNumber) - 1).setData(pitBean);
|
||||
if (userId == SpUtil.getUserId() ) {
|
||||
myPitNumber=Integer.parseInt(pitNumber);
|
||||
if (pitNumber.equals("9")){
|
||||
configGameOptionBtn();
|
||||
}
|
||||
for (int i = 0; i < mWheatViews.size(); i++) {
|
||||
if (i == Integer.parseInt(pitNumber) - 1) {
|
||||
mWheatViews.get(i).setData(pitBean);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
initUserViewMap();
|
||||
}
|
||||
|
||||
@@ -480,16 +478,16 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
pitBean.setSex("");
|
||||
pitBean.setCharm("");
|
||||
pitBean.setDress("");
|
||||
mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean = pitBean;
|
||||
mWheatViews.get(Integer.parseInt(pitNumber) - 1).setData(pitBean);
|
||||
if (messageEvent.getText().getFromUserInfo()==null){
|
||||
return;
|
||||
}
|
||||
if (SpUtil.getUserId()==messageEvent.getText().getFromUserInfo().getUser_id()){
|
||||
myPitNumber = -1;
|
||||
if (pitNumber.equals("9")) {
|
||||
myPitNumber = 0;
|
||||
configGameOptionBtn();
|
||||
}
|
||||
for (int i = 0; i < mWheatViews.size(); i++) {
|
||||
if (i == Integer.parseInt(pitNumber) - 1) {
|
||||
mWheatViews.get(i).setData(pitBean);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
initUserViewMap();
|
||||
}
|
||||
@@ -891,12 +889,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
* @param pitArr 麦位数组
|
||||
*/
|
||||
public void friendSeatDidChanged(List<RoomPitBean> pitArr) { // 使用实际的麦位模型类
|
||||
boolean isHaveMe = false;
|
||||
if (myPitNumber == 9 || myPitNumber == 10) {
|
||||
isHaveMe = true;
|
||||
} else {
|
||||
myPitNumber = -1;
|
||||
}
|
||||
boolean isHaveMe = myPitNumber == 9 || myPitNumber == 10;
|
||||
|
||||
// 更新麦位显示
|
||||
for (RoomPitBean pitBean : pitArr) {
|
||||
|
||||
@@ -171,7 +171,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());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -185,7 +185,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());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -221,7 +221,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());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.xscm.moduleutil.bean.RoomBgBean;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -105,6 +106,7 @@ public class RoomBackgroundDialogFragment extends BaseMvpDialogFragment<RoomBack
|
||||
.openGallery(mimeType)
|
||||
.isGif(isVideo)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setMaxSelectNum(type)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(false)
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.xscm.modulemain.dialog.RoomOnlineDialogFragment;
|
||||
import com.xscm.modulemain.dialog.RoomUserInfoFragment;
|
||||
import com.xscm.modulemain.activity.room.contacts.RoomContacts;
|
||||
import com.xscm.modulemain.activity.room.presenter.RoomPresenter;
|
||||
import com.xscm.modulemain.dialog.TunerDialogFragment;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.MusicSongBean;
|
||||
import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
@@ -36,9 +37,11 @@ import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
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;
|
||||
@@ -70,6 +73,8 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
RoomFragment parentFragment;
|
||||
BaseQuickAdapter<RoomPitBean, BaseViewHolder> adapter;
|
||||
|
||||
VolumeManager volumeManager ;
|
||||
|
||||
public RoomKtvFragment() {}
|
||||
public RoomKtvFragment(RoomInfoResp roomInfoResp) {
|
||||
this.roomInfoResp = roomInfoResp;
|
||||
@@ -129,8 +134,9 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
((RoomActivity) getActivity()).setRoleType(0, 0);
|
||||
}
|
||||
}
|
||||
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()) {
|
||||
@@ -203,6 +209,30 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
|
||||
}
|
||||
|
||||
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() {
|
||||
super.onStart();
|
||||
@@ -222,6 +252,8 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
volumeManager=VolumeManager.getInstance();
|
||||
setAgorVolumes();
|
||||
upData();
|
||||
}
|
||||
|
||||
@@ -254,28 +286,36 @@ 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);
|
||||
@@ -297,7 +337,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) {
|
||||
@@ -449,25 +489,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.VISIBLE);
|
||||
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.GONE);
|
||||
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);
|
||||
|
||||
@@ -476,8 +516,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) {
|
||||
@@ -504,11 +545,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -547,6 +590,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
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);
|
||||
@@ -618,8 +662,11 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
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();
|
||||
|
||||
if (AgoraManager.getInstance(getActivity()).isOnJoin()) {
|
||||
AgoraManager.getInstance(getActivity()).loadLrc(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()));
|
||||
}
|
||||
@@ -652,6 +699,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());
|
||||
|
||||
@@ -792,7 +792,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
if (isFastDoubleClick(pitBean.getUser_id(), pitBean.getPit_number())) {
|
||||
return;
|
||||
}
|
||||
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), pitBean.getUser_id(), pitNumber + "", getHostUser(), true, 3, isNumberWhether(), getChildFragmentManager());
|
||||
RoomUserInfoFragment.show(roomInfoRespPk.getRoom_info().getRoom_id(), pitBean.getUser_id(), pitNumber + "", getHostUser(), true, 3, isNumberWhether(), getChildFragmentManager());
|
||||
// 点击的麦位是当前麦位
|
||||
// 可以执行相应的操作,如显示提示信息或执行其他逻辑
|
||||
}
|
||||
@@ -999,11 +999,20 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
}
|
||||
|
||||
public void event1021(RoomMessageEvent message) {
|
||||
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")) {
|
||||
wheatLayoutManager1.updateSingleCharm(pitBean, Integer.parseInt(pitBean.getPit_number()), 1);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
|
||||
pitBean.setCharm("0");
|
||||
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 2025/9/12 清除个人魅力
|
||||
public void event1059(RoomMessageEvent message) {
|
||||
|
||||
@@ -70,4 +70,22 @@ 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) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
import com.xscm.modulemain.dialog.ShareDialog;
|
||||
@@ -184,27 +185,16 @@ public class AlbumDetailActivity extends BaseMvpActivity<AlbumDetailPresenter, A
|
||||
|
||||
private void startChoosePhoto(int mimeType, int requestCode, boolean isVideo, int type) {
|
||||
|
||||
// PictureSelector.create(this)
|
||||
// .openGallery(mimeType)
|
||||
// .isGif(isVideo)
|
||||
// .imageEngine(GlideEngine.createGlideEngine())
|
||||
// .isPreviewImage(true)
|
||||
// .isCamera(true)
|
||||
// .setOutputCameraPath(Constants.FILE_PATH)
|
||||
// .isCompress(true)
|
||||
// .setPictureStyle(MyPictureParameterStyle.Companion.selectPicture())
|
||||
// .forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
PictureSelector.create(this)
|
||||
.openGallery(mimeType)
|
||||
.isGif(isVideo)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setMaxSelectNum(type)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(false)
|
||||
.setOutputCameraDir(Constants.FILE_PATH)
|
||||
.isOriginalSkipCompress(true)
|
||||
|
||||
.forResult(requestCode); //结果回调onActivityResult code
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
import com.zcw.togglebutton.ToggleButton;
|
||||
|
||||
@@ -182,12 +183,12 @@ public class CreateAlbumActivity extends BaseMvpActivity<MyAlbumPresenter, Activ
|
||||
.openGallery(mimeType)
|
||||
.isGif(isVideo)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setMaxSelectNum(type)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(false)
|
||||
.setOutputCameraDir(Constants.FILE_PATH)
|
||||
.isOriginalSkipCompress(true)
|
||||
|
||||
.forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
|
||||
import java.io.File;
|
||||
@@ -261,12 +262,12 @@ public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, A
|
||||
.openGallery(mimeType)
|
||||
.isGif(false)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setMaxSelectNum(1)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(false)
|
||||
.setOutputCameraDir(Constants.FILE_PATH)
|
||||
.isOriginalSkipCompress(true)
|
||||
|
||||
.forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.xscm.moduleutil.bean.XBannerData;
|
||||
import com.xscm.moduleutil.utils.DateSelectDialog;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.PermissionDescriptionHelper;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
import com.xscm.moduleutil.widget.img.FullScreenUtil;
|
||||
@@ -180,12 +181,12 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
|
||||
.openGallery(mimeType)
|
||||
.isGif(isVideo)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setMaxSelectNum(type)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(false)
|
||||
.setOutputCameraDir(Constants.FILE_PATH)
|
||||
.isOriginalSkipCompress(true)
|
||||
|
||||
.forResult(requestCode); //结果回调onActivityResult code
|
||||
} else {
|
||||
|
||||
@@ -199,6 +200,7 @@ public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, Act
|
||||
.isDisplayCamera(false)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setImageEngine(GlideEngine.createGlideEngine()) // 选择器展示不出图片则添加
|
||||
.setPermissionDescriptionListener(PermissionDescriptionHelper.createListener())
|
||||
.setCropEngine(new CropFileEngine() {
|
||||
@Override
|
||||
public void onStartCrop(Fragment fragment, Uri srcUri, Uri destinationUri, ArrayList<String> dataSource, int requestCode) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.xscm.modulemain.activity.user.activity;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
@@ -14,6 +15,7 @@ import com.xscm.modulemain.databinding.ActivitySettingBinding;
|
||||
import com.xscm.modulemain.activity.user.conacts.SettingConacts;
|
||||
import com.xscm.modulemain.activity.user.presenter.SettingPresenter;
|
||||
import com.xscm.modulemain.BaseMvpActivity;
|
||||
import com.xscm.modulemain.dialog.YouthModelDialog;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.dialog.RealNameDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
@@ -29,6 +31,16 @@ import com.xscm.moduleutil.widget.CommonAppConfig;
|
||||
*/
|
||||
public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivitySettingBinding> implements SettingConacts.View {
|
||||
|
||||
private int clickCount = 0;
|
||||
private static final int REQUIRED_CLICKS = 6;
|
||||
private Handler handler = new Handler();
|
||||
private Runnable resetRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
clickCount = 0; // 自动重置计数器
|
||||
}
|
||||
};
|
||||
private static final long RESET_DELAY = 1000; // 1秒无操作自动重置
|
||||
|
||||
protected void initData() {
|
||||
mBinding.tvBbh.setText(CommonAppConfig.getInstance().getVersion());
|
||||
@@ -54,11 +66,13 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
|
||||
mBinding.llTcdl.setOnClickListener(this::onClick);
|
||||
mBinding.llZhxiao.setOnClickListener(this::onClick);
|
||||
mBinding.llGywm.setOnClickListener(this::onClick);
|
||||
mBinding.llBbh.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.ll_youth) {
|
||||
startActivity(new Intent(this, UnderageActivity.class));
|
||||
// startActivity(new Intent(this, UnderageActivity.class));
|
||||
showYouthModelDialog();
|
||||
} else if (view.getId() == R.id.ll_notification) {
|
||||
startActivity(new Intent(this, NotificationActivity.class));
|
||||
} else if (view.getId() == R.id.ll_hmd) {
|
||||
@@ -155,9 +169,36 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
|
||||
|
||||
startActivity(new Intent(this, AboutUsActivity.class));
|
||||
|
||||
} else if (view.getId() == R.id.ll_bbh) {
|
||||
if (SpUtil.getShelf()==1) {
|
||||
// 移除之前的重置任务
|
||||
handler.removeCallbacks(resetRunnable);
|
||||
clickCount++;
|
||||
if (clickCount >= REQUIRED_CLICKS) {
|
||||
// 写入内存值
|
||||
SpUtil.setShelf(0);
|
||||
clickCount = 0;
|
||||
ToastUtils.showShort("已经打开趣味玩法");
|
||||
} else {
|
||||
// 延迟重置计数器
|
||||
handler.postDelayed(resetRunnable, RESET_DELAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void showYouthModelDialog() {
|
||||
YouthModelDialog youthModelDialog = new YouthModelDialog(this, null);
|
||||
youthModelDialog.show();
|
||||
youthModelDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
// 记录已经显示过青少年模式弹窗
|
||||
dialog.dismiss();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_setting;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -716,12 +716,23 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
|
||||
@Override
|
||||
public void getGiftLabel(List<GiftLabelBean> giftLabelBeans) {
|
||||
if (giftLabelBeans == null) return;
|
||||
giftLabelBeanList = new ArrayList<>();
|
||||
giftLabelBeanList.addAll(giftLabelBeans);
|
||||
GiftLabelBean giftLabelBean = new GiftLabelBean();
|
||||
giftLabelBean.setId("0");
|
||||
giftLabelBean.setName("背包");
|
||||
giftLabelBeans.add(0, giftLabelBean);
|
||||
|
||||
if (SpUtil.getShelf()==1){
|
||||
for (GiftLabelBean giftLabelBean1 : giftLabelBeans){
|
||||
if (giftLabelBean1.getId().equals("2")){
|
||||
giftLabelBeans.remove(giftLabelBean1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), giftLabelBeans, fragmentList, roomId));
|
||||
mBinding.viewPager.setOffscreenPageLimit(0);
|
||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
|
||||
@@ -139,8 +139,9 @@ public class RoomSettingFragment extends BaseMvpDialogFragment<RoomSettingPresen
|
||||
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_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("交友", "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));
|
||||
@@ -155,7 +156,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));
|
||||
@@ -226,9 +227,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");
|
||||
@@ -277,7 +280,9 @@ 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 {
|
||||
@@ -331,12 +336,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 -> {
|
||||
// 点击“取消”按钮时什么都不做
|
||||
@@ -360,11 +369,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 ) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy|| type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -373,14 +382,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 ) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy) {
|
||||
if (type == RoomSettingBean.QXRoomSettingTypeRoomBgMusic || type == RoomSettingBean.QXRoomSettingTypeRoomSubsidy || type == RoomSettingBean.QXRoomSettingTypeRoomMyDress ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -391,7 +401,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 ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -417,7 +427,6 @@ 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||
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.xscm.modulemain.activity.room.presenter.RoomUserPresenter;
|
||||
import com.example.zhouwei.library.CustomPopWindow;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.modulemain.activity.WebViewActivity;
|
||||
import com.xscm.modulemain.manager.RoomManager;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.RelationCardBean;
|
||||
@@ -72,7 +73,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
return new RoomUserPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
public static void show(String room_id, String user_id, String pit_number, int type,boolean isPk,int paim,int isNum, FragmentManager fragmentManager) {
|
||||
public static void show(String room_id, String user_id, String pit_number, int type, boolean isPk, int paim, int isNum, FragmentManager fragmentManager) {
|
||||
RoomUserInfoFragment dialogFragment = new RoomUserInfoFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("roomId", room_id); // 可选:传递参数
|
||||
@@ -97,8 +98,8 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
isPk = getArguments().getBoolean("isPk");
|
||||
paim = getArguments().getInt("paim");
|
||||
isNum = getArguments().getInt("isNum");
|
||||
if (isPk){
|
||||
type=4;
|
||||
if (isPk) {
|
||||
type = 4;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -127,6 +128,18 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
} else {
|
||||
mBinding.roomDian.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (isPk) {
|
||||
mBinding.roomBo.setVisibility(GONE);
|
||||
if (isNum == 1) {
|
||||
mBinding.imGs.setVisibility(GONE);
|
||||
} else {
|
||||
mBinding.imGs.setVisibility(VISIBLE);
|
||||
}
|
||||
} else {
|
||||
mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
mBinding.imGs.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
@@ -144,6 +157,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.roomRlGift.setOnClickListener(this::onClick);
|
||||
mBinding.roomJb.setOnClickListener(this::onClick);
|
||||
mBinding.tvZb.setOnClickListener(this::onClick);
|
||||
mBinding.imGs.setOnClickListener(this::onClick);
|
||||
|
||||
mBinding.textView1.setOnClickListener(this::onClick);
|
||||
mBinding.textView2.setOnClickListener(this::onClick);
|
||||
@@ -162,13 +176,12 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
if (id == R.id.room_m_cz) {
|
||||
if (mBinding.roomMCz.getText().equals("上麦")) {
|
||||
MvpPre.applyPit(room_id, "");
|
||||
}else if (mBinding.roomMCz.getText().equals("抱麦")){
|
||||
} else if (mBinding.roomMCz.getText().equals("抱麦")) {
|
||||
MvpPre.hostUserPit(room_id, pit_number, user_id, "1");
|
||||
}
|
||||
else {
|
||||
if(user_id.equals(SpUtil.getUserId()+"")){
|
||||
} else {
|
||||
if (user_id.equals(SpUtil.getUserId() + "")) {
|
||||
MvpPre.downPit(room_id, pit_number);
|
||||
}else {
|
||||
} else {
|
||||
MvpPre.hostUserPit(room_id, pit_number, user_id, "2");
|
||||
}
|
||||
}
|
||||
@@ -186,14 +199,14 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
EventBus.getDefault().post(userInfo);
|
||||
dismiss();
|
||||
} else if (id == R.id.im_room_lt) {
|
||||
Intent intent=new Intent(getActivity(), TUIC2CChatActivity.class);
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, "u"+userInfo.getUser_id());
|
||||
Intent intent = new Intent(getActivity(), TUIC2CChatActivity.class);
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, "u" + userInfo.getUser_id());
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_C2C);
|
||||
startActivity(intent);
|
||||
} else if (id == R.id.im_room_gz) {
|
||||
MvpPre.userGuanz(user_id, "1");
|
||||
}else if (id == R.id.im_room_sl){
|
||||
if (userInfo!=null) {
|
||||
} else if (id == R.id.im_room_sl) {
|
||||
if (userInfo != null) {
|
||||
if (pit_number == null) {
|
||||
pit_number = "";
|
||||
}
|
||||
@@ -201,22 +214,22 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
RoomGiftDialogFragment.show(null, userInfo, room_id, 0, "", getParentFragmentManager());
|
||||
}
|
||||
dismiss();
|
||||
}else if (id == R.id.room_lh){
|
||||
} else if (id == R.id.room_lh) {
|
||||
MvpPre.addBlackList(user_id);
|
||||
}else if (id == R.id.room_rl_gift){
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", userInfo.getUser_id()+"").withInt("type",1).navigation();
|
||||
} else if (id == R.id.room_rl_gift) {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", userInfo.getUser_id() + "").withInt("type", 1).navigation();
|
||||
|
||||
// UserGiftWallRoomFragment.newInstance(Integer.parseInt(user_id)).show(getChildFragmentManager(), "UserGiftWallRoomFragment");
|
||||
}else if (id == R.id.room_jb){
|
||||
} else if (id == R.id.room_jb) {
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id).withString("title", "举报").navigation();
|
||||
Intent intent = new Intent(getActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/report?id=" + SpUtil.getToken() + "&fromType=1&fromId=" + user_id);
|
||||
intent.putExtra("title", "举报");
|
||||
startActivity(intent);
|
||||
}else if (id==R.id.iv_avatar){
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", userInfo.getUser_id()+"").navigation();
|
||||
} else if (id == R.id.iv_avatar) {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", userInfo.getUser_id() + "").navigation();
|
||||
dismiss();
|
||||
}else if (id==R.id.tv_zb){
|
||||
} else if (id == R.id.tv_zb) {
|
||||
RoomHostZBDialog dialog = new RoomHostZBDialog(getContext());
|
||||
dialog.setListener(new RoomHostIncomeDialog.OnConfirmClickListener() {
|
||||
@Override
|
||||
@@ -225,15 +238,17 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}else if (id==R.id.more_button){
|
||||
RelationshipFragment.show(user_id,guanType,getParentFragmentManager());
|
||||
} else if (id == R.id.more_button) {
|
||||
RelationshipFragment.show(user_id, guanType, getParentFragmentManager());
|
||||
dismiss();
|
||||
}else if (id==R.id.textView1){
|
||||
} else if (id == R.id.textView1) {
|
||||
dianj(1);
|
||||
}else if (id==R.id.textView2){
|
||||
} else if (id == R.id.textView2) {
|
||||
dianj(2);
|
||||
}else if (id==R.id.im_qml){
|
||||
} else if (id == R.id.im_qml) {
|
||||
MvpPre.clearUserCharm(room_id, user_id);
|
||||
} else if (id == R.id.im_gs) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), room_id, "", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,8 +296,8 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
// showContent = "点击 Item菜单6";
|
||||
//TODO 举报功能
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url",CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id).withString("title", "举报").navigation();
|
||||
Intent intent=new Intent(getActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url()+ "/web/index.html#/pages/feedback/report?id="+SpUtil.getToken()+"&fromType=1&fromId="+user_id);
|
||||
Intent intent = new Intent(getActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/feedback/report?id=" + SpUtil.getToken() + "&fromType=1&fromId=" + user_id);
|
||||
intent.putExtra("title", "举报");
|
||||
startActivity(intent);
|
||||
|
||||
@@ -308,15 +323,15 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
contentView.findViewById(R.id.action_report).setOnClickListener(listener);
|
||||
contentView.findViewById(R.id.action_blacklist).setOnClickListener(listener);
|
||||
|
||||
if (type==1){
|
||||
if (type == 1) {
|
||||
contentView.findViewById(R.id.action_set_manager).setVisibility(VISIBLE);
|
||||
contentView.findViewById(R.id.action_kick_out).setVisibility(VISIBLE);
|
||||
contentView.findViewById(R.id.action_set_host).setVisibility(VISIBLE);
|
||||
}else if (type==2){
|
||||
} else if (type == 2) {
|
||||
contentView.findViewById(R.id.action_set_manager).setVisibility(GONE);
|
||||
contentView.findViewById(R.id.action_kick_out).setVisibility(VISIBLE);
|
||||
contentView.findViewById(R.id.action_set_host).setVisibility(VISIBLE);
|
||||
}else if (type==3){
|
||||
} else if (type == 3) {
|
||||
contentView.findViewById(R.id.action_set_manager).setVisibility(GONE);
|
||||
contentView.findViewById(R.id.action_set_host).setVisibility(GONE);
|
||||
contentView.findViewById(R.id.action_kick_out).setVisibility(VISIBLE);
|
||||
@@ -389,9 +404,9 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.roomMCz.setText("上麦");
|
||||
}
|
||||
|
||||
if(userInfo.getIs_follow()==1){
|
||||
if (userInfo.getIs_follow() == 1) {
|
||||
mBinding.imRoomGz.setImageDrawable(getResources().getDrawable(com.xscm.moduleutil.R.mipmap.room_ygz));
|
||||
}else {
|
||||
} else {
|
||||
mBinding.imRoomGz.setImageDrawable(getResources().getDrawable(com.xscm.moduleutil.R.mipmap.room_gz));
|
||||
}
|
||||
|
||||
@@ -401,23 +416,23 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
// mBinding.imGs.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
|
||||
if (userInfo.getIs_room_owner().equals("1")){
|
||||
close_type=1;
|
||||
}else if (userInfo.getIs_manager().equals("1")){
|
||||
close_type=2;
|
||||
}else if (userInfo.getIs_host().equals("1")){
|
||||
close_type=3;
|
||||
}else {
|
||||
close_type=4;
|
||||
if (userInfo.getIs_room_owner().equals("1")) {
|
||||
close_type = 1;
|
||||
} else if (userInfo.getIs_manager().equals("1")) {
|
||||
close_type = 2;
|
||||
} else if (userInfo.getIs_host().equals("1")) {
|
||||
close_type = 3;
|
||||
} else {
|
||||
close_type = 4;
|
||||
}
|
||||
|
||||
// if (user_id.equals(SpUtil.getUserId()+"")){
|
||||
// mBinding.tvGh.setVisibility(GONE);
|
||||
// }else {
|
||||
if (userInfo!=null) {
|
||||
if (userInfo != null) {
|
||||
mBinding.tvGh.setVisibility(VISIBLE);
|
||||
mBinding.tvGh.setText("所属公会:"+((userInfo.getGuild()!=null && !userInfo.getGuild().isEmpty()) ? userInfo.getGuild() : "无"));
|
||||
}else {
|
||||
mBinding.tvGh.setText("所属公会:" + ((userInfo.getGuild() != null && !userInfo.getGuild().isEmpty()) ? userInfo.getGuild() : "无"));
|
||||
} else {
|
||||
mBinding.tvGh.setVisibility(GONE);
|
||||
}
|
||||
// }
|
||||
@@ -427,9 +442,9 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
dianj(1);
|
||||
}
|
||||
|
||||
public void dianj(int type){
|
||||
if (type==1) {
|
||||
guanType=1;
|
||||
public void dianj(int type) {
|
||||
if (type == 1) {
|
||||
guanType = 1;
|
||||
setTextViewStyle(mBinding.textView2, false);
|
||||
setTextViewStyle(mBinding.textView1, true);
|
||||
if (userInfo.getQinmi() != null && !userInfo.getQinmi().equals("")) {
|
||||
@@ -441,12 +456,12 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.tvNickname1.setText(userInfo.getQinmi().getNickname1());
|
||||
mBinding.tvNickname2.setText(userInfo.getQinmi().getNickname2());
|
||||
mBinding.tvRelation.setText(userInfo.getQinmi().getRelation_name());
|
||||
mBinding.tvTime.setText(TimeUtils.formatDuration2(Long.parseLong(userInfo.getQinmi().getEnd_time())*1000 - System.currentTimeMillis()));
|
||||
}else {
|
||||
mBinding.tvTime.setText(TimeUtils.formatDuration2(Long.parseLong(userInfo.getQinmi().getEnd_time()) * 1000 - System.currentTimeMillis()));
|
||||
} else {
|
||||
mBinding.ll.setVisibility(GONE);
|
||||
}
|
||||
}else if (type==2){
|
||||
guanType=2;
|
||||
} else if (type == 2) {
|
||||
guanType = 2;
|
||||
setTextViewStyle(mBinding.textView2, true);
|
||||
setTextViewStyle(mBinding.textView1, false);
|
||||
if (userInfo.getZhenai() != null && !userInfo.getZhenai().equals("")) {
|
||||
@@ -458,13 +473,14 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.tvNickname1.setText(userInfo.getZhenai().getNickname1());
|
||||
mBinding.tvNickname2.setText(userInfo.getZhenai().getNickname2());
|
||||
mBinding.tvRelation.setText(userInfo.getZhenai().getRelation_name());
|
||||
mBinding.tvTime.setText(TimeUtils.formatDuration2(Long.parseLong(userInfo.getZhenai().getEnd_time())*1000 - System.currentTimeMillis()));
|
||||
}else {
|
||||
mBinding.tvTime.setText(TimeUtils.formatDuration2(Long.parseLong(userInfo.getZhenai().getEnd_time()) * 1000 - System.currentTimeMillis()));
|
||||
} else {
|
||||
mBinding.ll.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setTextViewStyle(TextView textView, boolean isSelected) {
|
||||
if (isSelected) {
|
||||
textView.setTextColor(getResources().getColor(android.R.color.white));
|
||||
@@ -477,18 +493,18 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
|
||||
|
||||
private void updateUIBasedOnTypeAndUser() {
|
||||
int userId= SpUtil.getUserId();
|
||||
boolean isSelf =userId==userInfo.getUser_id();
|
||||
int userId = SpUtil.getUserId();
|
||||
boolean isSelf = userId == userInfo.getUser_id();
|
||||
// if (pit_number!=null && pit_number.equals("-1")){
|
||||
// type=0;
|
||||
// isSelf=false;
|
||||
// }
|
||||
if (userInfo.getIs_in_pit() == 1){
|
||||
if (userInfo.getIs_in_pit() == 1) {
|
||||
mBinding.roomMCz.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
} else {
|
||||
mBinding.roomMCz.setVisibility(GONE);
|
||||
}
|
||||
if (paim==1 && pit_number!=null &&( pit_number.equals("888") || pit_number.equals("111") || pit_number.equals("222") || pit_number.equals("333"))){
|
||||
if (paim == 1 && pit_number != null && (pit_number.equals("888") || pit_number.equals("111") || pit_number.equals("222") || pit_number.equals("333"))) {
|
||||
mBinding.roomMCz.setVisibility(GONE);
|
||||
}
|
||||
|
||||
@@ -505,7 +521,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
} else {
|
||||
mBinding.roomMCz.setText("抱麦");
|
||||
}
|
||||
if (isSelf){
|
||||
if (isSelf) {
|
||||
mBinding.roomDian.setVisibility(GONE);
|
||||
mBinding.roomJb.setVisibility(View.GONE);
|
||||
mBinding.roomLh.setVisibility(View.GONE);
|
||||
@@ -520,14 +536,14 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
|
||||
break;
|
||||
case 2://管理员
|
||||
if (close_type==1){ //管理员查看房主信息
|
||||
if (close_type == 1) { //管理员查看房主信息
|
||||
mBinding.roomDian.setVisibility(View.GONE);
|
||||
mBinding.roomJb.setVisibility(View.VISIBLE);
|
||||
mBinding.roomLh.setVisibility(View.VISIBLE);
|
||||
mBinding.roomBo.setVisibility(VISIBLE);
|
||||
mBinding.roomMCz.setVisibility(GONE);
|
||||
|
||||
}else {
|
||||
} else {
|
||||
mBinding.roomDian.setVisibility(View.VISIBLE);
|
||||
mBinding.roomJb.setVisibility(GONE);
|
||||
mBinding.roomLh.setVisibility(GONE);
|
||||
@@ -544,7 +560,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.roomMCz.setText("抱麦");
|
||||
}
|
||||
}
|
||||
if (isSelf){
|
||||
if (isSelf) {
|
||||
mBinding.roomDian.setVisibility(GONE);
|
||||
mBinding.roomJb.setVisibility(View.GONE);
|
||||
mBinding.roomLh.setVisibility(View.GONE);
|
||||
@@ -559,13 +575,13 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.imQml.setVisibility(VISIBLE);
|
||||
break;
|
||||
case 3:
|
||||
if (close_type==1 ||close_type==2){ //主持查看房主或者管理员信息
|
||||
if (close_type == 1 || close_type == 2) { //主持查看房主或者管理员信息
|
||||
mBinding.roomDian.setVisibility(View.GONE);
|
||||
mBinding.roomJb.setVisibility(View.VISIBLE);
|
||||
mBinding.roomLh.setVisibility(View.VISIBLE);
|
||||
mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
mBinding.roomMCz.setVisibility(GONE);
|
||||
}else {
|
||||
} else {
|
||||
mBinding.roomDian.setVisibility(View.VISIBLE);
|
||||
mBinding.roomJb.setVisibility(GONE);
|
||||
mBinding.roomLh.setVisibility(GONE);
|
||||
@@ -582,7 +598,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.roomMCz.setText("抱麦");
|
||||
}
|
||||
}
|
||||
if (isSelf){
|
||||
if (isSelf) {
|
||||
mBinding.roomDian.setVisibility(GONE);
|
||||
mBinding.roomJb.setVisibility(View.GONE);
|
||||
mBinding.roomLh.setVisibility(View.GONE);
|
||||
@@ -597,14 +613,14 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.imQml.setVisibility(VISIBLE);
|
||||
break;
|
||||
case 4:
|
||||
if (close_type==1 ||close_type==2 ||close_type==3) {
|
||||
if (close_type == 1 || close_type == 2 || close_type == 3) {
|
||||
mBinding.roomDian.setVisibility(GONE);
|
||||
mBinding.roomJb.setVisibility(View.VISIBLE);
|
||||
mBinding.roomLh.setVisibility(View.VISIBLE);
|
||||
mBinding.roomMCz.setVisibility(GONE);
|
||||
mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
mBinding.imQml.setVisibility(VISIBLE);
|
||||
}else {
|
||||
} else {
|
||||
mBinding.roomDian.setVisibility(GONE);
|
||||
mBinding.roomJb.setVisibility(View.VISIBLE);
|
||||
mBinding.roomLh.setVisibility(View.VISIBLE);
|
||||
@@ -612,7 +628,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
mBinding.imQml.setVisibility(GONE);
|
||||
}
|
||||
if (isSelf){
|
||||
if (isSelf) {
|
||||
mBinding.roomDian.setVisibility(GONE);
|
||||
mBinding.roomJb.setVisibility(View.GONE);
|
||||
mBinding.roomLh.setVisibility(View.GONE);
|
||||
@@ -631,58 +647,10 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// switch (type) {
|
||||
// case 1: // 房主
|
||||
// case 2: // 管理员
|
||||
// case 3: // 主持
|
||||
// if (isSelf) {
|
||||
// mBinding.roomDian.setVisibility(View.GONE);
|
||||
// mBinding.roomJb.setVisibility(View.GONE);
|
||||
// mBinding.roomLh.setVisibility(View.GONE);
|
||||
// mBinding.roomBo.setVisibility(View.GONE);
|
||||
// } else {
|
||||
// mBinding.roomDian.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomJb.setVisibility(View.GONE);
|
||||
// mBinding.roomLh.setVisibility(View.GONE);
|
||||
// mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// break;
|
||||
// case 4: // 普通用户
|
||||
// mBinding.roomDian.setVisibility(View.GONE);
|
||||
// if (isSelf) {
|
||||
// mBinding.roomJb.setVisibility(View.GONE);
|
||||
// mBinding.roomLh.setVisibility(View.GONE);
|
||||
// mBinding.roomBo.setVisibility(View.GONE);
|
||||
// mBinding.roomMCz.setVisibility(View.VISIBLE);
|
||||
// } else {
|
||||
// mBinding.roomJb.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomLh.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomMCz.setVisibility(View.GONE);
|
||||
// }
|
||||
// break;
|
||||
// case 0:
|
||||
// mBinding.roomDian.setVisibility(View.GONE);
|
||||
// if (isSelf) {
|
||||
// mBinding.roomJb.setVisibility(View.GONE);
|
||||
// mBinding.roomLh.setVisibility(View.GONE);
|
||||
// mBinding.roomBo.setVisibility(View.GONE);
|
||||
// mBinding.roomMCz.setVisibility(View.VISIBLE);
|
||||
// } else {
|
||||
// mBinding.roomJb.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomLh.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomMCz.setVisibility(View.GONE);
|
||||
// }
|
||||
// default:
|
||||
// // 默认处理
|
||||
// break;
|
||||
// }
|
||||
|
||||
}
|
||||
if (isPk) {
|
||||
mBinding.roomBo.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downPit() {
|
||||
@@ -741,10 +709,10 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
|
||||
@Override
|
||||
public void userGuanzSuccess(String s) {
|
||||
if (userInfo.getIs_follow()==1){
|
||||
if (userInfo.getIs_follow() == 1) {
|
||||
userInfo.setIs_follow(0);
|
||||
mBinding.imRoomGz.setImageDrawable(getResources().getDrawable(com.xscm.moduleutil.R.mipmap.room_gz));
|
||||
}else {
|
||||
} else {
|
||||
userInfo.setIs_follow(1);
|
||||
mBinding.imRoomGz.setImageDrawable(getResources().getDrawable(com.xscm.moduleutil.R.mipmap.room_ygz));
|
||||
}
|
||||
|
||||
@@ -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,24 +110,37 @@ 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);
|
||||
// int progress = SpUtil.getMusicVolume();
|
||||
// if (progress == 0) {
|
||||
// progress = 100;
|
||||
// }
|
||||
// mBinding.seekBar1.setProgress(progress);
|
||||
// 设置 seekBar1 的默认进度为 100
|
||||
// mBinding.seekBar1.setProgress(100);
|
||||
// 更新对应的 TextView 显示内容
|
||||
mBinding.tvSeekbarValue.setText("人声" + progress + "%");
|
||||
// mBinding.tvSeekbarValue.setText("人声" + progress + "%");
|
||||
|
||||
|
||||
// 获取新演唱者的音量设置
|
||||
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
|
||||
@@ -133,21 +153,26 @@ public class TunerDialogFragment extends BaseMvpDialogFragment<WheatPresenter, R
|
||||
|
||||
}
|
||||
});
|
||||
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
|
||||
@@ -209,6 +234,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() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tool="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
@@ -216,7 +217,7 @@
|
||||
android:background="@drawable/bg_r100_hui"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="2001"
|
||||
tool:text="2001"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
@@ -241,7 +242,7 @@
|
||||
android:background="@drawable/bg_r100_hui"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="12"
|
||||
tool:text="12"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
@@ -266,7 +267,7 @@
|
||||
android:background="@drawable/bg_r100_hui"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="1"
|
||||
tool:text="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
@@ -8,9 +8,16 @@
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -22,7 +29,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_1"
|
||||
@@ -44,7 +51,7 @@
|
||||
android:gravity="center"
|
||||
android:text="选择话题"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_16"
|
||||
@@ -52,7 +59,7 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:src="@mipmap/up_t" />
|
||||
android:src="@mipmap/up_t"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
@@ -78,7 +85,7 @@
|
||||
android:maxLength="1200"
|
||||
android:textColor="#333333"
|
||||
android:textColorHint="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
android:textSize="@dimen/sp_15"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sz"
|
||||
@@ -92,7 +99,7 @@
|
||||
android:gravity="bottom"
|
||||
android:text="0/1200"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
android:textSize="@dimen/sp_12"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@@ -102,7 +109,7 @@
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_2" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_2"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_fb"
|
||||
@@ -116,8 +123,9 @@
|
||||
android:text="立即发布"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rv_photo_wall" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/rv_photo_wall"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -53,7 +53,6 @@
|
||||
android:id="@+id/ll_youth"
|
||||
style="@style/My_Info_Item_LL_Style"
|
||||
android:background="@drawable/bg_r15_white"
|
||||
android:visibility="gone"
|
||||
>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
package com.tencent.qcloud.tuikit.tuichat.classicui.page;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.tencent.qcloud.tuicore.TUIConstants;
|
||||
import com.tencent.qcloud.tuicore.TUICore;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUIExtensionEventListener;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUIExtensionInfo;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUIValueCallback;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.google.gson.Gson;
|
||||
import com.tencent.qcloud.tuikit.tuichat.R;
|
||||
import com.tencent.qcloud.tuikit.tuichat.TUIChatConstants;
|
||||
import com.tencent.qcloud.tuikit.tuichat.bean.C2CChatInfo;
|
||||
import com.tencent.qcloud.tuikit.tuichat.bean.ChatInfo;
|
||||
import com.tencent.qcloud.tuikit.tuichat.presenter.C2CChatPresenter;
|
||||
import com.tencent.qcloud.tuikit.tuichat.presenter.FriendProfilePresenter;
|
||||
import com.tencent.qcloud.tuikit.tuichat.util.TUIChatLog;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class TUIC2CChatFragment extends TUIBaseChatFragment {
|
||||
private static final String TAG = TUIC2CChatFragment.class.getSimpleName();
|
||||
@@ -63,38 +56,89 @@ public class TUIC2CChatFragment extends TUIBaseChatFragment {
|
||||
}
|
||||
|
||||
private void setTitleBarExtension() {
|
||||
titleBar.getRightGroup().setVisibility(View.GONE);
|
||||
titleBar.getRightGroup().setVisibility(View.VISIBLE);
|
||||
titleBar.setRightIcon(R.drawable.chat_title_bar_more_menu_icon);
|
||||
titleBar.setOnRightClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put(TUIConstants.TUIChat.Extension.ChatNavigationMoreItem.USER_ID, chatInfo.getId());
|
||||
List<TUIExtensionInfo> extensionInfoList =
|
||||
TUICore.getExtensionList(TUIConstants.TUIChat.Extension.ChatNavigationMoreItem.CLASSIC_EXTENSION_ID, param);
|
||||
if (!extensionInfoList.isEmpty()) {
|
||||
Collections.sort(extensionInfoList, new Comparator<TUIExtensionInfo>() {
|
||||
// Map<String, Object> param = new HashMap<>();
|
||||
// param.put(TUIConstants.TUIChat.Extension.ChatNavigationMoreItem.USER_ID, chatInfo.getId());
|
||||
// List<TUIExtensionInfo> extensionInfoList =
|
||||
// TUICore.getExtensionList(TUIConstants.TUIChat.Extension.ChatNavigationMoreItem.CLASSIC_EXTENSION_ID, param);
|
||||
// if (!extensionInfoList.isEmpty()) {
|
||||
// Collections.sort(extensionInfoList, new Comparator<TUIExtensionInfo>() {
|
||||
// @Override
|
||||
// public int compare(TUIExtensionInfo o1, TUIExtensionInfo o2) {
|
||||
// return o2.getWeight() - o1.getWeight();
|
||||
// }
|
||||
// });
|
||||
// TUIExtensionInfo extensionInfo = extensionInfoList.get(0);
|
||||
// TUIExtensionEventListener eventListener = extensionInfo.getExtensionListener();
|
||||
// if (eventListener != null) {
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
// map.put(TUIConstants.TUIChat.Extension.ChatNavigationMoreItem.USER_ID, chatInfo.getId());
|
||||
// map.put(TUIChatConstants.CHAT_BACKGROUND_URI, mChatBackgroundThumbnailUrl);
|
||||
// eventListener.onClicked(map);
|
||||
// }
|
||||
// } else {
|
||||
// String userId = chatInfo.getId();
|
||||
// openFriendProfile(userId);
|
||||
// }
|
||||
|
||||
// 显示默认菜单,包含举报功能
|
||||
showReportPopupMenu(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
private void showReportPopupMenu(View anchorView) {
|
||||
// 创建 PopupMenu 或自定义 PopupWindow
|
||||
android.widget.PopupMenu popupMenu = new android.widget.PopupMenu(getContext(), anchorView);
|
||||
|
||||
// 添加举报选项
|
||||
popupMenu.getMenu().add("举报");
|
||||
|
||||
// 设置点击监听
|
||||
popupMenu.setOnMenuItemClickListener(new android.widget.PopupMenu.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public int compare(TUIExtensionInfo o1, TUIExtensionInfo o2) {
|
||||
return o2.getWeight() - o1.getWeight();
|
||||
}
|
||||
});
|
||||
TUIExtensionInfo extensionInfo = extensionInfoList.get(0);
|
||||
TUIExtensionEventListener eventListener = extensionInfo.getExtensionListener();
|
||||
if (eventListener != null) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(TUIConstants.TUIChat.Extension.ChatNavigationMoreItem.USER_ID, chatInfo.getId());
|
||||
map.put(TUIChatConstants.CHAT_BACKGROUND_URI, mChatBackgroundThumbnailUrl);
|
||||
eventListener.onClicked(map);
|
||||
}
|
||||
} else {
|
||||
String userId = chatInfo.getId();
|
||||
openFriendProfile(userId);
|
||||
}
|
||||
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();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
popupMenu.show();
|
||||
}
|
||||
|
||||
private String getToken(){
|
||||
SharedPreferences sp = getContext().getSharedPreferences("Vespa", Context.MODE_PRIVATE);
|
||||
return sp.getString("token","");
|
||||
}
|
||||
private UserInfo getUserInfo(){
|
||||
SharedPreferences sp = getContext().getSharedPreferences("Vespa", Context.MODE_PRIVATE);
|
||||
String s= sp.getString("userInfo","");
|
||||
if (TextUtils.isEmpty(s)){
|
||||
return null;
|
||||
}
|
||||
Gson Gson = new Gson();
|
||||
UserInfo userInd =Gson.fromJson(s, UserInfo.class);
|
||||
return userInd;
|
||||
|
||||
}
|
||||
|
||||
public static class UserInfo {
|
||||
String user_id;
|
||||
|
||||
public String getUser_id() {
|
||||
return user_id;
|
||||
}
|
||||
|
||||
public void setUser_id(String user_id) {
|
||||
this.user_id = user_id;
|
||||
}
|
||||
}
|
||||
private void openFriendProfile(String userId) {
|
||||
// Intent intent = new Intent(getContext(), FriendProfileActivity.class);
|
||||
// intent.putExtra(TUIConstants.TUIChat.CHAT_ID, userId);
|
||||
|
||||
@@ -227,7 +227,15 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
||||
public class userInd{
|
||||
private int is_can_chat;//是否可以私聊,1:可以,0:不可以
|
||||
private int can_chat_money;//需要充值的金额
|
||||
private int userId;
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
public int getIs_can_chat() {
|
||||
return is_can_chat;
|
||||
}
|
||||
|
||||