From 5c4578d8af69b88b0c251090f4205566e9753ab7 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Fri, 21 Jan 2022 16:33:16 +0800 Subject: [PATCH] =?UTF-8?q?[Upload]=20=E5=B0=81=E8=A3=85DebugView=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E6=8E=A7=E5=88=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../core/function/hmi/ui/MoGoHmiFragment.kt | 87 ++++++++++--------- .../api/hmi/warning/IMoGoWaringProvider.kt | 5 ++ .../function/call/hmi/CallerHmiManager.kt | 7 ++ 3 files changed, 59 insertions(+), 40 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index c9b7010781..845c3b4373 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -207,46 +207,7 @@ class MoGoHmiFragment : MvpFragment } viewShowDebugView.setOnLongClickListener { - Log.d(TAG, "长按显示状态工具栏") - context?.let { - if (mDebugSettingViewFloat != null) { - WarningFloat.dismiss(mDebugSettingViewFloat!!.config.floatTag, false) - mDebugSettingViewFloat = null - mDebugSettingView = null - } else { - if (mDebugSettingView == null) { - mDebugSettingView = DebugSettingView(it) - } - mDebugSettingViewFloat = WarningFloat.with(it) - .setTag("DebugSettingView") - .setLayout(mDebugSettingView!!) - .setSidePattern(SidePattern.RIGHT) - .setGravity(Gravity.RIGHT, offsetY = 70) - .setImmersionStatusBar(true) - .setAnimator(object : DefaultAnimator() { - override fun enterAnim( - view: View, - params: WindowManager.LayoutParams, - windowManager: WindowManager, - sidePattern: SidePattern - ): Animator? = - super.enterAnim(view, params, windowManager, sidePattern) - ?.apply { - interpolator = OvershootInterpolator() - } - - override fun exitAnim( - view: View, - params: WindowManager.LayoutParams, - windowManager: WindowManager, - sidePattern: SidePattern - ): Animator? = - super.exitAnim(view, params, windowManager, sidePattern) - ?.setDuration(200) - }) - .show() - } - } + toggleDebugView() true } } @@ -518,6 +479,52 @@ class MoGoHmiFragment : MvpFragment ivToolsIcon?.visibility = visibility } + /** + * 开关DebugView + */ + override fun toggleDebugView() { + Log.d(TAG, "长按显示状态工具栏") + context?.let { + if (mDebugSettingViewFloat != null) { + WarningFloat.dismiss(mDebugSettingViewFloat!!.config.floatTag, false) + mDebugSettingViewFloat = null + mDebugSettingView = null + } else { + if (mDebugSettingView == null) { + mDebugSettingView = DebugSettingView(it) + } + mDebugSettingViewFloat = WarningFloat.with(it) + .setTag("DebugSettingView") + .setLayout(mDebugSettingView!!) + .setSidePattern(SidePattern.RIGHT) + .setGravity(Gravity.RIGHT, offsetY = 70) + .setImmersionStatusBar(true) + .setAnimator(object : DefaultAnimator() { + override fun enterAnim( + view: View, + params: WindowManager.LayoutParams, + windowManager: WindowManager, + sidePattern: SidePattern + ): Animator? = + super.enterAnim(view, params, windowManager, sidePattern) + ?.apply { + interpolator = OvershootInterpolator() + } + + override fun exitAnim( + view: View, + params: WindowManager.LayoutParams, + windowManager: WindowManager, + sidePattern: SidePattern + ): Animator? = + super.exitAnim(view, params, windowManager, sidePattern) + ?.setDuration(200) + }) + .show() + } + } + } + /** * 展示VR下V2X预警 * diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt index 92880a719c..0e6ac567aa 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt @@ -34,6 +34,11 @@ interface IMoGoWaringProvider { */ fun setToolsViewVisibility(visibility: Int) + /** + * 开关DebugView + */ + fun toggleDebugView() + /** * 展示VR下V2X预警 * diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt index 367b09c856..4f2b06d678 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt @@ -52,6 +52,13 @@ object CallerHmiManager : CallerBase() { waringProviderApi.setToolsViewVisibility(visibility) } + /** + * 开关DebugView + */ + fun toggleDebugView(){ + waringProviderApi.toggleDebugView() + } + /** * 展示VR下V2X预警 *