[3.1.0]
[pnc]
This commit is contained in:
yangyakun
2023-04-17 12:19:10 +08:00
parent f655da0bde
commit 6203738612
3 changed files with 11 additions and 9 deletions

View File

@@ -75,12 +75,14 @@
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
android:id="@+id/pnc_actions_view"
android:layout_width="@dimen/dp_231"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_36"
app:layout_constraintBottom_toTopOf="@+id/video_fragment"
android:layout_marginBottom="@dimen/dp_25"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:pnc_size="@dimen/dp_18"
app:pnc_top_margin="@dimen/dp_0"
app:background_resource="@drawable/bg_pnc" />
<!-- 图片或视频广告-->

View File

@@ -44,8 +44,8 @@ class PncActionsView @JvmOverloads constructor(
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private val bgResources: Int
private val topMargin: Int
private val txtSize: Int
private val topMargin: Float
private val txtSize: Float
init {
LayoutInflater.from(context).inflate(R.layout.view_pnc_actions, this, true)
@@ -54,13 +54,13 @@ class PncActionsView @JvmOverloads constructor(
R.styleable.PncActionsView_background_resource,
R.drawable.pnc_actions_bg
)
topMargin = a.getResourceId(
topMargin = a.getDimension(
R.styleable.PncActionsView_pnc_top_margin,
resources.getDimension(R.dimen.dp_30).toInt()
resources.getDimension(R.dimen.dp_30)
)
txtSize = a.getResourceId(
txtSize = a.getDimension(
R.styleable.PncActionsView_pnc_size,
resources.getDimension(R.dimen.dp_34).toInt()
resources.getDimension(R.dimen.dp_34)
)
a.recycle()
}

View File

@@ -76,8 +76,8 @@
<declare-styleable name="PncActionsView">
<attr name="background_resource" format="reference"/>
<attr name="pnc_top_margin" format="reference"/>
<attr name="pnc_size" format="reference"/>
<attr name="pnc_top_margin" format="dimension"/>
<attr name="pnc_size" format="dimension"/>
</declare-styleable>
</resources>