From 8891619c7b51cb153918416d7ea2938b82f1f586 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 3 Jan 2024 12:32:12 +0800 Subject: [PATCH] =?UTF-8?q?[6.2.6]=E4=BF=AE=E5=A4=8DAI=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=87=87=E9=9B=86=E6=8B=96=E5=8A=A8Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../badcase/biz/AIDataCollectWindow.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt index a9db71ea63..016fdb554a 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt @@ -43,6 +43,7 @@ import record_cache.RecordPanelOuterClass import java.lang.StringBuilder import java.util.* import kotlin.collections.ArrayList +import kotlin.math.absoluteValue /** * @author XuXinChao @@ -82,8 +83,6 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener private lateinit var mFloatLayout: View private var mInViewX = 0f private var mInViewY = 0f - private var mDownInScreenX = 0f - private var mDownInScreenY = 0f private var mInScreenX = 0f private var mInScreenY = 0f @@ -262,15 +261,18 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener mInViewX = motionEvent.x mInViewY = motionEvent.y // 获取相对屏幕的坐标,即以屏幕左上角为原点 - mDownInScreenX = motionEvent.rawX - mDownInScreenY = motionEvent.rawY mInScreenX = motionEvent.rawX mInScreenY = motionEvent.rawY + mWindowParams!!.x = (mInScreenX - mInViewX).toInt() + mWindowParams!!.y = (mInScreenY - mInViewY).toInt() } MotionEvent.ACTION_MOVE -> { // 更新浮动窗口位置参数 mInScreenX = motionEvent.rawX mInScreenY = motionEvent.rawY + if(((mInScreenX - mInViewX)-mWindowParams!!.x).absoluteValue>150 || ((mInScreenY - mInViewY)-mWindowParams!!.y).absoluteValue>150){ + return true + } mWindowParams!!.x = (mInScreenX - mInViewX).toInt() mWindowParams!!.y = (mInScreenY - mInViewY).toInt() // 手指移动的时候更新小悬浮窗的位置