add bus brake white ui

This commit is contained in:
lixiaopeng
2022-04-08 17:27:43 +08:00
parent 66ebc639c4
commit 1105391eca
7 changed files with 66 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingcarProvider;
import com.mogo.eagle.core.function.bindingcar.network.BindingcarNetWorkManager;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import org.jetbrains.annotations.NotNull;
@@ -66,11 +67,13 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
private int getScreenType() {
int screenType = -1;
if (FunctionBuildConfig.appIdentityMode == 0 || FunctionBuildConfig.appIdentityMode == 0xA0) {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
screenType = 1; //司机屏
} else if (FunctionBuildConfig.appIdentityMode == 1 || FunctionBuildConfig.appIdentityMode == 0xA1) {
screenType = 2; //乘客屏
}
// if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
// screenType = 2; //乘客屏
// }
return screenType;
}

View File

@@ -10,7 +10,9 @@ import android.view.animation.AlphaAnimation
import android.view.animation.Animation
import android.view.animation.DecelerateInterpolator
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import kotlinx.android.synthetic.main.view_brake_light_status.view.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
@@ -28,7 +30,12 @@ class BrakeViewStatus @JvmOverloads constructor(
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
init {
LayoutInflater.from(context).inflate(R.layout.view_brake_light_status, this, true)
//bus乘客端
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
LayoutInflater.from(context).inflate(R.layout.view_brake_light_status_daytime, this, true)
} else {
LayoutInflater.from(context).inflate(R.layout.view_brake_light_status, this, true)
}
}
private var isBrake: Boolean = false

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 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/brakelight_bg_color_daytime" />
<corners android:radius="@dimen/turnlight_bg_corner" />
</shape>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<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="@dimen/brakelight_width_daytime"
android:layout_height="@dimen/brakelight_height_daytime"
android:visibility="visible">
<LinearLayout
android:id="@+id/layout_brake"
android:layout_width="@dimen/brakelight_width_daytime"
android:layout_height="@dimen/brakelight_height_daytime"
android:background="@drawable/brakelight_background_daytime"
android:layout_gravity="top|center_horizontal"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:visibility="gone">
<ImageView
android:id="@+id/image_brake"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/bus_shache_nor_daytime"
android:layout_marginLeft="15px"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/tv_brake"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="刹车中"
android:textColor="#2D3E5F"
android:textSize="34px"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@+id/image_brake" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -46,6 +46,7 @@
<color name="dialog_bg_color">#3B4577</color>
<color name="turnlight_bg_color">#000000</color>
<color name="brakelight_bg_color_daytime">#E6FFFFFF</color>
<color name="hmi_traffic_light_red_color_up">#FFFFA28B</color>
<color name="hmi_traffic_light_red_color_down">#FFDA1100</color>

View File

@@ -41,6 +41,8 @@
<dimen name="turnlight_height">120px</dimen>
<dimen name="brakelight_width">460px</dimen>
<dimen name="brakelight_height">120px</dimen>
<dimen name="brakelight_width_daytime">220px</dimen>
<dimen name="brakelight_height_daytime">120px</dimen>
<dimen name="hmi_traffic_light_layout_width">225px</dimen>
<dimen name="hmi_traffic_light_layout_height">154px</dimen>