diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt index 860941333a..8f715353c4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt @@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.DriverMsgBoxBubbleAdapter +import com.mogo.eagle.core.utilcode.util.UiThreadHandler import kotlinx.android.synthetic.main.layout_driver_msg_box_bubble.view.* /** @@ -53,12 +54,14 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor( override fun onDataChanged(category: MsgCategory, msgBoxBean: MsgBoxBean) { - if(category == MsgCategory.RECORD_BAG){ - //弹出被动录包弹窗 - CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true) - }else{ - dataList.add(msgBoxBean) - driverMsgBoxBubbleAdapter?.setData(dataList) + UiThreadHandler.post { + if(category == MsgCategory.RECORD_BAG){ + //弹出被动录包弹窗 + CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true) + }else{ + dataList.add(msgBoxBean) + driverMsgBoxBubbleAdapter?.setData(dataList) + } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt index 29ecb340f5..4d516326b7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt @@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxBubbleAdapter import com.mogo.eagle.core.utilcode.util.BarUtils +import com.mogo.eagle.core.utilcode.util.UiThreadHandler import kotlinx.android.synthetic.main.layout_passenger_msg_box_bubble.view.* /** @@ -51,11 +52,13 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor( } override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) { - if(category == MsgCategory.NOTICE){ - if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X - || msgBoxList.type == MsgBoxType.OBU){ - dataList.add(msgBoxList) - passengerMsgBoxBubbleAdapter?.setData(dataList) + UiThreadHandler.post { + if(category == MsgCategory.NOTICE){ + if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X + || msgBoxList.type == MsgBoxType.OBU){ + dataList.add(msgBoxList) + passengerMsgBoxBubbleAdapter?.setData(dataList) + } } } }