From 66dfc6b21615e3f05e0e7a729ad0818e5a0e0750 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Sat, 2 Apr 2022 13:05:01 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=8CChange=E3=80=8D=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=8C=E5=B7=A5=E5=85=B7=E9=9D=A2=E6=9D=BF=E3=80=8D=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8F=8A=E6=97=B6=E7=A7=BB=E9=99=A4=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../core/function/hmi/ui/tools/AutoPilotAndCheckView.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt index 5faa68193b..472ab73e41 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt @@ -54,7 +54,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor( @SuppressLint("ClickableViewAccessibility") private fun initView() { background = ColorDrawable(Color.parseColor("#F0151D41")) - CallerAutopilotCarConfigListenerManager.addListener(TAG, this) if (keyBoardUtil == null) { keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed) } @@ -182,11 +181,13 @@ class AutoPilotAndCheckView @JvmOverloads constructor( override fun onAttachedToWindow() { super.onAttachedToWindow() CallerAutoPilotStatusListenerManager.addListener(TAG, this) + CallerAutopilotCarConfigListenerManager.addListener(TAG, this) } override fun onDetachedFromWindow() { super.onDetachedFromWindow() CallerAutoPilotStatusListenerManager.removeListener(TAG) + CallerAutopilotCarConfigListenerManager.removeListener(TAG) } override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) { @@ -202,8 +203,10 @@ class AutoPilotAndCheckView @JvmOverloads constructor( override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) { UiThreadHandler.post { - tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²" - etInputSpeed.setText((carConfigResp.speedLimit * 3.6).toInt().toString()) + tvAcceleration?.let { + tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²" + etInputSpeed.setText((carConfigResp.speedLimit * 3.6).toInt().toString()) + } } } } \ No newline at end of file