[6.5.0][事件弹框] refactor: 是否在高精地图页面,修改为主动查方式;

This commit is contained in:
aibingbing
2024-07-11 17:36:15 +08:00
parent 358278a915
commit 8fd0816dff

View File

@@ -18,7 +18,6 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.v2x.RoadV2NEventType
import com.mogo.eagle.core.data.v2x.RoadV2NEventWindowBean
import com.mogo.eagle.core.function.api.hmi.v2n.IRoadV2NEventWindowListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
@@ -49,8 +48,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IRoadV2NEventWindowListener,
IViewControlListener {
) : ConstraintLayout(context, attrs, defStyleAttr), IRoadV2NEventWindowListener {
companion object {
const val TAG = "RoadV2NEventWindowView"
@@ -75,9 +73,6 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
private var currentEventUUID: String = ""
// 只有在高精地图的tab才展示事件弹框
private var canShowV2NEventWindowView = true
init {
LayoutInflater.from(context).inflate(R.layout.hmi_view_road_v2n_event_window, this, true)
}
@@ -274,18 +269,17 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerRoadV2NEventWindowListenerManager.addListener(TAG, this)
CallerHmiViewControlListenerManager.addListener(TAG, this)
initView()
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerRoadV2NEventWindowListenerManager.removeListener(TAG)
CallerHmiViewControlListenerManager.removeListener(TAG)
}
override fun show(dataBean: RoadV2NEventWindowBean) {
trackEvent("show --> ${dataBean.toString()}")
val canShowV2NEventWindowView = CallerHmiViewControlListenerManager.getMainPageVisible()
if (!canShowV2NEventWindowView) {
trackEvent("show --> 当前不在高精地图页面,跳过")
return
@@ -353,9 +347,4 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
}
}
}
override fun mainPageViewVisible(v: Int) {
canShowV2NEventWindowView = (View.VISIBLE == v)
trackEvent("mainPageViewVisible --> $canShowV2NEventWindowView")
}
}