Merge branch 'dev_robotaxi-d-app-module_251_220125_2.5.1' into dev_MogoAP_eagle-220_211207_8.0.17_merge

# Conflicts:
#	core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt
This commit is contained in:
donghongyu
2022-02-17 11:35:43 +08:00
7 changed files with 41 additions and 48 deletions

View File

@@ -95,7 +95,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
private var autoPilotBadCaseView: AutoPilotBadCaseView? = null
private var onBadCaseShow: (() -> Unit)? = null
private var onBadCaseShow: (() -> View)? = null
private var onBadCaseHide: (() -> Unit)? = null
companion object {
@@ -324,19 +324,12 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
}
dismissBadCaseEntryAfterSomeTime()
} else {
onBadCaseShow?.invoke()
}
}
}
override fun showBadCaseEntrance(entrance: View) {
entrance.lifecycleOwner.lifecycle.addObserver(badCaseEntranceObserver)
autoPilotBadCaseEntrance = entrance
lifecycleScope.launch {
withContext(Dispatchers.IO) {
val dao = Repository.dao()
dao.getAllUnConsumedRecords()?.first()?.let {
showBadCaseEntrance(it)
val view = onBadCaseShow?.invoke()
if (view != null) {
view.lifecycleOwner.lifecycle.addObserver(badCaseEntranceObserver)
view.visibility = View.GONE
autoPilotBadCaseEntrance = view
showBadCaseEntrance(record)
}
}
}
@@ -350,7 +343,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
}
}
override fun registerBadCaseCallback(onShow: () -> Unit, onHide: (() -> Unit)?) {
override fun registerBadCaseCallback(onShow: () -> View, onHide: (() -> Unit)?) {
onBadCaseShow = onShow
onBadCaseHide = onHide
}