[6.5.0][事件弹框] refactor: 乘客屏 UI 调整;

This commit is contained in:
aibingbing
2024-07-19 16:55:21 +08:00
parent a1766a7223
commit a5755fa321
2 changed files with 26 additions and 15 deletions

View File

@@ -89,16 +89,22 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
val layoutParam =
roundRoadV2NEventContainer.layoutParams as ConstraintLayout.LayoutParams
layoutParam.width = AutoSizeUtils.dp2px(
context, (580 + 33 + 33).toFloat()
context, (580 + 37 + 37).toFloat()
)
layoutParam.height = ConstraintLayout.LayoutParams.WRAP_CONTENT
layoutParam.setMargins(
0,
0,
AutoSizeUtils.dp2px(context, 40f - 37f),
0
)
roundRoadV2NEventContainer.layoutParams = layoutParam
roundRoadV2NEventContainer.background = ContextCompat.getDrawable(
context,
R.drawable.hmi_v2n_event_bg_passenger
)
//乘客屏 背景图 右边带了 7px 渐变
val padding = AutoSizeUtils.dp2px(context, 33f)
//乘客屏 背景图 右边带了 37px 渐变
val padding = AutoSizeUtils.dp2px(context, 37f)
roundRoadV2NEventContainer.setPadding(padding, padding, padding, padding)
val containerIconHintLayoutParams =
@@ -107,7 +113,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
containerIconHintLayoutParams.height = LayoutParams.WRAP_CONTENT
containerIconHintLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 36f - 14f), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(context, 30f),
AutoSizeUtils.dp2px(context, 30f - 14f),
AutoSizeUtils.dp2px(context, 36f),
0
)
@@ -115,16 +121,22 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
val ivV2XImageLayoutParams = ivV2XImage.layoutParams as RelativeLayout.LayoutParams
ivV2XImageLayoutParams.width =
AutoSizeUtils.dp2px(context, 69f + 14f + 14f) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(
context,
69f + 14f + 14f
) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
ivV2XImageLayoutParams.height =
AutoSizeUtils.dp2px(context, 69f + 14f + 14f) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(
context,
69f + 14f + 14f
) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
ivV2XImage.layoutParams = ivV2XImageLayoutParams
val tvV2XHintContentLayoutParams =
tvV2XHintContent.layoutParams as RelativeLayout.LayoutParams
tvV2XHintContentLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 30f - 14f), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
0,
AutoSizeUtils.dp2px(context, 16f),
AutoSizeUtils.dp2px(context, 5f),
0
)
@@ -134,12 +146,12 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
val containerImageAndLiveVideoLayoutParams =
containerImageAndLiveVideo.layoutParams as ConstraintLayout.LayoutParams
containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 480f)
containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 480f + 18f) //乘客屏视频加载里面背景切图包含了白边
containerImageAndLiveVideoLayoutParams.height = AutoSizeUtils.dp2px(context, 280f)
containerImageAndLiveVideoLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 40f),
AutoSizeUtils.dp2px(context, 0f), //乘客屏icon ivV2XImage带了白边
AutoSizeUtils.dp2px(context, 40f),
AutoSizeUtils.dp2px(context, 44f),
0
)
containerImageAndLiveVideo.layoutParams = containerImageAndLiveVideoLayoutParams

View File

@@ -35,15 +35,14 @@
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:scaleType="fitXY"
tools:src="@drawable/v2x_icon_shigong_zhandao" />
tools:src="@drawable/icon_v2x_bus_station_passenger" />
<TextView
android:id="@+id/tvV2XHintContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/dp_30"
android:layout_marginEnd="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_10"
android:layout_toRightOf="@+id/ivV2XImage"
android:ellipsize="end"
android:gravity="start|top"
@@ -58,9 +57,9 @@
android:id="@+id/containerImageAndLiveVideo"
android:layout_width="@dimen/dp_498"
android:layout_height="@dimen/dp_298"
android:layout_marginStart="@dimen/dp_51"
android:layout_marginLeft="@dimen/dp_51"
android:layout_marginTop="@dimen/dp_24"
android:layout_marginEnd="@dimen/dp_51"
android:layout_marginRight="@dimen/dp_51"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/containerIconHint">