[6.5.0] 添加页面切换时主动获取页面状态的功能

This commit is contained in:
EmArrow
2024-07-11 17:27:21 +08:00
parent 1c802e3936
commit d171b1b334
2 changed files with 13 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
@@ -134,6 +135,10 @@ class RoadCrossRoamView @JvmOverloads constructor(
}
return
}
if(CallerHmiViewControlListenerManager.getMainPageVisible()){
CallerLogger.d("$M_MAP$TAG", "attachView return , mainPageVisible is false")
return
}
bringToFront()
CallerMapIdentifyManager.roam = Pair(TAG, true)
this.visibility = View.VISIBLE

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.hmi
import android.view.View
import android.view.ViewGroup
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
@@ -12,6 +13,8 @@ import com.mogo.eagle.core.function.call.base.CallerBase
*/
object CallerHmiViewControlListenerManager : CallerBase<IViewControlListener>() {
private var mainPageVisible = true
/**
* 触发 view 显示隐藏
* @param v 显示/隐藏状态
@@ -21,12 +24,17 @@ object CallerHmiViewControlListenerManager : CallerBase<IViewControlListener>()
}
fun invokeMainPageViewVisible(v: Int) {
mainPageVisible = (v == View.VISIBLE)
M_LISTENERS.forEach {
val listener = it.value
listener.mainPageViewVisible(v)
}
}
fun getMainPageVisible(): Boolean {
return mainPageVisible
}
fun setStatusBarDarkOrLight(tag: String, light: Boolean) {
M_LISTENERS[tag]?.setStatusBarDarkOrLight(light)
}