From a860ea544523c1e71ba964de9b51a39bcffbcf1d Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Fri, 18 Aug 2023 11:02:01 +0800 Subject: [PATCH] =?UTF-8?q?[6.0.0]=20=E5=90=AF=E5=8A=A8=E8=87=AA=E9=A9=BE?= =?UTF-8?q?=E6=96=87=E5=AD=97=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/wigets/StartAutopilotAnimationView.kt | 14 ++++++++++---- .../layout/start_autopilot_animation_view.xml | 16 +++++++++------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/StartAutopilotAnimationView.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/StartAutopilotAnimationView.kt index 17e99eac1a..535e7486de 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/StartAutopilotAnimationView.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/StartAutopilotAnimationView.kt @@ -12,6 +12,7 @@ import android.view.animation.LinearInterpolator import android.widget.RelativeLayout 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.util.UiThreadHandler import com.mogo.och.common.module.R import com.mogo.och.common.module.utils.SoundPoolHelper import kotlinx.android.synthetic.main.start_autopilot_animation_view.view.startAutopilotTip @@ -28,7 +29,7 @@ class StartAutopilotAnimationView @JvmOverloads constructor( companion object { private const val ALL_CLOSE_TIMER = 5000L - private const val TAG = "V2XWarningView" + private const val TAG = "StartAutopilotAnimationView" } private var startTimer: CountDownTimer? = null @@ -77,7 +78,6 @@ class StartAutopilotAnimationView @JvmOverloads constructor( * @see WarningDirectionEnum */ private fun showWarning(direction: DirectionEnum, time: Long = ALL_CLOSE_TIMER) { - //开始倒计时 countDownTimer() @@ -146,18 +146,24 @@ class StartAutopilotAnimationView @JvmOverloads constructor( private fun countDownTimer() { + startAutopilotTip.visibility = VISIBLE + startTimer = object : CountDownTimer(ALL_CLOSE_TIMER, 1000L) {// 5倒计时后开启自驾 @SuppressLint("SetTextI18n") override fun onTick(millisUntilFinished: Long) { // 倒计时 - startAutopilotTip.text = "${(millisUntilFinished/1000).toInt()} 车辆即将自动开启自动驾驶" + UiThreadHandler.post { + startAutopilotTip.text = "${(millisUntilFinished/1000).toInt()} 车辆即将自动开启自动驾驶" + } playDI() } override fun onFinish() { //倒计时结束了... - startAutopilotTip.text = "车辆正在自动开启自动驾驶" + UiThreadHandler.post { + startAutopilotTip.text = "车辆正在自动开启自动驾驶" + } } } diff --git a/OCH/mogo-och-common-module/src/main/res/layout/start_autopilot_animation_view.xml b/OCH/mogo-och-common-module/src/main/res/layout/start_autopilot_animation_view.xml index bf45939451..db831f47da 100644 --- a/OCH/mogo-och-common-module/src/main/res/layout/start_autopilot_animation_view.xml +++ b/OCH/mogo-och-common-module/src/main/res/layout/start_autopilot_animation_view.xml @@ -3,6 +3,15 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> + + + - \ No newline at end of file