1:修改BUG
This commit is contained in:
@@ -6,7 +6,7 @@ import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomPitBean implements Serializable {
|
||||
public class RoomPitBean implements Serializable ,Cloneable{
|
||||
|
||||
|
||||
/**
|
||||
@@ -81,4 +81,13 @@ public class RoomPitBean implements Serializable {
|
||||
private boolean occupied;
|
||||
private boolean imageType;//是否是演唱者
|
||||
|
||||
public RoomPitBean clone(){
|
||||
try {
|
||||
return (RoomPitBean)super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.xscm.moduleutil.rtc;
|
||||
|
||||
|
||||
import static com.blankj.utilcode.util.SnackbarUtils.getView;
|
||||
import static io.agora.rtc2.Constants.NETWORK_TYPE_DISCONNECTED;
|
||||
import static io.agora.rtc2.Constants.NETWORK_TYPE_LAN;
|
||||
import static io.agora.rtc2.Constants.NETWORK_TYPE_MOBILE_2G;
|
||||
@@ -12,28 +11,20 @@ import static io.agora.rtc2.Constants.NETWORK_TYPE_UNKNOWN;
|
||||
import static io.agora.rtc2.Constants.NETWORK_TYPE_WIFI;
|
||||
import static io.agora.rtc2.video.VideoEncoderConfiguration.*;
|
||||
import static io.agora.rtc2.video.VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15;
|
||||
import static io.agora.rtc2.video.VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_30;
|
||||
import static io.agora.rtc2.video.VideoEncoderConfiguration.ORIENTATION_MODE.*;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.hardware.SensorManager;
|
||||
import android.media.projection.MediaProjection;
|
||||
import android.media.projection.MediaProjectionManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
import android.view.OrientationEventListener;
|
||||
import android.view.SurfaceView;
|
||||
|
||||
import android.view.WindowManager;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -60,7 +51,6 @@ import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -386,6 +376,13 @@ public class AgoraManager {
|
||||
private IRtcEngineEventHandler getDefaultEventHandler() {
|
||||
return new IRtcEngineEventHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onAudioEffectFinished(int soundId) {
|
||||
super.onAudioEffectFinished(soundId);
|
||||
LogUtils.e("onAudioEffectFinished", "soundId------>" + soundId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteAudioStateChanged(int uid, int state, int reason, int elapsed) {
|
||||
super.onRemoteAudioStateChanged(uid, state, reason, elapsed);
|
||||
@@ -471,6 +468,7 @@ public class AgoraManager {
|
||||
public void onSongSimpleInfoResult(String requestId, long songCode, String simpleInfo, int reason) {
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -258,4 +258,43 @@ public class TimeUtils {
|
||||
return "1天"; // 或者 return "0天";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据生日字符串计算年龄
|
||||
* @param birthDay 生日字符串,格式为 "yyyy-MM-dd"
|
||||
* @return 年龄
|
||||
*/
|
||||
public static int getAgeByBirthDay(String birthDay) {
|
||||
if (birthDay == null || birthDay.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date birthDate = sdf.parse(birthDay);
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
int currentYear = cal.get(Calendar.YEAR);
|
||||
int currentMonth = cal.get(Calendar.MONTH);
|
||||
int currentDay = cal.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
cal.setTime(birthDate);
|
||||
int birthYear = cal.get(Calendar.YEAR);
|
||||
int birthMonth = cal.get(Calendar.MONTH);
|
||||
int birthDayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
int age = currentYear - birthYear;
|
||||
|
||||
// 如果当前月份小于生日月份,或者月份相同但当前日期小于生日日期,则年龄减1
|
||||
if (currentMonth < birthMonth ||
|
||||
(currentMonth == birthMonth && currentDay < birthDayOfMonth)) {
|
||||
age--;
|
||||
}
|
||||
|
||||
return age < 0 ? 0 : age;
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user