[VisualAngle]地图视角切换部分代码提交
This commit is contained in:
@@ -9,6 +9,9 @@ import android.view.animation.Animation
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.ImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Turning
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_turn_light_status.view.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -35,6 +38,9 @@ class TurnLightViewStatus @JvmOverloads constructor(
|
||||
private var isRightLight :Boolean = false
|
||||
private var isDisappare :Boolean = false
|
||||
|
||||
@Volatile
|
||||
private var isVisualAngleChanged = false
|
||||
|
||||
/**
|
||||
* 转向灯动画
|
||||
*/
|
||||
@@ -46,6 +52,13 @@ class TurnLightViewStatus @JvmOverloads constructor(
|
||||
isShowNormalBg = true
|
||||
}
|
||||
|
||||
if (directionLight == 1 || directionLight == 2) {
|
||||
if (!isVisualAngleChanged) {
|
||||
isVisualAngleChanged = true
|
||||
CallerVisualAngleManager.changeVisualAngle(Turning)
|
||||
}
|
||||
}
|
||||
|
||||
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
|
||||
if (directionLight == 1) { //左转向
|
||||
if (!isLeftLight) {
|
||||
@@ -73,6 +86,8 @@ class TurnLightViewStatus @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
} else { //消失
|
||||
CallerVisualAngleManager.changeVisualAngle(Default())
|
||||
isVisualAngleChanged = false
|
||||
if (!isDisappare) {
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
animationDisappear()
|
||||
|
||||
Reference in New Issue
Block a user