[6.7.0][FSM] refactor:FSM&事件弹框 UI 走查修改;

This commit is contained in:
aibingbing
2024-09-27 18:36:32 +08:00
parent 3d7c041cce
commit 8948ff5ffe
11 changed files with 66 additions and 41 deletions

View File

@@ -105,8 +105,8 @@
android:id="@+id/roadV2NEventWindowView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_23"
android:layout_marginTop="@dimen/dp_39"
android:layout_marginRight="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_24"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>

View File

@@ -102,8 +102,8 @@
android:id="@+id/roadV2NEventWindowView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_23"
android:layout_marginTop="@dimen/dp_39"
android:layout_marginRight="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_24"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>

View File

@@ -95,8 +95,8 @@
android:id="@+id/roadV2NEventWindowView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_23"
android:layout_marginTop="@dimen/dp_39"
android:layout_marginRight="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_24"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>

View File

@@ -120,8 +120,8 @@
android:id="@+id/roadV2NEventWindowView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_23"
android:layout_marginTop="@dimen/dp_39"
android:layout_marginRight="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_24"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>

View File

@@ -168,8 +168,8 @@
android:id="@+id/roadV2NEventWindowView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_23"
android:layout_marginTop="@dimen/dp_39"
android:layout_marginRight="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_24"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>

View File

