[2.13.0]消息盒子

This commit is contained in:
xuxinchao
2022-12-05 08:56:58 +08:00
parent 8a01b1f71d
commit 1e6580c421
12 changed files with 64 additions and 36 deletions

View File

@@ -17,6 +17,7 @@ import com.google.android.flexbox.FlexboxLayout
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager
@@ -275,14 +276,20 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
mInViewY = motionEvent.y
// 获取相对屏幕的坐标,即以屏幕左上角为原点
mDownInScreenX = motionEvent.rawX
mDownInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
// mDownInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
// mInScreenX = motionEvent.rawX
// mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
mDownInScreenY = motionEvent.rawY
mInScreenX = motionEvent.rawX
mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
mInScreenY = motionEvent.rawY
}
MotionEvent.ACTION_MOVE -> {
// 更新浮动窗口位置参数
mInScreenX = motionEvent.rawX
mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
// mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
mInScreenY = motionEvent.rawY
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
// 手指移动的时候更新小悬浮窗的位置
@@ -298,7 +305,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager!!.defaultDisplay.getMetrics(metrics)
mWindowParams!!.x = metrics.widthPixels
mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()-350
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
mWindowManager!!.addView(mFloatLayout, mWindowParams)
}