[6.5.0][道路事件] 绿波通行业务逻辑
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user