[6.5.0] 封装view遮挡功能,提供给间隔探查功能

This commit is contained in:
EmArrow
2024-07-11 18:44:16 +08:00
parent 01fe95696b
commit a6771e4d02
7 changed files with 37 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: rootProject.file('gradle/bytex/bytex.gradle')
//apply from: rootProject.file('gradle/bytex/bytex.gradle')
Properties properties = new Properties()
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())

View File

@@ -30,10 +30,15 @@ public class MogoRouteOverlayManager implements
private final LinkedList<List<MessagePad.TrajectoryPoint>> queue = new LinkedList<>();
private AtomicBoolean hasGreenWave = new AtomicBoolean(false);
private final AtomicBoolean hasGreenWave = new AtomicBoolean(false);
private final IViewControlListener listener = new IViewControlListener() {
@Override
public void v2xEventVisible(int v) {
}
@Override
public void updateFuncMode(@NonNull String tag, boolean b) {
}

View File

@@ -2,8 +2,10 @@ package com.mogo.eagle.core.function.view
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.map.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
@@ -33,6 +35,7 @@ class CameraMarkerView(context: Context, attrs: AttributeSet? = null, defStyleAt
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerSkinModeListenerManager.addListener(TAG, this)
CallerHmiViewControlListenerManager.invokeV2XEvent(TAG, View.VISIBLE)
}
override fun onSkinModeChange(skinMode: Int) {
@@ -70,6 +73,7 @@ class CameraMarkerView(context: Context, attrs: AttributeSet? = null, defStyleAt
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerSkinModeListenerManager.removeListener(TAG)
CallerHmiViewControlListenerManager.invokeV2XEvent(TAG, View.GONE)
}
}

View File

@@ -139,6 +139,7 @@ class RoadCrossRoamView @JvmOverloads constructor(
CallerLogger.d("$M_MAP$TAG", "attachView return , mainPageVisible is false")
return
}
CallerHmiViewControlListenerManager.invokeV2XEvent(TAG, View.VISIBLE)
bringToFront()
CallerMapIdentifyManager.roam = Pair(TAG, true)
this.visibility = View.VISIBLE
@@ -198,6 +199,7 @@ class RoadCrossRoamView @JvmOverloads constructor(
if (lightMode) {
ivZhiRoadRoamView.clearAnimation()
}
CallerHmiViewControlListenerManager.invokeV2XEvent(TAG, View.GONE)
this.visibility = View.GONE
}

View File

@@ -7,6 +7,7 @@ interface IViewControlListener {
companion object{
const val TrafficLightView_TAG = "TrafficLightView_TAG"
const val LimitingVelocityView_TAG = "LimitingVelocityView_TAG"
const val V2X_EVENT_TAG = "V2X_EVENT_TAG"
const val FUNC_MODE_DEMO = "demoMode"
const val FUNC_MODE_RAIN = "rainMode"
}
@@ -16,6 +17,10 @@ interface IViewControlListener {
}
fun v2xEventVisible(v:Int){
}
fun mainPageViewVisible(v:Int){
}

View File

@@ -4,6 +4,7 @@ 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.base.CallerBase
import java.util.concurrent.ConcurrentHashMap
/**
* @author xiaoyuzhou
@@ -12,6 +13,7 @@ import com.mogo.eagle.core.function.call.base.CallerBase
*/
object CallerHmiViewControlListenerManager : CallerBase<IViewControlListener>() {
private var v2xEventTag = ConcurrentHashMap<String, Int>()
private var mainPageVisible = true
/**
@@ -22,6 +24,18 @@ object CallerHmiViewControlListenerManager : CallerBase<IViewControlListener>()
M_LISTENERS[tag]?.visible(v)
}
fun invokeV2XEvent(tag: String, v: Int) {
v2xEventTag[tag] = v
M_LISTENERS.forEach {
val listener = it.value
listener.v2xEventVisible(v)
}
}
fun v2xEventShow():Boolean{
return v2xEventTag.containsValue(View.VISIBLE)
}
fun invokeMainPageViewVisible(v: Int) {
mainPageVisible = (v == View.VISIBLE)
M_LISTENERS.forEach {
@@ -46,6 +60,7 @@ object CallerHmiViewControlListenerManager : CallerBase<IViewControlListener>()
}
fun invokeGreenWaveVisible(min: Int, max: Int, cross: Int) {
invokeVisible("GreenWave",View.VISIBLE)
M_LISTENERS.forEach {
val listener = it.value
listener.onGreenWaveViewVisible(min, max, cross)
@@ -53,6 +68,7 @@ object CallerHmiViewControlListenerManager : CallerBase<IViewControlListener>()
}
fun invokeGreenWaveDismiss() {
invokeVisible("GreenWave",View.GONE)
M_LISTENERS.forEach {
val listener = it.value
listener.onGreenWaveViewDismiss()

View File

@@ -25,15 +25,15 @@ object CallerMsgBoxManager {
* 存储数据到消息盒子
*/
fun saveMsgBox(bean: MsgBoxBean) {
CallerTrace.write(TAG,bean)
providerApi?.saveMsg(bean) //todo emArrow test
// CallerTrace.write(TAG,bean)
// providerApi?.saveMsg(bean) //todo emArrow test
}
/**
* 存储含有pb的数据到消息盒子(区别与上述方法中的trace write)
*/
fun saveMsgBoxHasPB(bean: MsgBoxBean){
providerApi?.saveMsg(bean) //todo emArrow test
// providerApi?.saveMsg(bean) //todo emArrow test
}
/**