diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt index a0494eb6c6..42c4e62409 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt @@ -16,6 +16,7 @@ import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr +import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.core.utilcode.util.Utils import kotlinx.android.synthetic.main.view_steering_brake.view.* @@ -73,15 +74,17 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo //can数据转发 转向灯状态 0是正常 1是左转 2是右转 if (lightSwitch != null) { CallerLogger.d("$M_HMI$TAG", "---lightSwitch.getNumber() = " + lightSwitch.number) - if (lightSwitch.number == 1 || lightSwitch.number == 2) { - isShowTurnLight = true - brakeView.visibility = View.VISIBLE - brakeView.setBrakeLight(0) - } else { - brakeView.visibility = View.GONE - isShowTurnLight = false + ThreadUtils.runOnUiThread { + if (lightSwitch.number == 1 || lightSwitch.number == 2) { + isShowTurnLight = true + brakeView.visibility = View.VISIBLE + brakeView.setBrakeLight(0) + } else { + brakeView.visibility = View.GONE + isShowTurnLight = false + } + turnLightView.visibility = View.VISIBLE } - turnLightView.visibility = View.VISIBLE } }