diff --git a/config.gradle b/config.gradle index 565bb8387b..400e2fbd8b 100644 --- a/config.gradle +++ b/config.gradle @@ -114,7 +114,7 @@ ext { obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3", mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.19', mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.10', - adasHigh : 'com.zhidao.support.adas:high:1.2.1.2_bate11', + adasHigh : 'com.zhidao.support.adas:high:1.2.1.2_bate13', // google googlezxing : "com.google.zxing:core:3.3.3", diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index d457bf2f06..95bdf7ac2e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -946,20 +946,31 @@ class MoGoHmiFragment : MvpFragment } } + private var isOpenTurnlight :Boolean = true + /** * 显示转向灯效果 */ override fun showTurnLight(light: Int) { -// turnLightView.setTurnLight(light) - + if (isOpenTurnlight) { + turnLightView.setTurnLight(light) + } +// Log.d("liyz", "showTurnLight light = $light"); } /** * 显示刹车效果 */ override fun showBrakeLight(light: Int) { -// brakeView.setBrakeLight(light) + if (isOpenTurnlight) { + brakeView.setBrakeLight(light) + } +// Log.d("liyz", "showBrakeLight light = $light"); + } + + override fun setTurnLightFunction(isOpen: Boolean) { + isOpenTurnlight = isOpen } /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 3fb7d2c3e2..344dc84376 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.setting import android.content.Context import android.util.AttributeSet +import android.util.Log import android.view.LayoutInflater import android.view.View import androidx.constraintlayout.widget.ConstraintLayout @@ -139,6 +140,14 @@ class DebugSettingView @JvmOverloads constructor( } } + tbOpenLight.setOnCheckedChangeListener { buttonView, isChecked -> + if (!isChecked) { + CallerHmiManager.setTurnLightFunction(true) + } else { + CallerHmiManager.setTurnLightFunction(false) + } + } + changesight_top_btn.setOnClickListener { CallerHDMapManager.setMapDAngle(0); } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt index eb15c8d42a..91d6923ff3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt @@ -33,52 +33,54 @@ class BrakeViewStatus @JvmOverloads constructor( LayoutInflater.from(context).inflate(R.layout.view_brake_light_status, this, true) } - private var isBrake :Boolean = false + private var isBrake: Boolean = false /** * 刹车动画 */ fun setBrakeLight(brakeLight: Int) { - if (brakeLight == 1) { //TODO 暂时还不知道数据,如果一直猜会怎样? + if (brakeLight == 1) { //刹车灯亮 if (!isBrake) { - var appearAnimation = AlphaAnimation(0f, 1f) - appearAnimation.duration = 300 - layout_brake.startAnimation(appearAnimation) - image_brake.startAnimation(appearAnimation) - tv_brake.startAnimation(appearAnimation) - layout_brake.visibility = View.VISIBLE - image_brake.visibility = View.VISIBLE - tv_brake.visibility = View.VISIBLE - isBrake = true + GlobalScope.launch(Dispatchers.Main) { + var appearAnimation = AlphaAnimation(0f, 1f) + appearAnimation.duration = 300 + layout_brake.startAnimation(appearAnimation) + image_brake.startAnimation(appearAnimation) + tv_brake.startAnimation(appearAnimation) + layout_brake.visibility = View.VISIBLE + image_brake.visibility = View.VISIBLE + tv_brake.visibility = View.VISIBLE + isBrake = true + } } } else { //不踩刹车,就消失 if (isBrake) { isBrake = false GlobalScope.launch(Dispatchers.Main) { scaleImageAndTv() + + var disappearAnimation = AlphaAnimation(1f, 0f) + disappearAnimation.duration = 1200 + layout_brake.startAnimation(disappearAnimation) + image_brake.startAnimation(disappearAnimation) + tv_brake.startAnimation(disappearAnimation) + + disappearAnimation.setAnimationListener(object : Animation.AnimationListener { + override fun onAnimationRepeat(p0: Animation?) { + } + + override fun onAnimationStart(p0: Animation?) { + } + + override fun onAnimationEnd(p0: Animation?) { + layout_brake.visibility = View.GONE + image_brake.visibility = View.GONE + tv_brake.visibility = View.GONE + + stopAnimate() + } + }) } - - var disappearAnimation = AlphaAnimation(1f, 0f) - disappearAnimation.duration = 1200 - layout_brake.startAnimation(disappearAnimation) - image_brake.startAnimation(disappearAnimation) - tv_brake.startAnimation(disappearAnimation) - - disappearAnimation.setAnimationListener(object: Animation.AnimationListener{ - override fun onAnimationRepeat(p0: Animation?) { - } - - override fun onAnimationStart(p0: Animation?) { - } - - override fun onAnimationEnd(p0: Animation?) { - layout_brake.visibility = View.GONE - image_brake.visibility = View.GONE - tv_brake.visibility = View.GONE - - stopAnimate() - } - }) } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt index 476fccc2af..e99cd1c97b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt @@ -14,6 +14,9 @@ import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.function.hmi.R import kotlinx.android.synthetic.main.view_brake_light_status.view.* import kotlinx.android.synthetic.main.view_turn_light_status.view.* +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch /** * @description @@ -40,27 +43,33 @@ class TurnLightViewStatus @JvmOverloads constructor( */ fun setTurnLight(directionLight: Int) { if (!isShowNormalBg && (directionLight == 1 || directionLight == 2)) { - showNormalAnimation() + GlobalScope.launch(Dispatchers.Main) { + showNormalAnimation() + } isShowNormalBg = true } //根据左右进行显示和隐藏,实际要判断每个来的时间和频度 if (directionLight == 1) { //左转向 if (!isLeftLight) { - left_select_image.visibility = View.VISIBLE - right_select_image.visibility = View.GONE - right_select_image.clearAnimation() - setAnimation(left_select_image) + GlobalScope.launch(Dispatchers.Main) { + left_select_image.visibility = View.VISIBLE + right_select_image.visibility = View.GONE + right_select_image.clearAnimation() + setAnimation(left_select_image) + } isLeftLight = true isRightLight = false isDisappare = false } } else if (directionLight == 2) { //右转向 if (!isRightLight) { - left_select_image.visibility = View.GONE - right_select_image.visibility = View.VISIBLE - left_select_image.clearAnimation() - setAnimation(right_select_image) + GlobalScope.launch(Dispatchers.Main) { + left_select_image.visibility = View.GONE + right_select_image.visibility = View.VISIBLE + left_select_image.clearAnimation() + setAnimation(right_select_image) + } isRightLight = true isLeftLight = false isDisappare = false @@ -68,7 +77,9 @@ class TurnLightViewStatus @JvmOverloads constructor( } else { //消失 if (!isDisappare) { - animationDisappear() + GlobalScope.launch(Dispatchers.Main) { + animationDisappear() + } isDisappare = true isShowNormalBg = false isLeftLight = false diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index f76e503be7..225e310a3d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -202,12 +202,19 @@ android:layout_margin="2dp" android:gravity="center" android:text="恢复视角" + android:textSize="@dimen/dp_34"/> + + - - -