1:添加权限说明

2:聊天添加举报按钮
This commit is contained in:
2025-10-30 18:13:59 +08:00
parent a5ebc83dea
commit a993a7710f
21 changed files with 423 additions and 361 deletions

View File

@@ -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);
// }
// });
// }
// });
// }
}