diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt index 67526ebbdb..b360e4d5fa 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxBubbleView.kt @@ -16,6 +16,9 @@ import com.mogo.eagle.core.function.msgbox.MsgBoxConfig import com.mogo.eagle.core.utilcode.util.UiThreadHandler import kotlinx.android.synthetic.main.layout_m_msg_box_bubble.view.* +/** + * M1消息盒子气泡态 + */ class MMsgBoxBubbleView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxButtonView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxButtonView.kt index 0509cdba13..e3c29a00c8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxButtonView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxButtonView.kt @@ -11,6 +11,9 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.hmi.R import kotlinx.android.synthetic.main.view_m1_msg_box_button.view.* +/** + * M1消息盒子切换按钮 + */ class MMsgBoxButtonView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt index 69f68eb5eb..9109c47a41 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt @@ -13,20 +13,26 @@ import com.mogo.eagle.core.data.msgbox.MsgCategory import com.mogo.eagle.core.data.msgbox.OperationMsg import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener +import com.mogo.eagle.core.function.api.order.IOrderListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager +import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.MMsgBoxListAdapter import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable import com.mogo.eagle.core.utilcode.util.UiThreadHandler import kotlinx.android.synthetic.main.layout_m_msg_box_list.view.* +/** + * M1消息盒子列表 + */ class MMsgBoxListView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener, IMsgBoxEventListener { +) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener, IMsgBoxEventListener, + IOrderListener { private val TAG = "MMsgBoxListView" var mMsgBoxListAdapter: MMsgBoxListAdapter?= null @@ -73,12 +79,14 @@ class MMsgBoxListView @JvmOverloads constructor( super.onAttachedToWindow() CallerMsgBoxListenerManager.addListener(TAG,this) CallerMsgBoxEventListenerManager.addListener(TAG,this) + CallerOrderListenerManager.addListener(TAG,this) } override fun onDetachedFromWindow() { super.onDetachedFromWindow() CallerMsgBoxListenerManager.removeListener(TAG) CallerMsgBoxEventListenerManager.removeListener(TAG) + CallerOrderListenerManager.removeListener(TAG) } override fun onSummaryClickEvent() { @@ -103,4 +111,13 @@ class MMsgBoxListView @JvmOverloads constructor( } + override fun onOrderRemoval() { + //清除历史消息,并刷新列表 + CallerMsgBoxManager.delMsgTable(context) + noticeList?.let { + it.clear() + mMsgBoxListAdapter?.setData(it) + } + } + } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/order/IOrderListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/order/IOrderListener.kt index 8ad2d1e052..db1d882fa6 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/order/IOrderListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/order/IOrderListener.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.api.order + package com.mogo.eagle.core.function.api.order /** * @author XuXinChao @@ -11,5 +11,10 @@ interface IOrderListener { * 通知订单状态 * @param inOrder true:开始订单;false:订单结束 */ - fun onUpdateOrderStatus(inOrder: Boolean) + fun onUpdateOrderStatus(inOrder: Boolean){} + + /** + * 订单核销 + */ + fun onOrderRemoval(){} } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/order/CallerOrderListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/order/CallerOrderListenerManager.kt index 7b1e5ea234..1116e74942 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/order/CallerOrderListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/order/CallerOrderListenerManager.kt @@ -18,4 +18,12 @@ object CallerOrderListenerManager: CallerBase() { } } + fun invokeOrderRemoval(){ + M_LISTENERS.forEach{ + val tag = it.key + val listener = it.value + listener.onOrderRemoval() + } + } + } \ No newline at end of file