Merge branch 'dev_robotaxi-d-app-module_251_220125_2.5.1' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_251_220125_2.5.1
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -946,20 +946,31 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -202,12 +202,19 @@
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:text="恢复视角"
|
||||
android:textSize="@dimen/dp_34"/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbOpenLight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:textOff="关闭「转向灯控制」"
|
||||
android:textOn="打开「转向灯控制」"
|
||||
android:textSize="@dimen/dp_34" />
|
||||
|
||||
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
|
||||
<!--日志输出控制-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -34,6 +34,11 @@ interface IMoGoWaringProvider {
|
||||
*/
|
||||
fun setToolsViewVisibility(visibility: Int)
|
||||
|
||||
/**
|
||||
* 控制转向灯和刹车功能
|
||||
*/
|
||||
fun setTurnLightFunction(isOpen: Boolean)
|
||||
|
||||
/**
|
||||
* 开关DebugView
|
||||
*/
|
||||
|
||||
@@ -52,6 +52,13 @@ object CallerHmiManager : CallerBase() {
|
||||
waringProviderApi.setToolsViewVisibility(visibility)
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制转向灯和刹车功能
|
||||
*/
|
||||
fun setTurnLightFunction(isOpen: Boolean) {
|
||||
waringProviderApi.setTurnLightFunction(isOpen)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关DebugView
|
||||
*/
|
||||
|
||||
@@ -88,10 +88,12 @@ public class ObjectUtils {
|
||||
.zIndex(opt.getzIndex());
|
||||
|
||||
try {
|
||||
Color.parseColor(opt.getAnchorColor());
|
||||
markerOptions.anchorColor(opt.getAnchorColor());
|
||||
if (!TextUtils.isEmpty(opt.getAnchorColor())) {
|
||||
Color.parseColor(opt.getAnchorColor());
|
||||
markerOptions.anchorColor(opt.getAnchorColor());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
}
|
||||
markerOptions.vrEnable(opt.is3DMode());
|
||||
if (!TextUtils.isEmpty(opt.getResName())) {
|
||||
|
||||
@@ -68,7 +68,7 @@ public class OnAdasListenerAdapter implements OnAdasListener {
|
||||
// Log.w("DHY-location", bean.getLon() + "," + bean.getLat() + " OnAdasListenerAdapter-onCarStateData:");
|
||||
|
||||
if (bean != null) {
|
||||
int turnLight = bean.getTurn_light(); //转向灯状态 0是正常 1是左转 2是右转
|
||||
int turnLight = bean.getTurnLightOften(); //转向灯状态 0是正常 1是左转 2是右转
|
||||
AmiClientManager.getInstance().setTurnLightState(turnLight);
|
||||
int brakeLight = bean.getBrake_light(); //TODO
|
||||
// Logger.d(TAG, "onCarStateData ---- turnLight = " + turnLight + "---brakeLight = " + brakeLight);
|
||||
|
||||
Reference in New Issue
Block a user