优化HMI静态元素展示效果

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-11-02 17:47:54 +08:00
parent 7807cff6df
commit 471e4e9b79
11 changed files with 22 additions and 83 deletions

View File

@@ -40,6 +40,7 @@ class AutoPilotStatusView @JvmOverloads constructor(
}
private fun initView(context: Context) {
setBackgroundResource(R.drawable.module_hmi_autopilot_status_bg)
LayoutInflater.from(context).inflate(R.layout.view_autopilot_status, this, true)
val lp = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)
@@ -100,17 +101,17 @@ class AutoPilotStatusView @JvmOverloads constructor(
mAutopilotStatus = autopilotStatus
when (autopilotStatus) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶adas与工控机没有链接或工控机异常
clAutopilotStatus.setBackgroundResource(R.drawable.module_hmi_autopilot_status_disabled_bg)
setBackgroundResource(R.drawable.module_hmi_autopilot_status_disabled_bg)
tvStatusDes.setTextColor(resources.getColor(R.color.module_mogo_autopilot_status_disable))
ivStatusIcon.setImageResource(R.drawable.icon_autopilot_status_disabled)
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {// 可自动驾驶,目前处于人工干预状态
clAutopilotStatus.setBackgroundResource(R.drawable.module_hmi_autopilot_status_enable_bg)
setBackgroundResource(R.drawable.module_hmi_autopilot_status_enable_bg)
tvStatusDes.setTextColor(resources.getColor(R.color.module_mogo_autopilot_status_enable))
ivStatusIcon.setImageResource(R.drawable.icon_autopilot_status)
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {// 自动驾驶中
clAutopilotStatus.setBackgroundResource(R.drawable.module_hmi_autopilot_status_checked_bg)
setBackgroundResource(R.drawable.module_hmi_autopilot_status_checked_bg)
tvStatusDes.setTextColor(resources.getColor(R.color.module_mogo_autopilot_status_enable))
ivStatusIcon.setImageResource(R.drawable.icon_autopilot_status)
}

View File

@@ -25,6 +25,8 @@ class CheckStatusView @JvmOverloads constructor(
init {
LayoutInflater.from(context).inflate(R.layout.view_check_status, this, true)
setBackgroundResource(R.drawable.module_ext_check)
setOnClickListener {
// 启动检测页面
CallerCheckManager.startCheckActivity(getContext())

View File

@@ -31,7 +31,8 @@
android:layout_marginTop="@dimen/module_mogo_autopilot_status_margin_top"
android:elevation="@dimen/dp_10"
app:layout_constraintLeft_toLeftOf="@+id/viewSpeedChart"
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart" />
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart"
app:layout_goneMarginStart="@dimen/module_mogo_autopilot_status_margin_left" />
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
android:id="@+id/viewTrafficLightVr"
@@ -39,6 +40,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="40px"
android:layout_marginRight="40px"
android:elevation="@dimen/dp_10"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
@@ -50,6 +52,7 @@
android:layout_height="130px"
android:layout_marginTop="30px"
android:background="@drawable/bg_waring_limiting_velocity"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="60"
android:textColor="#FFFFFF"
@@ -65,8 +68,8 @@
android:id="@+id/viewPerspectiveSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_marginBottom="27dp"
android:layout_marginStart="50px"
android:layout_marginBottom="40px"
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
@@ -75,10 +78,12 @@
android:id="@+id/viewCheckStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
app:layout_constraintBottom_toBottomOf="@+id/viewPerspectiveSwitch"
android:layout_marginLeft="25px"
android:layout_marginBottom="40px"
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
app:layout_constraintTop_toTopOf="@+id/viewPerspectiveSwitch" />
app:layout_goneMarginStart="50px" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,7 +1,6 @@
<?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"
android:id="@+id/clAutopilotStatus"
android:layout_width="@dimen/module_mogo_autopilot_status_bg_width"
android:layout_height="@dimen/module_mogo_autopilot_status_bg_height"
android:background="@drawable/module_hmi_autopilot_status_bg">

View File

@@ -14,7 +14,7 @@
android:gravity="center"
android:text="检测"
android:textColor="#fff"
android:textSize="@dimen/dp_38"
android:textSize="@dimen/module_switch_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />

View File

@@ -23,7 +23,6 @@
android:id="@+id/textSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right|center"
android:paddingLeft="@dimen/module_switch_margin_left"
android:text="@string/module_map_model_normal"
android:textColor="@color/module_ext_color_voice_text"