opt ui and save car info

This commit is contained in:
lixiaopeng
2022-04-12 18:29:53 +08:00
parent 7735408c80
commit dcd73b0bb7
3 changed files with 19 additions and 10 deletions

View File

@@ -1,13 +1,13 @@
package com.mogo.eagle.core.function.hmi.ui.turnlight
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.animation.AlphaAnimation
import android.view.animation.Animation
import android.view.animation.LinearInterpolator
import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.config.FunctionBuildConfig
@@ -175,12 +175,19 @@ class TurnLightViewStatus @JvmOverloads constructor(
//实现图片闪烁效果
private fun setAnimation(imageView: ImageView) {
val animation = AlphaAnimation(1.0f, 0f)
animation.duration = 500
animation.interpolator = LinearInterpolator()
animation.repeatCount = Animation.INFINITE
animation.repeatMode = Animation.REVERSE
imageView.startAnimation(animation)
val animationSet = AnimatorSet()
val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha",0f, 1.0f)
val valueAnimatorDisappare = ObjectAnimator.ofFloat(imageView, "alpha",1.0f, 0f)
valueAnimator.duration = 1000
valueAnimatorDisappare.duration = 800
valueAnimator.repeatCount = -1
valueAnimatorDisappare.repeatCount = -1
animationSet.playTogether(valueAnimatorDisappare, valueAnimator)
animationSet.start()
}
private fun stopAnimate() {