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

This commit is contained in:
chenfufeng
2021-12-15 19:48:35 +08:00
parent 4554d33461
commit 185a231aa6

View File

@@ -279,12 +279,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)