From 18b047c6114e2deea1c4419ac280ba895e580e96 Mon Sep 17 00:00:00 2001 From: aibingbing Date: Fri, 27 Sep 2024 14:13:30 +0800 Subject: [PATCH] =?UTF-8?q?[6.7.0][=E6=95=B0=E6=8D=AE=E4=B8=8A=E8=BD=A6]?= =?UTF-8?q?=20refactor:=20B2=E4=B9=98=E5=AE=A2=E7=AB=AF=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=BC=B9=E6=A1=86=20=E9=97=B4=E8=B7=9D?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/v2n/RoadV2NEventWindowView.kt | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/v2n/RoadV2NEventWindowView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/v2n/RoadV2NEventWindowView.kt index df3be89f14..fbca9dc9e9 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/v2n/RoadV2NEventWindowView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/v2n/RoadV2NEventWindowView.kt @@ -225,6 +225,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor( } private fun setB2PassengerScreenView() { + // 对比taxi乘客屏 按比例缩放 + // 25 = 390/580 * 37 val layoutParam = roundRoadV2NEventContainer.layoutParams as ConstraintLayout.LayoutParams layoutParam.width = AutoSizeUtils.dp2px( @@ -234,7 +236,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor( layoutParam.setMargins( 0, 0, - AutoSizeUtils.dp2px(context, 39f - 37f), + AutoSizeUtils.dp2px(context, 39f - 25f), 0 ) roundRoadV2NEventContainer.layoutParams = layoutParam @@ -242,8 +244,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor( context, R.drawable.hmi_v2n_event_bg_passenger ) - //乘客屏 背景图 右边带了 37px 渐变 - val padding = AutoSizeUtils.dp2px(context, 37f) + //乘客屏 背景图 右边带了 25px 渐变 + val padding = AutoSizeUtils.dp2px(context, 25f) roundRoadV2NEventContainer.setPadding(padding, padding, padding, padding) val containerIconHintLayoutParams = @@ -251,8 +253,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor( containerIconHintLayoutParams.width = LayoutParams.MATCH_PARENT containerIconHintLayoutParams.height = LayoutParams.WRAP_CONTENT containerIconHintLayoutParams.setMargins( - AutoSizeUtils.dp2px(context, 20f - 19.4f), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整 - AutoSizeUtils.dp2px(context, 27f - 10.7f), + AutoSizeUtils.dp2px(context, 20f - 19.4f * (54f / 69f)), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整 + AutoSizeUtils.dp2px(context, 27f - 10.7f * (54f / 69f)), AutoSizeUtils.dp2px(context, 20f), 0 ) @@ -262,20 +264,20 @@ class RoadV2NEventWindowView @JvmOverloads constructor( ivV2XImageLayoutParams.width = AutoSizeUtils.dp2px( context, - 56f + 14f + 14f + 56f + (14f + 14f) * (54f / 69f) // 对比taxi乘客屏 按比例缩放 ) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整 ivV2XImageLayoutParams.height = AutoSizeUtils.dp2px( context, - 56f + 14f + 14f + 56f + (14f + 14f) * (54f / 69f) // 对比taxi乘客屏 按比例缩放 ) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整 ivV2XImage.layoutParams = ivV2XImageLayoutParams val tvV2XHintContentLayoutParams = tvV2XHintContent.layoutParams as RelativeLayout.LayoutParams tvV2XHintContentLayoutParams.setMargins( - AutoSizeUtils.dp2px(context, 21f - 19.7f), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整 - AutoSizeUtils.dp2px(context, (28f + 14f) - (40f / 2f)), + 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 ) @@ -290,11 +292,11 @@ class RoadV2NEventWindowView @JvmOverloads constructor( val containerImageAndLiveVideoLayoutParams = containerImageAndLiveVideo.layoutParams as ConstraintLayout.LayoutParams - containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 350f + 18f) //乘客屏视频加载里面背景切图包含了白边 + containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 350f + 18f * (350f / 480f)) //乘客屏视频加载里面背景切图包含了白边 containerImageAndLiveVideoLayoutParams.height = AutoSizeUtils.dp2px(context, 197f) containerImageAndLiveVideoLayoutParams.setMargins( AutoSizeUtils.dp2px(context, 20f), - AutoSizeUtils.dp2px(context, 23f - 14f), //乘客屏icon ivV2XImage带了白边 + AutoSizeUtils.dp2px(context, 23f - 14f * (54f / 69f)), //乘客屏icon ivV2XImage带了白边 AutoSizeUtils.dp2px(context, 20f), 0 ) @@ -307,9 +309,9 @@ class RoadV2NEventWindowView @JvmOverloads constructor( tvV2XTimeStrLayoutParams.width = LayoutParams.MATCH_PARENT tvV2XTimeStrLayoutParams.height = LayoutParams.WRAP_CONTENT tvV2XTimeStrLayoutParams.setMargins( - AutoSizeUtils.dp2px(context, 20f), - AutoSizeUtils.dp2px(context, 16f), - AutoSizeUtils.dp2px(context, 20f), + AutoSizeUtils.dp2px(context, 19f), + AutoSizeUtils.dp2px(context, 16.6f), + AutoSizeUtils.dp2px(context, 19f), AutoSizeUtils.dp2px(context, 26f) ) tvV2XTimeStr.layoutParams = tvV2XTimeStrLayoutParams