「Change」

修复工具面板「车速设置」UI不再主线程更新问题

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-04-02 12:36:13 +08:00
parent f5adb1a8ce
commit a9a7acc302
2 changed files with 8 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.view_auto_pilot_check.view.*
import mogo.telematics.pad.MessagePad
@@ -200,7 +201,9 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
}
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²"
etInputSpeed.setText((carConfigResp.speedLimit * 3.6).toInt().toString())
UiThreadHandler.post {
tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²"
etInputSpeed.setText((carConfigResp.speedLimit * 3.6).toInt().toString())
}
}
}

View File

@@ -183,14 +183,13 @@
android:id="@+id/tvAcceleration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="123px"
android:layout_marginTop="12px"
android:text="加速度 2 m/s²"
android:textColor="#A7B6F0"
android:textSize="32px"
android:layout_marginTop="12px"
android:layout_marginStart="123px"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/llSpeedPosition"
/>
app:layout_constraintTop_toBottomOf="@id/llSpeedPosition" />
<View
android:layout_width="14px"