[2.14.0] fix bug of thread problem

This commit is contained in:
zhongchao
2023-02-17 14:51:46 +08:00
parent 4b42363318
commit 2d25a59b1c

View File

@@ -1185,25 +1185,27 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
* 控制展示限速标志及内容
*/
override fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) {
// 控制 限速UI 展示
if (HmiBuildConfig.isShowLimitingVelocityView) {
if (limitingSpeed > 0) {
mViewLimitingVelocity?.visibility = View.VISIBLE
mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed, limitSpeedSource)
tvLimitingSource?.visibility = View.VISIBLE
if (limitSpeedSource == 1) {
tvLimitingSource.text = "MAP"
} else if (limitSpeedSource == 2) {
tvLimitingSource.text = "RSU"
ThreadUtils.runOnUiThread {
// 控制 限速UI 展示
if (HmiBuildConfig.isShowLimitingVelocityView) {
if (limitingSpeed > 0) {
mViewLimitingVelocity?.visibility = View.VISIBLE
mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed, limitSpeedSource)
tvLimitingSource?.visibility = View.VISIBLE
if (limitSpeedSource == 1) {
tvLimitingSource.text = "MAP"
} else if (limitSpeedSource == 2) {
tvLimitingSource.text = "RSU"
}
} else {
mViewLimitingVelocity?.visibility = View.INVISIBLE
mViewLimitingVelocity?.updateLimitingSpeed(0, limitSpeedSource)
tvLimitingSource?.visibility = View.INVISIBLE
}
} else {
mViewLimitingVelocity?.visibility = View.INVISIBLE
mViewLimitingVelocity?.updateLimitingSpeed(0, limitSpeedSource)
tvLimitingSource?.visibility = View.INVISIBLE
disableLimitingVelocity()
tvLimitingSource?.visibility = View.GONE
}
} else {
disableLimitingVelocity()
tvLimitingSource?.visibility = View.GONE
}
}