@@ -173,7 +173,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
val containerImageAndLiveVideoLayoutParams =
containerImageAndLiveVideo.layoutParams as ConstraintLayout.LayoutParams
containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 480f + 18f) //乘客屏视频加载里面背景切图包含了白边
containerImageAndLiveVideoLayoutParams.width =
AutoSizeUtils.dp2px(context, 480f + 18f) //乘客屏视频加载里面背景切图包含了白边
containerImageAndLiveVideoLayoutParams.height = AutoSizeUtils.dp2px(context, 280f)
containerImageAndLiveVideoLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 40f),
@@ -253,7 +254,10 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
containerIconHintLayoutParams.width = LayoutParams.MATCH_PARENT
containerIconHintLayoutParams.height = LayoutParams.WRAP_CONTENT
containerIconHintLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 20f - 19.4f * (54f / 69f)), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(
context,
20f - 19.4f * (54f / 69f)
), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(context, 27f - 10.7f * (54f / 69f)),
AutoSizeUtils.dp2px(context, 20f),
0
@@ -276,7 +280,10 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
val tvV2XHintContentLayoutParams =
tvV2XHintContent.layoutParams as RelativeLayout.LayoutParams
tvV2XHintContentLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 21f - 19.7f * (54f / 69f)), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(
context,
21f - 19.7f * (54f / 69f)
), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(context, (20f + 14f * (54f / 69f)) - (40f / 2f)),
AutoSizeUtils.dp2px(context, 5f),
0
@@ -292,7 +299,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
val containerImageAndLiveVideoLayoutParams =
containerImageAndLiveVideo.layoutParams as ConstraintLayout.LayoutParams
containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 350f + 18f * (350f / 480f)) //乘客屏视频加载里面背景切图包含了白边
containerImageAndLiveVideoLayoutParams.width =
AutoSizeUtils.dp2px(context, 350f + 18f * (350f / 480f)) //乘客屏视频加载里面背景切图包含了白边
containerImageAndLiveVideoLayoutParams.height = AutoSizeUtils.dp2px(context, 197f)
containerImageAndLiveVideoLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 20f),
@@ -348,13 +356,18 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
private fun setDriverScreenView() {
val layoutParam =
roundRoadV2NEventContainer.layoutParams as ConstraintLayout.LayoutParams
layoutParam.width = AutoSizeUtils.dp2px(context, (654 + 0 + 0).toFloat())
layoutParam.width = AutoSizeUtils.dp2px(context, (654 + 20 + 20).toFloat())
layoutParam.height = ConstraintLayout.LayoutParams.WRAP_CONTENT
roundRoadV2NEventContainer.layoutParams = layoutParam
// 切图 694*613px, 标注的实际内容 654*573px 其余为白边,白边 左上右下 20px 15px 20px 25px
roundRoadV2NEventContainer.background =
ContextCompat.getDrawable(context, R.drawable.hmi_v2n_event_bg_driver)
val padding = AutoSizeUtils.dp2px(context, 0f)
roundRoadV2NEventContainer.setPadding(padding, padding, padding, padding)
roundRoadV2NEventContainer.setPadding(
AutoSizeUtils.dp2px(context, 20f),
AutoSizeUtils.dp2px(context, 15f),
AutoSizeUtils.dp2px(context, 20f),
AutoSizeUtils.dp2px(context, 25f)
)
val containerIconHintLayoutParams =
containerIconHint.layoutParams as ConstraintLayout.LayoutParams
@@ -364,19 +377,19 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
AutoSizeUtils.dp2px(context, 30f - 16f),
AutoSizeUtils.dp2px(context, 30f - 14f),
AutoSizeUtils.dp2px(context, 30f - 16f),
0
AutoSizeUtils.dp2px(context, 20f - 18f)
)
containerIconHint.layoutParams = containerIconHintLayoutParams
val ivV2XImageLayoutParams = ivV2XImage.layoutParams as RelativeLayout.LayoutParams
ivV2XImageLayoutParams.width = AutoSizeUtils.dp2px(context, 120f + 16f + 16f)
ivV2XImageLayoutParams.height = AutoSizeUtils.dp2px(context, 120f + 16f + 16f)
ivV2XImageLayoutParams.height = AutoSizeUtils.dp2px(context, 120f + 14f + 18f)
ivV2XImage.layoutParams = ivV2XImageLayoutParams
val tvV2XHintContentLayoutParams =
tvV2XHintContent.layoutParams as RelativeLayout.LayoutParams
tvV2XHintContentLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 30f - 14f),
AutoSizeUtils.dp2px(context, 20f - 16f),
AutoSizeUtils.dp2px(context, (60f + 16f) - (50f / 2f)),
AutoSizeUtils.dp2px(context, 5f),
0
@@ -395,7 +408,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
containerImageAndLiveVideoLayoutParams.height = AutoSizeUtils.dp2px(context, 330f)
containerImageAndLiveVideoLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 30f),
AutoSizeUtils.dp2px(context, 20f - 16f),
AutoSizeUtils.dp2px(context, 0f),
AutoSizeUtils.dp2px(context, 30f),
0
)
@@ -409,9 +422,9 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
tvV2XTimeStrLayoutParams.height = LayoutParams.WRAP_CONTENT
tvV2XTimeStrLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 30f),
AutoSizeUtils.dp2px(context, 12f),
AutoSizeUtils.dp2px(context, 20f),
AutoSizeUtils.dp2px(context, 30f),
AutoSizeUtils.dp2px(context, 24f)
AutoSizeUtils.dp2px(context, 30f)
)
tvV2XTimeStr.layoutParams = tvV2XTimeStrLayoutParams
tvV2XTimeStr.setTextColor(Color.parseColor("#999999"))

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#B3000000" />
<solid android:color="#4D000000" />
<corners android:radius="@dimen/dp_30" />
</shape>

View File

@@ -1,29 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:orientation="horizontal">
android:layout_height="wrap_content">
<ImageView
android:id="@+id/leftImageView"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:layout_gravity="top|center_horizontal"
android:layout_marginTop="@dimen/dp_10"
android:src="@drawable/icon_fsm_error_red_arrow" />
<FrameLayout
android:id="@+id/imageContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/leftImageView"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_12"
android:src="@drawable/icon_fsm_error_red_arrow" />
</FrameLayout>
<TextView
android:id="@+id/rightTextView"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_20"
android:gravity="left|top"
android:text=""
android:textColor="#FFFFFF"
android:textSize="@dimen/sp_36"
tools:text="未收到全局轨迹状态 档位不是D 主车制动未释放 未收到SsmPilotState未收到" />
android:textSize="@dimen/sp_34"
app:layout_constraintLeft_toRightOf="@id/imageContainer"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/imageContainer"
tools:text="未收到全局轨迹状态
档位不是D
主车制动未释放
未收到SsmPilotState未收到" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -20,6 +20,7 @@
android:text=""
android:textColor="#FF4E41"
android:textSize="@dimen/sp_46"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"