[2.15.0] 优化UiThreadHandler和ThreadUtils往主线程消息队列添加消息的方式,添加最新和排队两种方式

This commit is contained in:
renwj
2023-04-19 08:57:44 +08:00
parent 79af3a3317
commit bf00ddcab3
3 changed files with 87 additions and 24 deletions

View File

@@ -70,7 +70,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxBean: MsgBoxBean) {
UiThreadHandler.post {
UiThreadHandler.post({
when (category) {
MsgCategory.NOTICE -> {
MsgBoxConfig.noticeList.add(msgBoxBean)
@@ -98,7 +98,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
driverMsgBoxBubbleAdapter?.setData(dataList)
}
}
}
}, UiThreadHandler.MODE.QUEUE)
}
override fun onAttachedToWindow() {