[V2X]优化V2X弹窗逻辑
This commit is contained in:
@@ -74,7 +74,6 @@ import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.reminder.*
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.*
|
||||
@@ -144,9 +143,9 @@ import java.util.*
|
||||
|
||||
private var adUpgradeDialog: AdUpgradeDialog?=null
|
||||
|
||||
private var speakJob: Job? = null
|
||||
private var lastSpeakJob: Job? = null
|
||||
|
||||
private var showV2XJob: Job? = null
|
||||
private var lastShowV2XJob: Job? = null
|
||||
|
||||
private var showingV2XTip: IReminder? = null
|
||||
private var roadVideoDialog: RoadVideoDialog? = null
|
||||
@@ -633,8 +632,6 @@ import java.util.*
|
||||
}
|
||||
}) {
|
||||
override fun show() {
|
||||
showV2XJob?.safeCancel()
|
||||
speakJob?.safeCancel()
|
||||
val parent = it.window.decorView
|
||||
parent.doOnAttach {
|
||||
Log.d("$M_HMI$TAG", "--- show v2x dialog 2 ---: info -> v2x-type: $v2xType : expireTime: $expireTime")
|
||||
@@ -644,15 +641,21 @@ import java.util.*
|
||||
override fun isOverride(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun key(): String {
|
||||
return v2xType
|
||||
}
|
||||
}, object : IStateChangeListener {
|
||||
|
||||
override fun onShow(reminder: IReminder) {
|
||||
listener?.onShow()
|
||||
lastShowV2XJob?.safeCancel()
|
||||
lastSpeakJob?.safeCancel()
|
||||
showingV2XTip = reminder
|
||||
lifecycleScope.launch {
|
||||
delay(expireTime)
|
||||
}.also { itx ->
|
||||
showV2XJob = itx
|
||||
lastShowV2XJob = itx
|
||||
}.invokeOnCompletion { _ ->
|
||||
reminder.hide()
|
||||
}
|
||||
@@ -660,7 +663,7 @@ import java.util.*
|
||||
lifecycleScope.launch {
|
||||
speak(it, ttsContent)
|
||||
}.also { itx ->
|
||||
speakJob = itx
|
||||
lastSpeakJob = itx
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user