From 280e94a1d87e5a17a1f40ef0683d950cc9d4d747 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Fri, 17 Feb 2023 14:50:32 +0800 Subject: [PATCH] [2.13.2-sop] 2.13.4 fix bug of thread problem --- .../core/function/hmi/ui/MoGoHmiFragment.kt | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 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 b30ccde589..b258ec9a96 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 @@ -1091,25 +1091,27 @@ class MoGoHmiFragment : MvpFragment(), * 控制展示限速标志及内容 */ override fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) { - // 控制 限速UI 展示 - if (HmiBuildConfig.isShowLimitingVelocityView) { - if (limitingSpeed > 0) { - mViewLimitingVelocity?.visibility = View.VISIBLE - mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed, limitSpeedSource) - tvLimitingSource?.visibility = View.VISIBLE - if (limitSpeedSource == 1) { - tvLimitingSource.text = "MAP" - } else if (limitSpeedSource == 2) { - tvLimitingSource.text = "RSU" + ThreadUtils.runOnUiThread { + // 控制 限速UI 展示 + if (HmiBuildConfig.isShowLimitingVelocityView) { + if (limitingSpeed > 0) { + mViewLimitingVelocity?.visibility = View.VISIBLE + mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed, limitSpeedSource) + tvLimitingSource?.visibility = View.VISIBLE + if (limitSpeedSource == 1) { + tvLimitingSource.text = "MAP" + } else if (limitSpeedSource == 2) { + tvLimitingSource.text = "RSU" + } + } else { + mViewLimitingVelocity?.visibility = View.INVISIBLE + mViewLimitingVelocity?.updateLimitingSpeed(0, limitSpeedSource) + tvLimitingSource?.visibility = View.INVISIBLE } } else { - mViewLimitingVelocity?.visibility = View.INVISIBLE - mViewLimitingVelocity?.updateLimitingSpeed(0, limitSpeedSource) - tvLimitingSource?.visibility = View.INVISIBLE + disableLimitingVelocity() + tvLimitingSource?.visibility = View.GONE } - } else { - disableLimitingVelocity() - tvLimitingSource?.visibility = View.GONE } }