[1.0.2]
[添加频率限制、切换主线程]
This commit is contained in:
yangyakun
2023-02-23 11:28:01 +08:00
parent 4638409212
commit 1784fcccbc

View File

@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.m1.bus_p_m1_view_status_bar.view.*
import me.jessyan.autosize.utils.AutoSizeUtils
@@ -47,6 +48,7 @@ class StatusBarView @JvmOverloads constructor(
}
//添加view控制
CallerHmiViewControlListenerManager.addListener(TAG,this)
CallerHmiViewControlListenerManager.setListenerHz(TAG,5)
// 添加换肤监听
CallerSkinModeListenerManager.addListener(TAG, this)
@@ -82,9 +84,11 @@ class StatusBarView @JvmOverloads constructor(
}
override fun onBatteryManagementSystemStates(states: ChassisStatesOuterClass.BMSSystemStates) {
val bmsSoc = states.bmsSoc
progress.progress = bmsSoc.toInt()
tv_power_cos.text = "${bmsSoc.roundToInt()}%"
UiThreadHandler.post {
val bmsSoc = states.bmsSoc
progress.progress = bmsSoc.toInt()
tv_power_cos.text = "${bmsSoc.roundToInt()}%"
}
}
}