[6.0.0] 启动自驾文字增加
This commit is contained in:
@@ -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 = "车辆正在自动开启自动驾驶"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,15 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/startAutopilotTipImg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_328"
|
||||
android:background="@drawable/start_autopilot_animation_bkg_top"
|
||||
android:visibility="gone"
|
||||
tools:visibility="invisible" />
|
||||
|
||||
<!--上方闪烁且有文字-->
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/startAutopilotTip"
|
||||
@@ -12,11 +21,4 @@
|
||||
android:visibility="gone"
|
||||
android:textSize="@dimen/dp_34"
|
||||
android:textColor="@android:color/white"/>
|
||||
<ImageView
|
||||
android:id="@+id/startAutopilotTipImg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_328"
|
||||
android:background="@drawable/start_autopilot_animation_bkg_top"
|
||||
android:visibility="gone"
|
||||
tools:visibility="invisible" />
|
||||
</FrameLayout>
|
||||
Reference in New Issue
Block a user