opt turn ligth ui and logic

This commit is contained in:
lixiaopeng
2022-03-14 15:28:41 +08:00
parent 129732e68e
commit 80368a1300
13 changed files with 46 additions and 21 deletions

View File

@@ -57,12 +57,18 @@ public class MoGoHandAdasMsgManager implements
//turnLightOften 是sdk适配的字段后期建议CarStateInfo和AutopilotCarStateInfo统一成一个
int turnLight = bean.getTurnLightOften();
AmiClientManager.getInstance().setTurnLightState(turnLight);
int brakeLight = bean.getBrake_light();
int brakeLight = bean.getBrake_light(); //1刹车灯亮 其他为松开
// Logger.d(TAG, "onCarStateData ---- turnLight = " + turnLight + "---brakeLight = " + brakeLight);
//设置转向灯
CallerHmiManager.INSTANCE.showTurnLight(turnLight);
if (turnLight == 1 || turnLight == 2) {
CallerHmiManager.INSTANCE.showBrakeLight(0);
CallerHmiManager.INSTANCE.showTurnLight(turnLight);
}
//设置刹车信息
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
if (turnLight == 0){
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
}
} else {
Logger.e(TAG, "bean == null ");
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/turnlight_bg_color" />
<corners android:radius="@dimen/turnlight_bg_corner" />
</shape>

View File

@@ -169,10 +169,13 @@
android:id="@+id/brakeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginBottom="80px" />
android:layout_marginTop="42px" />
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -2,29 +2,34 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/brakelight_width"
android:layout_height="@dimen/brakelight_height"
android:visibility="visible">
<LinearLayout
android:id="@+id/layout_brake"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/module_blank_nor"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_gravity="top|center_horizontal"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:gravity="center_horizontal"
android:visibility="gone">
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- android:gravity="center_horizontal"-->
<ImageView
android:id="@+id/image_brake"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="110px"
android:layout_gravity="center_vertical"
android:src="@drawable/module_light_nor"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
@@ -37,8 +42,7 @@
android:textColor="#ffffff"
android:textSize="45px"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/image_brake"
app:layout_constraintTop_toTopOf="@+id/image_brake" />
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@+id/image_brake" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -2,17 +2,17 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/turnlight_width"
android:layout_height="@dimen/turnlight_height"
android:visibility="visible">
<FrameLayout
android:id="@+id/turn_light_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:background="@drawable/turnlight_background"
android:layout_gravity="top|center_horizontal"
android:background="@drawable/module_turn_light_bg"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">

View File

@@ -43,4 +43,5 @@
<color name="version_upgrading_color">#3B4577</color>
<color name="dialog_bg_color">#3B4577</color>
<color name="turnlight_bg_color">#000000</color>
</resources>

View File

@@ -35,5 +35,11 @@
<dimen name="dp_580">580px</dimen>
<dimen name="dp_588">588px</dimen>
<dimen name="dp_1066">1066px</dimen>
<dimen name="turnlight_bg_corner">60px</dimen>
<dimen name="turnlight_width">270px</dimen>
<dimen name="turnlight_height">120px</dimen>
<dimen name="brakelight_width">460px</dimen>
<dimen name="brakelight_height">120px</dimen>
</resources>