[6.1.0]限速标识显示
This commit is contained in:
@@ -450,12 +450,12 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
//限速标识
|
||||
//TODO
|
||||
scSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView
|
||||
scSpeedLimit.setOnCheckedChangeListener { _, isChecked ->
|
||||
hmiAction("SOP 限速标识开关, ",isChecked)
|
||||
if (isChecked) {
|
||||
HmiBuildConfig.isShowLimitingVelocityView = true
|
||||
CallerHmiViewControlListenerManager.invokeVisible(IViewControlListener.LimitingVelocityView_TAG,View.VISIBLE)
|
||||
} else {
|
||||
HmiBuildConfig.isShowLimitingVelocityView = false
|
||||
CallerHmiViewControlListenerManager.invokeVisible(IViewControlListener.LimitingVelocityView_TAG,View.GONE)
|
||||
|
||||
@@ -27,6 +27,9 @@ class LimitingVelocityView constructor(
|
||||
private const val TAG = "LimitingVelocityView"
|
||||
}
|
||||
|
||||
//限速控件是否展示
|
||||
private var isShow = false
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true)
|
||||
}
|
||||
@@ -38,20 +41,22 @@ class LimitingVelocityView constructor(
|
||||
}
|
||||
|
||||
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (limitingVelocity > 0) {
|
||||
visibility = View.VISIBLE
|
||||
tvLimitingVelocity.text = "$limitingVelocity"
|
||||
tvLimitingSource?.text = DataSourceType.getName(sourceType)
|
||||
} else {
|
||||
visibility = View.GONE
|
||||
tvLimitingSource?.text = ""
|
||||
if(isShow){
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (limitingVelocity > 0) {
|
||||
visibility = View.VISIBLE
|
||||
tvLimitingVelocity.text = "$limitingVelocity"
|
||||
tvLimitingSource?.text = DataSourceType.getName(sourceType)
|
||||
} else {
|
||||
visibility = View.GONE
|
||||
tvLimitingSource?.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
isShow = v == View.VISIBLE
|
||||
this.visibility = v
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user