[6.5.0][道路事件] 绿波通行业务逻辑

This commit is contained in:
renwj
2024-07-03 19:50:49 +08:00
parent fd087758c9
commit de4d758930
10 changed files with 190 additions and 31 deletions

View File

@@ -4,6 +4,7 @@ import android.content.Context
import android.text.TextUtils
import android.view.Gravity
import android.view.ViewGroup
import android.view.WindowManager
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.facade.annotation.Route
@@ -30,6 +31,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager
import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog
import com.mogo.eagle.core.function.hmi.ui.greenwave.GreenWaveView
import com.mogo.eagle.core.function.hmi.ui.lookaround.M1LookAroundView
import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
@@ -83,6 +85,8 @@ class MoGoHmiProvider : IMoGoHmiProvider {
private val xiaozhi by lazy { XiaoZhiStateManager() }
private val greenWave by lazy { AtomicReference<MoGoPopWindow>() }
override fun init(context: Context?) {
this.context = context
@@ -403,4 +407,29 @@ class MoGoHmiProvider : IMoGoHmiProvider {
override fun notifyXiaoZhiStatusChanged(event: Event, state: State) {
xiaozhi.notify(event, state)
}
override fun showGreenWave(min: Int, max: Int, cross: Int) {
val activity = AppStateManager.currentActivity() ?: return
greenWave.get()?.hide()
val content = GreenWaveView(activity)
MoGoPopWindow.Builder()
.contentView(content)
.width(WindowManager.LayoutParams.WRAP_CONTENT)
.height(WindowManager.LayoutParams.WRAP_CONTENT)
.attachToActivity(activity)
.gravityInActivity(Gravity.END)
.onDismissed {
greenWave.set(null)
}
.onShowed {
content.bind(min, max, cross)
}
.build().also {
greenWave.set(it)
}.show()
}
override fun dismissGreenWave() {
greenWave.get()?.hide()
}
}

View File

@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.hmi.ui.greenwave
import android.content.Context
import android.os.Looper
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.MotionEvent