[6.8.0]冷启动修改
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.animation.Animator
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.TransitionDrawable
|
||||
import android.os.CountDownTimer
|
||||
@@ -272,30 +275,55 @@ class ColdStartProcessView @JvmOverloads constructor(
|
||||
ivColdStartProcess.visibility = View.GONE
|
||||
ivColdStartResult.visibility = View.VISIBLE
|
||||
ivColdStartResult.setImageDrawable((ResourceUtils.getDrawable(R.drawable.icon_cold_start_success_02)))
|
||||
var label = true
|
||||
coldStartSuccessTimer = object: CountDownTimer(COLD_START_SUCCESS_SHOW_TIME,COLD_START_SUCCESS_TICK_TIME){
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
label = if(label){
|
||||
transition?.startTransition(500)
|
||||
false
|
||||
}else{
|
||||
transition?.reverseTransition(500)
|
||||
true
|
||||
}
|
||||
}
|
||||
val successAlpha: ObjectAnimator = ObjectAnimator.ofFloat(ivColdStartResult,"alpha",1f,0.5f)
|
||||
successAlpha.duration = 500
|
||||
successAlpha.repeatMode = ValueAnimator.REVERSE
|
||||
successAlpha.repeatCount = 6
|
||||
successAlpha.start()
|
||||
successAlpha.addListener(object: Animator.AnimatorListener{
|
||||
override fun onAnimationStart(animation: Animator) {
|
||||
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
ThreadUtils.runOnUiThread {
|
||||
this@ColdStartProcessView.visibility = View.GONE
|
||||
coldStartProcessNormalAnim?.release()
|
||||
coldStartProcessAbnormalAnim?.release()
|
||||
}
|
||||
override fun onAnimationEnd(animation: Animator) {
|
||||
ivColdStartResult.visibility = View.GONE
|
||||
}
|
||||
|
||||
}
|
||||
coldStartSuccessTimer?.start()
|
||||
override fun onAnimationCancel(animation: Animator) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animator) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
// var label = true
|
||||
// coldStartSuccessTimer = object: CountDownTimer(COLD_START_SUCCESS_SHOW_TIME,COLD_START_SUCCESS_TICK_TIME){
|
||||
// override fun onTick(millisUntilFinished: Long) {
|
||||
// ThreadUtils.runOnUiThread {
|
||||
// label = if(label){
|
||||
// transition?.startTransition(500)
|
||||
// false
|
||||
// }else{
|
||||
// transition?.reverseTransition(500)
|
||||
// true
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// override fun onFinish() {
|
||||
// ThreadUtils.runOnUiThread {
|
||||
// this@ColdStartProcessView.visibility = View.GONE
|
||||
// coldStartProcessNormalAnim?.release()
|
||||
// coldStartProcessAbnormalAnim?.release()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// coldStartSuccessTimer?.start()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,6 +341,11 @@ class ColdStartProcessView @JvmOverloads constructor(
|
||||
ivColdStartProcess.visibility = View.GONE
|
||||
ivColdStartResult.visibility = View.VISIBLE
|
||||
ivColdStartResult.setImageDrawable((ResourceUtils.getDrawable(R.drawable.icon_cold_start_fail_02)))
|
||||
val failAlpha: ObjectAnimator = ObjectAnimator.ofFloat(ivColdStartResult,"alpha",1f,0.5f)
|
||||
failAlpha.duration = 500
|
||||
failAlpha.repeatMode = ValueAnimator.REVERSE
|
||||
failAlpha.repeatCount = ValueAnimator.INFINITE
|
||||
failAlpha.start()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,6 @@ class ColdStartView @JvmOverloads constructor(
|
||||
showIPCConnectFailView("域控主动断开连接,建议重启车辆并上报问题")
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -342,7 +341,11 @@ class ColdStartView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
coldStartNodeAdapter?.setData(nodeList)
|
||||
|
||||
if(nodeList.size > 12){
|
||||
ivNodeListMask.visibility = View.VISIBLE
|
||||
}else{
|
||||
ivNodeListMask.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -607,7 +610,6 @@ class ColdStartView @JvmOverloads constructor(
|
||||
tvSsmConnectContent.setTextColor(ContextCompat.getColor(context, R.color.white))
|
||||
//展示冷启动连接过程视图
|
||||
rvNodeList.visibility = View.VISIBLE
|
||||
ivNodeListMask.visibility = View.VISIBLE
|
||||
tvColdStartContent.text = "启动中…"
|
||||
ivColdStartStatus.setImageDrawable(ResourceUtils.getDrawable(R.drawable.icon_cold_start_process))
|
||||
//开启冷启动连接状态动画
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<gradient
|
||||
android:startColor="#00000000"
|
||||
android:endColor="#282B2E"
|
||||
android:endColor="#18191B"
|
||||
android:angle="270"
|
||||
/>
|
||||
<corners
|
||||
android:radius="@dimen/dp_8"/>
|
||||
android:radius="@dimen/dp_0"/>
|
||||
</shape>
|
||||
@@ -26,7 +26,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSystemStartupTitle"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvSystemStartupTitle"
|
||||
android:contentDescription="@string/wifi_connect_icon"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -153,14 +153,15 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivNodeListMask"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_width="@dimen/dp_500"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="@id/rvNodeList"
|
||||
app:layout_constraintLeft_toLeftOf="@id/rvNodeList"
|
||||
app:layout_constraintRight_toRightOf="@id/rvNodeList"
|
||||
android:src="@drawable/bg_cold_start_list_mask"
|
||||
android:contentDescription="@string/cold_start_list_mask"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:paddingStart="@dimen/dp_m_5"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
||||
Reference in New Issue
Block a user