[650] refactor: 通用事件弹框caller 调用,修改为调用者自己设置eventId;
This commit is contained in:
@@ -3,14 +3,25 @@ package com.mogo.eagle.core.function.call.hmi
|
||||
import com.mogo.eagle.core.data.v2x.RoadV2NEventWindowBean
|
||||
import com.mogo.eagle.core.function.api.hmi.v2n.IRoadV2NEventWindowListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* 路侧V2N事件弹框 调用者管理类
|
||||
*/
|
||||
object CallerRoadV2NEventWindowListenerManager : CallerBase<IRoadV2NEventWindowListener>() {
|
||||
|
||||
/**
|
||||
* 通用事件弹框,通过caremaIp, lon , lat请求查询拉流地址
|
||||
* @param eventId 调用者设置唯一的事件 ID
|
||||
* @param timestamp 事件发生的时间
|
||||
* @param iconResId 事件icon drawable id
|
||||
* @param hintStr 事件提示str
|
||||
* @param isNeedTTS show时是否需要同步tts
|
||||
* @param cameraIp 摄像头 IP
|
||||
* @param lon 事件发生经度
|
||||
* @param lat 事件发生维度
|
||||
*/
|
||||
fun show(
|
||||
eventId: String,
|
||||
timestamp: Long,
|
||||
iconResId: Int,
|
||||
hintStr: String,
|
||||
@@ -18,10 +29,9 @@ object CallerRoadV2NEventWindowListenerManager : CallerBase<IRoadV2NEventWindowL
|
||||
cameraIp: String,
|
||||
lon: Double,
|
||||
lat: Double
|
||||
): String {
|
||||
val uuid = UUID.randomUUID().toString()
|
||||
) {
|
||||
val data = RoadV2NEventWindowBean(
|
||||
uuid,
|
||||
eventId,
|
||||
timestamp,
|
||||
iconResId,
|
||||
hintStr,
|
||||
@@ -34,14 +44,17 @@ object CallerRoadV2NEventWindowListenerManager : CallerBase<IRoadV2NEventWindowL
|
||||
val listener = it.value
|
||||
listener.show(data)
|
||||
}
|
||||
return uuid
|
||||
}
|
||||
|
||||
fun dismiss(uuid: String) {
|
||||
/**
|
||||
* 关闭弹框(弹框是公用,同一事件只展示一个事件的弹框)
|
||||
* @param eventId show时传递的eventId
|
||||
*/
|
||||
fun dismiss(eventId: String) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.dismiss(
|
||||
uuid
|
||||
eventId
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user