82 添加签到延迟1分钟弹出。

This commit is contained in:
2025-12-30 19:05:23 +08:00
parent 7b6be82c54
commit 3f1b8ee2fa
6 changed files with 77 additions and 18 deletions

View File

@@ -19,6 +19,7 @@ import android.media.projection.MediaProjection;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
@@ -124,7 +125,7 @@ public class AgoraManager {
private Disposable disposableC;
// UI 刷新最小间隔ms
private static final long SOUND_UI_INTERVAL = 200;
private static final long SOUND_UI_INTERVAL = 120;
private final Handler uiHandler = new Handler(Looper.getMainLooper());
private long lastDispatchTime = 0;
@@ -563,9 +564,12 @@ public class AgoraManager {
// 1⃣ 构建局部 Map声网线程私有
Map<String, Integer> localMap = new HashMap<>();
for (AudioVolumeInfo info : speakers) {
String userId = info.uid > 0
? String.valueOf(info.uid)
: String.valueOf(SpUtil.getUserId());
String userId = "";
if (info.uid == 0) {
userId = SpUtil.getUserId()+"";
}else {
userId = String.valueOf(info.uid);
}
localMap.put(userId, info.volume);
}
@@ -1011,6 +1015,7 @@ public class AgoraManager {
// }
// }
public void addSoundLevelListener(SoundLevelUpdateListener listener) {
LogUtils.e("AgoraManager", "addSoundLevelListener: " + listener +"============"+soundLevelUpdateListeners.size());
if (soundLevelUpdateListeners != null) {
soundLevelUpdateListeners.add(listener);
}
@@ -1022,10 +1027,24 @@ public class AgoraManager {
}
}
public void removeSoundLevelListenerAll() {
if (soundLevelUpdateListeners != null)
soundLevelUpdateListeners.clear();
}
/**
* This method searches for music based on a given keyword and page number.
* It initializes the music content center if it's not already created.
*
* @param keyword The keyword to search for music
* @param page The page number of the search results
*/
public void searchMusic(String keyword, int page) {
// Check if musicContentCenter is initialized, if not create it
if (musicContentCenter == null) {
musicContentCenter = IAgoraMusicContentCenter.create(rtcEngine);
}
// Perform the music search with the keyword, page number and page size (20)
musicContentCenter.searchMusic(keyword, page, 20);
}

View File

@@ -5,4 +5,6 @@ object CustomMsgCode {
val CODE_TASK_APPRENTICE_JOIN_ROOM = 132
val CODE_TASK_APPRENTICE_JOIN_ROOM_MSG = "您的师傅邀请您进入房间,您是否同意?"
val CODE_TASK_APPRENTICE_JOIN_ROOM_MSG_REFUSE = "您的徒弟拒绝了您的邀请。"
val CODE_USER_SIGN_IN = "签到"
}