[3.4.0] fix bug of ui in pnc action view and door status invoke, remove dispatch upload autopilot status
This commit is contained in:
zhongchao
2023-07-25 16:28:33 +08:00
parent a7b2528d4b
commit 5e37881e37
11 changed files with 27 additions and 88 deletions

View File

@@ -40,7 +40,6 @@ class PncActionsView @JvmOverloads constructor(
private var mTrafficLightResult: TrafficLightResult? = null
private val bgResources: Int
private val topMargin: Float
private val txtSize: Float
init {
@@ -50,10 +49,6 @@ class PncActionsView @JvmOverloads constructor(
R.styleable.PncActionsView_background_resource,
R.drawable.pnc_actions_bg
)
topMargin = a.getDimension(
R.styleable.PncActionsView_pnc_top_margin,
resources.getDimension(R.dimen.dp_30)
)
txtSize = a.getDimension(
R.styleable.PncActionsView_pnc_size,
resources.getDimension(R.dimen.dp_34)
@@ -63,7 +58,6 @@ class PncActionsView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
(tvHmiPncActions.layoutParams as MarginLayoutParams).topMargin = topMargin.toInt()
tvHmiPncActions.setTextSize(COMPLEX_UNIT_PX, txtSize)
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
@@ -81,7 +75,7 @@ class PncActionsView @JvmOverloads constructor(
override fun onAutopilotStatusResponse(state: Int) {
if (state != STATUS_AUTOPILOT_RUNNING) {
UiThreadHandler.post {
this.background = null
tvHmiPncActions.background = null
tvHmiPncActions.text = ""
}
}
@@ -117,15 +111,15 @@ class PncActionsView @JvmOverloads constructor(
}
// update view
if (actions.isNullOrEmpty()) {
this.background = null
tvHmiPncActions.background = null
tvHmiPncActions.text = ""
} else {
this.background =
tvHmiPncActions.background =
AppCompatResources.getDrawable(context, bgResources)
tvHmiPncActions.text = actions
}
} else {
this.background = null
tvHmiPncActions.background = null
tvHmiPncActions.text = ""
}
}

View File

@@ -2,12 +2,15 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="match_parent">
<TextView
android:id="@+id/tvHmiPncActions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:paddingStart="@dimen/dp_70"
android:paddingBottom="@dimen/dp_5"
android:paddingEnd="@dimen/dp_70"
android:gravity="center"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -85,7 +85,6 @@
<declare-styleable name="PncActionsView">
<attr name="background_resource" format="reference"/>
<attr name="pnc_top_margin" format="dimension"/>
<attr name="pnc_size" format="dimension"/>
</declare-styleable>