diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index cf3c508c39..757da05d56 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -450,12 +450,12 @@ internal class SOPSettingView @JvmOverloads constructor( } //限速标识 - //TODO scSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView scSpeedLimit.setOnCheckedChangeListener { _, isChecked -> hmiAction("SOP 限速标识开关, ",isChecked) if (isChecked) { HmiBuildConfig.isShowLimitingVelocityView = true + CallerHmiViewControlListenerManager.invokeVisible(IViewControlListener.LimitingVelocityView_TAG,View.VISIBLE) } else { HmiBuildConfig.isShowLimitingVelocityView = false CallerHmiViewControlListenerManager.invokeVisible(IViewControlListener.LimitingVelocityView_TAG,View.GONE) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt index a631acac8e..0e967405cb 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt @@ -27,6 +27,9 @@ class LimitingVelocityView constructor( private const val TAG = "LimitingVelocityView" } + //限速控件是否展示 + private var isShow = false + init { LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true) } @@ -38,20 +41,22 @@ class LimitingVelocityView constructor( } override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) { - ThreadUtils.runOnUiThread { - if (limitingVelocity > 0) { - visibility = View.VISIBLE - tvLimitingVelocity.text = "$limitingVelocity" - tvLimitingSource?.text = DataSourceType.getName(sourceType) - } else { - visibility = View.GONE - tvLimitingSource?.text = "" + if(isShow){ + ThreadUtils.runOnUiThread { + if (limitingVelocity > 0) { + visibility = View.VISIBLE + tvLimitingVelocity.text = "$limitingVelocity" + tvLimitingSource?.text = DataSourceType.getName(sourceType) + } else { + visibility = View.GONE + tvLimitingSource?.text = "" + } } } } override fun visible(v: Int) { - super.visible(v) + isShow = v == View.VISIBLE this.visibility = v }