1:添加权限说明
2:聊天添加举报按钮
This commit is contained in:
@@ -169,7 +169,7 @@ dependencies {
|
||||
|
||||
//播放器
|
||||
//腾讯直播sdk
|
||||
api('com.tencent.liteav:LiteAVSDK_Professional:10.9.0.13102')
|
||||
// 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")
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -220,85 +220,4 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
|
||||
return resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示全局飘屏消息(支持任意位置飘过)
|
||||
*
|
||||
*/
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void showPiaoPingMessage(MqttBean mqttBean) {
|
||||
// WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
|
||||
// if (windowManager == null) return;
|
||||
//
|
||||
// int screenWidth = getResources().getDisplayMetrics().widthPixels;
|
||||
// int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
||||
//
|
||||
// WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(
|
||||
// WindowManager.LayoutParams.MATCH_PARENT,
|
||||
// WindowManager.LayoutParams.WRAP_CONTENT,
|
||||
// Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ?
|
||||
// WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY :
|
||||
// WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
|
||||
// WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
|
||||
// WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
|
||||
// WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
|
||||
// PixelFormat.TRANSLUCENT);
|
||||
//
|
||||
// // 设置 Gravity 为左上角
|
||||
// layoutParams.gravity = Gravity.TOP | Gravity.START;
|
||||
//
|
||||
// // Y 轴随机位置
|
||||
//// layoutParams.y = (int) ((Math.random() * (screenHeight - 200)));
|
||||
//
|
||||
// // 初始 X 设为负值,确保 View 在屏幕左侧外
|
||||
// layoutParams.x = -screenWidth;
|
||||
//
|
||||
// View piaoPingView = LayoutInflater.from(this).inflate(R.layout.item_piaoping, null);
|
||||
// TextView textView = piaoPingView.findViewById(R.id.tv_name);
|
||||
// TextView textView2 = piaoPingView.findViewById(R.id.tv_to_name);
|
||||
// textView2.setText("送给"+mqttBean.getList().getToUserName());
|
||||
// textView.setText(mqttBean.getList().getFromUserName());
|
||||
// ImageUtils.loadHeadCC(mqttBean.getList().getGift_picture(), piaoPingView.findViewById(R.id.iv_piaoping));
|
||||
// TextView tv_time = piaoPingView.findViewById(R.id.tv_num);
|
||||
// tv_time.setText(mqttBean.getList().getNumber());
|
||||
// windowManager.addView(piaoPingView, layoutParams);
|
||||
//
|
||||
// piaoPingView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
// @Override
|
||||
// public void onGlobalLayout() {
|
||||
// piaoPingView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
//
|
||||
// // 设置锚点为左上角,避免偏移干扰
|
||||
// piaoPingView.setPivotX(0);
|
||||
// piaoPingView.setPivotY(0);
|
||||
//
|
||||
// // 启动动画:从左外滑入 -> 右外滑出
|
||||
// ObjectAnimator animator = ObjectAnimator.ofFloat(
|
||||
// piaoPingView,
|
||||
// "translationX",
|
||||
// 0f, // 初始偏移为 0(此时 View 在左侧外)
|
||||
// screenWidth // 向右移动整个屏幕宽度
|
||||
// );
|
||||
// animator.setDuration(2000); // 整个动画的时长为2秒
|
||||
//
|
||||
// // 强制 GPU 渲染
|
||||
// piaoPingView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||
//
|
||||
// // 延迟显示2秒后开始滑出屏幕的动画
|
||||
// piaoPingView.postDelayed(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// animator.start();
|
||||
// }
|
||||
// }, 3000);
|
||||
//
|
||||
// animator.addListener(new AnimatorListenerAdapter() {
|
||||
// @Override
|
||||
// public void onAnimationEnd(Animator animation) {
|
||||
// windowManager.removeView(piaoPingView);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -72,18 +72,67 @@ public class MessageListenerSingleton {
|
||||
|
||||
private List<PublicScreenMessageListener> publicScreenListeners = new ArrayList<>();
|
||||
|
||||
// 添加监听器
|
||||
|
||||
// 替换原有的 addPublicScreenMessageListener 方法
|
||||
public void addPublicScreenMessageListener(PublicScreenMessageListener listener) {
|
||||
if (!publicScreenListeners.contains(listener)) {
|
||||
publicScreenListeners.add(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) {
|
||||
publicScreenListeners.remove(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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 添加监听器
|
||||
// public void addPublicScreenMessageListener(PublicScreenMessageListener listener) {
|
||||
// if (!publicScreenListeners.contains(listener)) {
|
||||
// publicScreenListeners.add(listener);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 移除监听器
|
||||
// public void removePublicScreenMessageListener(PublicScreenMessageListener listener) {
|
||||
// publicScreenListeners.remove(listener);
|
||||
// }
|
||||
|
||||
private MessageListenerSingleton() {
|
||||
if (!isInitialized) {
|
||||
isInitialized = true;
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user