[Fix]对于warningContent和tts为null或空字符串时不提示

This commit is contained in:
chenfufeng
2021-12-15 19:48:35 +08:00
parent 3c50dc8c9f
commit 9abdffb087

View File

@@ -209,12 +209,13 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
val notificationView = V2XNotificationView(it)
notificationView.setWarningIcon(EventTypeEnum.getWarningIcon(v2xType.toString()))
notificationView.setWarningContent(
alertContent ?: EventTypeEnum.getWarningContent(
v2xType.toString()
)
)
val warningContent = alertContent ?: EventTypeEnum.getWarningContent(v2xType.toString())
if (warningContent.isNullOrEmpty()) {
Logger.e(TAG, "Show warningContent is null or empty!")
return
} else {
notificationView.setWarningContent(warningContent)
}
if (mWarningFloat != null && mWarningFloat!!.config.floatTag != tag) {
WarningFloat.dismiss(mWarningFloat!!.config.floatTag, true)