Compare commits
7 Commits
773db1da25
...
ea7e9e0e8a
| Author | SHA1 | Date | |
|---|---|---|---|
| ea7e9e0e8a | |||
| 24bae533cc | |||
| 6167916152 | |||
| 74d45c9761 | |||
| 22c4e40d24 | |||
| 85756d85c6 | |||
| c1d13cd34c |
@@ -260,8 +260,7 @@
|
||||
android:id="@+id/iv_login_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:src="@drawable/theme_bg"
|
||||
/>
|
||||
android:src="@drawable/theme_bg" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -29,7 +29,7 @@ isBuildModule=false
|
||||
android.injected.testOnly=false
|
||||
|
||||
APP_VERSION_NAME=1.2.7
|
||||
APP_VERSION_CODE=179
|
||||
APP_VERSION_CODE=181
|
||||
|
||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||
|
||||
@@ -184,7 +184,7 @@ dependencies {
|
||||
// api( 'io.agora.rtc:agora-special-full:4.1.1.29')
|
||||
api('com.github.AgoraIO-Community:LyricsView:1.1.3')
|
||||
//声网集成屏幕共享
|
||||
def agora_sdk_version = "4.5.2"
|
||||
def agora_sdk_version = "4.6.0"
|
||||
api "io.agora.rtc:full-sdk:${agora_sdk_version}"
|
||||
// api("io.agora.rtc:lite-sdk:${agora_sdk_version}")
|
||||
// api ("io.agora.rtc:voice-sdk:${agora_sdk_version}")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.xscm.moduleutil.bean.room.FriendInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -16,7 +17,7 @@ public class UserInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final String FEMALE = "2";
|
||||
public static final String MALE = "1";
|
||||
// @SerializedName(value = "id", alternate = "user_id")
|
||||
private int id;
|
||||
private int user_id; //用户id
|
||||
private String user_code;//用户id码
|
||||
private String avatar;//头像
|
||||
|
||||
@@ -108,7 +108,7 @@ public class RetrofitClient {
|
||||
sslContext.init(null, new TrustManager[]{trustAllCert}, new SecureRandom());
|
||||
|
||||
final OkHttpClient client = new OkHttpClient.Builder()
|
||||
// .addInterceptor(new LoggerInterceptor("HttpLog", true))
|
||||
// .addInterceptor(new LogInterceptor())
|
||||
.addInterceptor(new DataLoggingInterceptor(new DataLogger()))
|
||||
.addInterceptor(new AccessTokenInterceptor(headers))
|
||||
.proxy(Proxy.NO_PROXY)
|
||||
@@ -2264,6 +2264,10 @@ public class RetrofitClient {
|
||||
observer.onNext(new RoomAuction.AuctionListBean());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
// .enqueue(new Callback<BaseModel<RoomAuction.AuctionListBean>>() {
|
||||
//
|
||||
|
||||
@@ -2,25 +2,33 @@ package com.xscm.moduleutil.rtc;
|
||||
|
||||
|
||||
import static com.blankj.utilcode.util.SnackbarUtils.getView;
|
||||
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.ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE;
|
||||
import static io.agora.rtc2.video.VideoEncoderConfiguration.STANDARD_BITRATE;
|
||||
import static io.agora.rtc2.video.VideoEncoderConfiguration.VD_640x360;
|
||||
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.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;
|
||||
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.blankj.utilcode.util.ThreadUtils;
|
||||
import com.blankj.utilcode.util.*;
|
||||
import com.liulishuo.okdownload.DownloadTask;
|
||||
import com.liulishuo.okdownload.StatusUtil;
|
||||
import com.liulishuo.okdownload.core.cause.EndCause;
|
||||
@@ -43,6 +51,7 @@ 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;
|
||||
@@ -206,21 +215,50 @@ public class AgoraManager {
|
||||
/*Enable video module*/
|
||||
rtcEngine.enableVideo();
|
||||
// Setup video encoding configs
|
||||
rtcEngine.setVideoEncoderConfiguration(new VideoEncoderConfiguration(
|
||||
VD_640x360,
|
||||
FRAME_RATE_FPS_15,
|
||||
STANDARD_BITRATE,
|
||||
ORIENTATION_MODE_ADAPTIVE
|
||||
));
|
||||
// rtcEngine.setVideoEncoderConfiguration(new VideoEncoderConfiguration(
|
||||
// VD_640x360,
|
||||
// FRAME_RATE_FPS_30,
|
||||
// STANDARD_BITRATE,
|
||||
// ORIENTATION_MODE_FIXED_PORTRAIT
|
||||
// ));
|
||||
|
||||
|
||||
|
||||
/*Set up to play remote sound with receiver*/
|
||||
rtcEngine.setDefaultAudioRoutetoSpeakerphone(true);
|
||||
|
||||
|
||||
// OrientationEventListener orientationListener = new OrientationEventListener(context,
|
||||
// SensorManager.SENSOR_DELAY_NORMAL) {
|
||||
// @Override
|
||||
// public void onOrientationChanged(int orientation) {
|
||||
// int angle = calculateScreenAngle(orientation);
|
||||
// try {
|
||||
// rtcEngine.setVideoOrientation(angle); // 通知声网引擎调整视频方向
|
||||
// } catch (Exception e) {
|
||||
// Log.e("AgoraManager", "Set video orientation failed", e);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// orientationListener.enable(); // 启用监听
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e("AgoraManager", "Failed to configure RtcEngine", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int calculateScreenAngle(int orientation) {
|
||||
if (orientation >= 315 || orientation < 45) {
|
||||
return 0; // 竖屏(0度)
|
||||
} else if (orientation >= 45 && orientation < 135) {
|
||||
return 90; // 横屏右(90度)
|
||||
} else if (orientation >= 135 && orientation < 225) {
|
||||
return 180; // 倒竖屏(180度)
|
||||
} else {
|
||||
return 270; // 横屏左(270度)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 加入语音聊天房间
|
||||
*/
|
||||
@@ -802,14 +840,58 @@ public class AgoraManager {
|
||||
// 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();
|
||||
|
||||
DisplayMetrics outMetrics=new DisplayMetrics();
|
||||
display.getMetrics(outMetrics);
|
||||
|
||||
// // 设置屏幕采集的参数
|
||||
screenCaptureParameters.captureVideo = true;
|
||||
screenCaptureParameters.videoCaptureParameters.width = 720;
|
||||
screenCaptureParameters.videoCaptureParameters.height = 920;
|
||||
screenCaptureParameters.videoCaptureParameters.width = outMetrics.widthPixels;
|
||||
screenCaptureParameters.videoCaptureParameters.height = outMetrics.heightPixels;
|
||||
// screenCaptureParameters.videoCaptureParameters.height = (int) (3840 * 1.0f / outMetrics.widthPixels * outMetrics.heightPixels);
|
||||
screenCaptureParameters.videoCaptureParameters.framerate = 15;
|
||||
screenCaptureParameters.captureAudio = true;
|
||||
screenCaptureParameters.audioCaptureParameters.captureSignalVolume = 50;
|
||||
|
||||
screenCaptureParameters.audioCaptureParameters.captureSignalVolume =50;
|
||||
screenCaptureParameters.videoCaptureParameters.contentHint=1 ;
|
||||
rtcEngine.setVideoEncoderConfiguration(new VideoEncoderConfiguration(
|
||||
VD_360x360,
|
||||
FRAME_RATE_FPS_15,
|
||||
STANDARD_BITRATE,
|
||||
ORIENTATION_MODE_ADAPTIVE
|
||||
));
|
||||
rtcEngine.startScreenCapture(screenCaptureParameters);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ public enum EnvironmentEnum {
|
||||
"ZOjTqAJmUL563EKFKySrUwAHtx4hKt",
|
||||
"midi01",
|
||||
"https://midi01.oss-cn-beijing.aliyuncs.com/",
|
||||
"wxef1289d8a89b41d4",
|
||||
"wxfc7bf7ca8c71840d",
|
||||
1600101474,
|
||||
"a3f0f0c78307434fa1c697c3429fbdcf",
|
||||
"tcp://81.70.45.221",
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
package com.xscm.moduleutil.utils.logger;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.ResponseBody;
|
||||
import okhttp3.internal.http.HttpHeaders;
|
||||
import okio.Buffer;
|
||||
import okio.BufferedSource;
|
||||
|
||||
/**
|
||||
* OkHttp 日志拦截器,用于打印请求和响应详情
|
||||
*/
|
||||
public class LogInterceptor implements Interceptor {
|
||||
private static final String TAG = "NetworkLog";
|
||||
private static final Charset UTF8 = StandardCharsets.UTF_8;
|
||||
|
||||
// 日志开关(可根据debug/release环境动态设置)
|
||||
private boolean isLogEnabled = true;
|
||||
// 是否打印请求体
|
||||
private boolean logRequestBody = true;
|
||||
// 是否打印响应体
|
||||
|
||||
private boolean logResponseBody = true;
|
||||
// 最大日志长度(避免过大的响应体导致日志刷屏)
|
||||
private int maxLogLength = 2048;
|
||||
|
||||
public LogInterceptor() {
|
||||
}
|
||||
|
||||
// 配置方法
|
||||
public LogInterceptor setLogEnabled(boolean enabled) {
|
||||
isLogEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LogInterceptor setLogRequestBody(boolean logRequestBody) {
|
||||
this.logRequestBody = logRequestBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LogInterceptor setLogResponseBody(boolean logResponseBody) {
|
||||
this.logResponseBody = logResponseBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LogInterceptor setMaxLogLength(int maxLogLength) {
|
||||
this.maxLogLength = maxLogLength;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Response intercept(@NonNull Chain chain) throws IOException {
|
||||
if (!isLogEnabled) {
|
||||
return chain.proceed(chain.request());
|
||||
}
|
||||
|
||||
Request request = chain.request();
|
||||
// 打印请求日志
|
||||
logRequest(request);
|
||||
|
||||
// 记录请求开始时间,用于计算耗时
|
||||
long startNs = System.nanoTime();
|
||||
Response response;
|
||||
try {
|
||||
response = chain.proceed(request);
|
||||
} catch (Exception e) {
|
||||
// 打印请求异常
|
||||
Log.e(TAG, "请求失败: " + e.getMessage());
|
||||
throw e;
|
||||
}
|
||||
// 计算请求耗时
|
||||
long tookMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs);
|
||||
|
||||
// 打印响应日志
|
||||
logResponse(response, tookMs);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印请求日志
|
||||
*/
|
||||
private void logRequest(Request request) {
|
||||
try {
|
||||
StringBuilder log = new StringBuilder();
|
||||
log.append("\n==================== 请求开始 ====================\n");
|
||||
|
||||
// 请求行: 方法 + URL
|
||||
log.append(String.format("方法: %s URL: %s\n", request.method(), request.url()));
|
||||
|
||||
// 请求头
|
||||
log.append("请求头:\n");
|
||||
for (String name : request.headers().names()) {
|
||||
// 脱敏敏感头信息(如Authorization、Cookie等)
|
||||
String value = isSensitiveHeader(name) ? "***" : request.headers().get(name);
|
||||
log.append(String.format(" %s: %s\n", name, value));
|
||||
}
|
||||
|
||||
// 请求体
|
||||
if (logRequestBody && request.body() != null) {
|
||||
RequestBody requestBody = request.body();
|
||||
if (requestBody.contentLength() > 0) {
|
||||
log.append("请求体:\n");
|
||||
|
||||
// 复制请求体(避免原请求体被消耗)
|
||||
Buffer buffer = new Buffer();
|
||||
requestBody.writeTo(buffer);
|
||||
Charset charset = UTF8;
|
||||
MediaType contentType = requestBody.contentType();
|
||||
if (contentType != null) {
|
||||
charset = contentType.charset(UTF8);
|
||||
}
|
||||
|
||||
// 读取请求体内容
|
||||
String body = buffer.readString(charset);
|
||||
// 格式化JSON(如果是JSON类型)
|
||||
if (isJson(contentType)) {
|
||||
body = formatJson(body);
|
||||
}
|
||||
// 截断过长的日志
|
||||
log.append(truncateLog(body)).append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
log.append("==================== 请求结束 ====================\n");
|
||||
Log.d(TAG, log.toString());
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "打印请求日志失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印响应日志
|
||||
*/
|
||||
private void logResponse(Response response, long tookMs) {
|
||||
try {
|
||||
StringBuilder log = new StringBuilder();
|
||||
log.append("\n==================== 响应开始 ====================\n");
|
||||
|
||||
// 响应行: 状态码 + 消息 + 耗时
|
||||
log.append(String.format("状态码: %d 消息: %s 耗时: %dms\n",
|
||||
response.code(), response.message(), tookMs));
|
||||
|
||||
// 响应头
|
||||
log.append("响应头:\n");
|
||||
for (String name : response.headers().names()) {
|
||||
log.append(String.format(" %s: %s\n", name, response.headers().get(name)));
|
||||
}
|
||||
|
||||
// 响应体
|
||||
if (logResponseBody && HttpHeaders.hasBody(response)) {
|
||||
ResponseBody responseBody = response.body();
|
||||
if (responseBody != null) {
|
||||
BufferedSource source = responseBody.source();
|
||||
source.request(Long.MAX_VALUE); // 读取整个响应体
|
||||
Buffer buffer = source.buffer();
|
||||
|
||||
Charset charset = UTF8;
|
||||
MediaType contentType = responseBody.contentType();
|
||||
if (contentType != null) {
|
||||
charset = contentType.charset(UTF8);
|
||||
}
|
||||
|
||||
// 读取响应体内容
|
||||
String body = buffer.clone().readString(charset);
|
||||
// 格式化JSON
|
||||
if (isJson(contentType)) {
|
||||
body = formatJson(body);
|
||||
}
|
||||
// 截断过长的日志
|
||||
log.append("响应体:\n").append(truncateLog(body)).append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
log.append("==================== 响应结束 ====================\n");
|
||||
Log.d(TAG, log.toString());
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "打印响应日志失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为JSON类型
|
||||
*/
|
||||
private boolean isJson(MediaType mediaType) {
|
||||
if (mediaType == null) return false;
|
||||
return mediaType.type().equals("application") &&
|
||||
mediaType.subtype().equals("json");
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化JSON字符串(增强可读性)
|
||||
*/
|
||||
private String formatJson(String json) {
|
||||
try {
|
||||
// 简单格式化(可根据需要使用更复杂的JSON格式化库)
|
||||
StringBuilder formatted = new StringBuilder();
|
||||
int indent = 0;
|
||||
boolean inQuotes = false;
|
||||
char lastChar = ' ';
|
||||
|
||||
for (char c : json.toCharArray()) {
|
||||
if (c == '"' && lastChar != '\\') {
|
||||
inQuotes = !inQuotes;
|
||||
}
|
||||
|
||||
if (!inQuotes) {
|
||||
switch (c) {
|
||||
case '{':
|
||||
case '[':
|
||||
formatted.append(c).append("\n");
|
||||
indent += 4;
|
||||
formatted.append(" ".repeat(indent));
|
||||
break;
|
||||
case '}':
|
||||
case ']':
|
||||
formatted.append("\n");
|
||||
indent -= 4;
|
||||
formatted.append(" ".repeat(indent)).append(c);
|
||||
break;
|
||||
case ',':
|
||||
formatted.append(c).append("\n").append(" ".repeat(indent));
|
||||
break;
|
||||
case ':':
|
||||
formatted.append(" : ");
|
||||
break;
|
||||
default:
|
||||
formatted.append(c);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
formatted.append(c);
|
||||
}
|
||||
lastChar = c;
|
||||
}
|
||||
return formatted.toString();
|
||||
} catch (Exception e) {
|
||||
// 格式化失败时返回原始字符串
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 截断过长的日志
|
||||
*/
|
||||
private String truncateLog(String log) {
|
||||
if (log.length() <= maxLogLength) {
|
||||
return log;
|
||||
}
|
||||
return log.substring(0, maxLogLength) + "\n...[日志过长,已截断]...";
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为敏感头信息(需要脱敏)
|
||||
*/
|
||||
private boolean isSensitiveHeader(String headerName) {
|
||||
String lowerHeader = headerName.toLowerCase();
|
||||
return lowerHeader.contains("authorization") ||
|
||||
lowerHeader.contains("cookie") ||
|
||||
lowerHeader.contains("token") ||
|
||||
lowerHeader.contains("secret");
|
||||
}
|
||||
}
|
||||
@@ -145,6 +145,7 @@ public class RoomMakeWheatView extends BaseWheatView {
|
||||
iv_tag_type.setVisibility(GONE);
|
||||
mCharmView.setVisibility(GONE);
|
||||
mTvName.setText(pitBean.getNickname()!=null && !pitBean.getNickname().equals("")?pitBean.getNickname():"拍卖者");
|
||||
mTvName.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_b);
|
||||
}else if (pitBean.getPit_number().equals("9")){
|
||||
iv_tag_type.setVisibility(VISIBLE);
|
||||
mCharmView.setVisibility(GONE);
|
||||
|
||||
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.1 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/za_maiw_b.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/za_maiw_o.png
Normal file
|
After Width: | Height: | Size: 130 KiB |
@@ -1096,8 +1096,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
val params = layoutParams
|
||||
params.width = ConstraintLayout.LayoutParams.MATCH_CONSTRAINT
|
||||
params.height = ConstraintLayout.LayoutParams.MATCH_CONSTRAINT
|
||||
params.horizontalBias = 0.5f
|
||||
params.verticalBias = 0.5f
|
||||
// params.horizontalBias = 0.5f
|
||||
// params.verticalBias = 0.5f
|
||||
floatingMagnetView!!.layoutParams = params
|
||||
} else {
|
||||
// 如果不是ConstraintLayout.LayoutParams,创建新的
|
||||
@@ -3931,10 +3931,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
|
||||
val roomBean = resp.room_info
|
||||
if (roomBean!!.type_id.equals("6")){
|
||||
return
|
||||
}
|
||||
this.mRoomBean = roomBean
|
||||
this.mRoomUserBean = resp.user_info
|
||||
this.mRoomOwnerBean = resp.room_owner
|
||||
this.mPitList = mRoomBean!!.pit_list
|
||||
this.mPitList = mRoomBean!!.pit_list!!
|
||||
|
||||
ImageUtils.loadHeadCC(resp.room_info.room_cover, mBinding!!.roomTop.avatar)
|
||||
mBinding!!.roomTop.name.text = roomBean.room_name
|
||||
|
||||
@@ -91,7 +91,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
private SelectGiftNumPopupWindow mSelectGiftNumPopupWindow;
|
||||
private KeyboardPopupWindow mKeyboardPopupWindow;
|
||||
private List<GiftNumBean> mGiftNumList;
|
||||
private RoonGiftModel roonGiftModel = null;
|
||||
private RoonGiftModel roonGiftModel = new RoonGiftModel();
|
||||
private GiftPackBean giftModel = null;
|
||||
private RoomInfoResp roomInfoResp;
|
||||
private String label_id;
|
||||
@@ -648,11 +648,12 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
beibaoId = roonGiftModel.getGift_id();
|
||||
MvpPre.roomGift(roomId, roonGiftModel.getGift_id(), giftNumber, userId, "2", pit, heart_id);
|
||||
}else {
|
||||
beibaoId = roonGiftModel.getGift_id();
|
||||
MvpPre.roomAuctionJoin(userInfo.getAuction_id(), userInfo.getUser_id() + "", roonGiftModel.getGift_id(), num, "2");
|
||||
roomGiftGiveEvent = new RoomGiftGiveEvent(userId, roomId, pit, num, 0, null, roonGiftModel, heart_id, userInfo.getAuction_id());
|
||||
EventBus.getDefault().post(roomGiftGiveEvent);
|
||||
roomGiftGiveEvent = null;
|
||||
MvpPre.roomAuctionJoin(userInfo.getAuction_id(), userInfo.getUser_id() + "", roonGiftModel.getGift_id(), num, "1");
|
||||
dismiss();
|
||||
// dismiss();
|
||||
}
|
||||
} else{
|
||||
giftNumber = num;
|
||||
@@ -814,9 +815,15 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
if (roomGiftGiveEvent != null) {
|
||||
EventBus.getDefault().post(roomGiftGiveEvent);
|
||||
roomGiftGiveEvent = null;
|
||||
dismiss();
|
||||
// dismiss();
|
||||
}
|
||||
dismiss();
|
||||
if (mBinding.viewPager.getCurrentItem()==0) {
|
||||
GiftPackEvent giftPackEvent = new GiftPackEvent();
|
||||
giftPackEvent.setBdid(beibaoId);
|
||||
EventBus.getDefault().post(giftPackEvent);
|
||||
MvpPre.getGiftPackListCount();
|
||||
}
|
||||
// dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -348,7 +348,7 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
|
||||
EMMessageInfo item = easeChatAdapter.getItem(position);
|
||||
RoomMessageEvent emMessage = item.getEmMessage();
|
||||
if (emMessage.getText().getFromUserInfo() != null) {
|
||||
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), emMessage.getText().getFromUserInfo().getUser_id() + "", emMessage.getText().getFromUserInfo().getPit_number(), getHostUser(roomInfoResp.getUser_info()), false, 5, isNumberWhether(), getChildFragmentManager());
|
||||
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), emMessage.getText().getFromUserInfo().getUser_id()!=0?emMessage.getText().getFromUserInfo().getUser_id()+"":emMessage.getText().getFromUserInfo().getId() + "", emMessage.getText().getFromUserInfo().getPit_number(), getHostUser(roomInfoResp.getUser_info()), false, 5, isNumberWhether(), getChildFragmentManager());
|
||||
}
|
||||
// String userId = item.getEmMessage().getStringAttribute("user_id", "");
|
||||
// if (!TextUtils.isEmpty(userId)) {
|
||||
|
||||
@@ -680,10 +680,13 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
mBinding.pB.setImageResource(com.xscm.moduleutil.R.mipmap.za_t);
|
||||
mBinding.btnRelation.setImageResource(com.xscm.moduleutil.R.mipmap.za_g);
|
||||
mBinding.tvRelation.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
|
||||
mBinding.tvRelation.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_b);
|
||||
mBinding.btnGift.setImageResource(com.xscm.moduleutil.R.mipmap.za_l);
|
||||
mBinding.tvGift.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
|
||||
mBinding.tvGift.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_b);
|
||||
mBinding.btnTime.setImageResource(com.xscm.moduleutil.R.mipmap.za_sj);
|
||||
mBinding.tvTimetg.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
|
||||
mBinding.tvTimetg.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_b);
|
||||
mBinding.ivJp.setImageResource(com.xscm.moduleutil.R.mipmap.za_ljjp);
|
||||
mBinding.avatar4.setImageResource(com.xscm.moduleutil.R.mipmap.za_m);
|
||||
mBinding.avatar5.setImageResource(com.xscm.moduleutil.R.mipmap.za_m);
|
||||
@@ -696,10 +699,13 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
mBinding.ivAuction1.setImageResource(com.xscm.moduleutil.R.mipmap.za_m, 0, "0");
|
||||
mBinding.ivAuction2.setImageResource(com.xscm.moduleutil.R.mipmap.za_m, 0, "0");
|
||||
mBinding.ivAuction3.setImageResource(com.xscm.moduleutil.R.mipmap.za_m, 0, "0");
|
||||
mBinding.nickName1.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
|
||||
mBinding.nickName2.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
|
||||
mBinding.nickName3.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
|
||||
setparams();
|
||||
mBinding.clBj1.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw);
|
||||
mBinding.clBj2.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw);
|
||||
mBinding.clBj3.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw);
|
||||
mBinding.clBj1.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_o);
|
||||
mBinding.clBj2.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_o);
|
||||
mBinding.clBj3.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_o);
|
||||
|
||||
} else {
|
||||
layoutParams.setMargins(0, 15, 0, 0);
|
||||
|
||||
@@ -208,7 +208,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
}
|
||||
});
|
||||
if (!CommonAppContext.getInstance().isShowAg){
|
||||
switchMic(1);
|
||||
switchMic(2);
|
||||
}else {
|
||||
isShow = true;
|
||||
switchMic(2);
|
||||
@@ -218,12 +218,12 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// requestScreenCapture();
|
||||
if (!isMicPlace) {
|
||||
joinChannel();
|
||||
isMicPlace = true;
|
||||
mBinding.im3.setImageResource(com.xscm.moduleutil.R.mipmap.clogs_car);
|
||||
CommonAppContext.getInstance().isMicPlace = true;
|
||||
|
||||
} else {
|
||||
isMicPlace = false;
|
||||
ToastUtils.show("将停止屏幕共享");
|
||||
@@ -245,7 +245,31 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
// mBinding.im3.setVisibility(GONE);
|
||||
// }
|
||||
}
|
||||
// 获取 MediaProjectionManager
|
||||
// MediaProjectionManager mediaProjectionManager = (MediaProjectionManager) getSelfActivity().getSystemService(Context.MEDIA_PROJECTION_SERVICE);
|
||||
// private MediaProjection[] mediaProjection = new MediaProjection[1];
|
||||
// private final ActivityResultLauncher<Intent> mediaProjectionLauncher = registerForActivityResult(
|
||||
// new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
// if (result.getResultCode() == Activity.RESULT_OK) {
|
||||
// try {
|
||||
// // 获取申请到的 MediaProjection
|
||||
// mediaProjection[0] = mediaProjectionManager
|
||||
// .getMediaProjection(result.getResultCode(), result.getData());
|
||||
// // r MediaProjection,需要在 startScreenCapture 之前调用
|
||||
//
|
||||
// AgoraManager.getInstance(getActivity()).setExternalMediaProjection(mediaProjection);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
|
||||
// 请求屏幕捕获
|
||||
private void requestScreenCapture() {
|
||||
// Intent intent = mediaProjectionManager.createScreenCaptureIntent();
|
||||
// mediaProjectionLauncher.launch(intent);
|
||||
}
|
||||
public void handleMsgType1028(RoomMessageEvent messageEvent){
|
||||
if (messageEvent.getMsgType()==1028){
|
||||
mBinding.tvHeartValue2.setText(messageEvent.getText().getHot_value());
|
||||
@@ -417,6 +441,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
|
||||
@Override
|
||||
public void onExitRoom() {
|
||||
CommonAppContext.getInstance().isMicPlace = false;
|
||||
// 调用退出房间方法
|
||||
if (label_id!=null && label_id.equals(LABEL_ID_MOVIE)){
|
||||
MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
@@ -619,7 +644,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
if (cpUserBean != null) {
|
||||
countDownTime(Long.parseLong(cpUserBean.getTime_day()));
|
||||
}
|
||||
mediaProjectionManager = (MediaProjectionManager) getContext().getSystemService(Context.MEDIA_PROJECTION_SERVICE);
|
||||
// mediaProjectionManager = (MediaProjectionManager) getContext().getSystemService(Context.MEDIA_PROJECTION_SERVICE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -674,22 +699,22 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
}
|
||||
}
|
||||
|
||||
private MediaProjection[] mediaProjection = new MediaProjection[1];
|
||||
private MediaProjectionManager mediaProjectionManager;
|
||||
private final ActivityResultLauncher<Intent> mediaProjectionLauncher = registerForActivityResult(
|
||||
new ActivityResultContracts.StartActivityForResult(),
|
||||
result -> {
|
||||
if (result.getResultCode() == Activity.RESULT_OK) {
|
||||
try {
|
||||
mediaProjection[0] = mediaProjectionManager
|
||||
.getMediaProjection(result.getResultCode(), result.getData());
|
||||
joinChannel();
|
||||
} catch (Exception e) {
|
||||
Log.e("RoomCabinFragment", "error msg: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
// private MediaProjection[] mediaProjection = new MediaProjection[1];
|
||||
// private MediaProjectionManager mediaProjectionManager;
|
||||
// private final ActivityResultLauncher<Intent> mediaProjectionLauncher = registerForActivityResult(
|
||||
// new ActivityResultContracts.StartActivityForResult(),
|
||||
// result -> {
|
||||
// if (result.getResultCode() == Activity.RESULT_OK) {
|
||||
// try {
|
||||
// mediaProjection[0] = mediaProjectionManager
|
||||
// .getMediaProjection(result.getResultCode(), result.getData());
|
||||
// joinChannel();
|
||||
// } catch (Exception e) {
|
||||
// Log.e("RoomCabinFragment", "error msg: " + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
|
||||
private void isConfig() {
|
||||
|
||||
@@ -818,7 +843,9 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
@Subscribe (threadMode = ThreadMode.MAIN)
|
||||
public void roomInfoEvent(CabinEvent messageEvent) {
|
||||
if (messageEvent.isJoined()){
|
||||
isMicPlace=true;
|
||||
if (CommonAppContext.getInstance().isMicPlace) {
|
||||
isMicPlace = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -831,10 +858,10 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
public void releaseResources(){
|
||||
releaseCountDownTimer();
|
||||
// ImageUtils.clearDiskCache(getActivity());
|
||||
if (mediaProjection[0] != null) {
|
||||
mediaProjection[0].stop();
|
||||
mediaProjection[0] = null;
|
||||
}
|
||||
// if (mediaProjection[0] != null) {
|
||||
// mediaProjection[0].stop();
|
||||
// mediaProjection[0] = null;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1234,7 +1234,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
if (AgoraManager.getInstance(getContext()).isLocalAudioEnabled()) {
|
||||
roomActivity.ivMic(com.xscm.moduleutil.R.mipmap.room_microphone);
|
||||
} else {
|
||||
roomActivity.ivMic(com.xscm.moduleutil.R.mipmap.room_microphone_off);
|
||||
// roomActivity.ivMic(com.xscm.moduleutil.R.mipmap.room_microphone_off);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_relation"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_1"
|
||||
@@ -198,6 +199,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:gravity="center"
|
||||
android:id="@+id/tv_gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
@@ -223,6 +225,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
|
||||
android:id="@+id/tv_timetg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
|
||||
@@ -91,7 +91,7 @@ public class WithdrawalActivity extends BaseMvpActivity<WithdrawalPresenter, Act
|
||||
ToastUtils.show("请选择提现方式");
|
||||
return;
|
||||
}
|
||||
if (mBinding.etCustomAmount.getText().toString().equals("0")|| mBinding.etCustomAmount.getText().toString().equals("") || mBinding.etCustomAmount.getText().toString().isEmpty()){
|
||||
if (mBinding.etCustomAmount.getText().toString().equals("0") || mBinding.etCustomAmount.getText().toString().equals("") || mBinding.etCustomAmount.getText().toString().isEmpty()) {
|
||||
ToastUtils.show("提现金额不能为0");
|
||||
return;
|
||||
}
|
||||
@@ -261,13 +261,11 @@ public class WithdrawalActivity extends BaseMvpActivity<WithdrawalPresenter, Act
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
if (s.length() == 4) {
|
||||
String code = etVerificationCode.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(code)) {
|
||||
// 验证码验证逻辑
|
||||
MvpPre.withdrawal(mBinding.etCustomAmount.getText().toString(), selectedItem.getType(), code);
|
||||
dialog.dismiss();
|
||||
}
|
||||
String code = etVerificationCode.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(code) && code.length() >= 6) {
|
||||
// 验证码验证逻辑
|
||||
MvpPre.withdrawal(mBinding.etCustomAmount.getText().toString(), selectedItem.getType(), code);
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||