[V2X]优化弹窗展示逻辑

This commit is contained in:
renwj
2022-02-11 10:32:47 +08:00
parent 3f57a56047
commit 5ae8fbe727

View File

@@ -587,7 +587,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
activity?.let {
val floatWindow = mWarningFloat
val showTag = floatWindow?.config?.floatTag
if (floatWindow == null || TextUtils.isEmpty(showTag) || !floatWindow.isShow()) {
if (floatWindow == null || TextUtils.isEmpty(showTag) || !floatWindow.isShow() || floatWindow.config.floatTag != tag) {
val notificationView = V2XNotificationView(it)
notificationView.setWarningIcon(EventTypeEnum.getWarningIcon(v2xType.toString()))
val warningContent = alertContent ?: EventTypeEnum.getWarningContent(v2xType.toString())
@@ -597,8 +597,8 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
} else {
notificationView.setWarningContent(warningContent)
}
if (mWarningFloat != null && mWarningFloat!!.config.floatTag != tag) {
WarningFloat.dismiss(mWarningFloat!!.config.floatTag, true)
if (floatWindow != null && floatWindow.isShow()) {
WarningFloat.dismiss(floatWindow.config.floatTag, true)
}
mWarningFloat = WarningFloat.with(it)
.setTag(tag)