From c2019586e054fd4bf7cba5b10aeb43e675f892a3 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Fri, 12 Nov 2021 21:18:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=8CFix=E3=80=8D=E4=BF=AE=E5=A4=8DService?= =?UTF-8?q?=E8=BF=87=E6=97=A9=E5=88=9D=E5=A7=8B=E5=8C=96=E8=B0=83=E7=94=A8?= =?UTF-8?q?UI=E5=AF=BC=E8=87=B4=E5=BC=82=E5=B8=B8=20https://bugly.qq.com/v?= =?UTF-8?q?2/crash-reporting/crashes/ac71228f85/8=3Fpid=3D1=20#8=20java.la?= =?UTF-8?q?ng.NullPointerException=20null=20cannot=20be=20cast=20to=20non-?= =?UTF-8?q?null=20type=20com.mogo.eagle.core.function.api.hmi.warning.IMoG?= =?UTF-8?q?oWaringProvider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit com.mogo.eagle.core.function.call.hmi.CallerHmiManager.getWaringProviderApi(CallerHmiManager.kt:20) Signed-off-by: donghongyu --- .../core/function/hmi/ui/MoGoHmiFragment.kt | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index a551e7ae34..04130aa7b4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -69,9 +69,9 @@ class MoGoHmiFragment : MvpFragment ThreadUtils.runOnUiThread { Logger.d(TAG, "vipIdentification") if (visible) { - flVipIdentificationView.visibility = View.VISIBLE + flVipIdentificationView?.visibility = View.VISIBLE } else { - flVipIdentificationView.visibility = View.GONE + flVipIdentificationView?.visibility = View.GONE } } } @@ -85,7 +85,7 @@ class MoGoHmiFragment : MvpFragment override fun initViews() { initViewShowWithConfig() - ivCameraIcon.setOnClickListener { + ivCameraIcon?.setOnClickListener { if (cameraViewFloat == null) { showCameraList(CallerMonitorManager.getCameraList()) } @@ -183,19 +183,19 @@ class MoGoHmiFragment : MvpFragment } override fun setSpeedChartViewVisibility(visibility: Int) { - viewSpeedChart.visibility = visibility + viewSpeedChart?.visibility = visibility } override fun setAutopilotStatusViewVisibility(visibility: Int) { - viewAutopilotStatus.visibility = visibility + viewAutopilotStatus?.visibility = visibility } override fun setPerspectiveSwitchViewVisibility(visibility: Int) { - viewPerspectiveSwitch.visibility = visibility + viewPerspectiveSwitch?.visibility = visibility } override fun setCheckStatusViewVisibility(visibility: Int) { - viewCheckStatus.visibility = visibility + viewCheckStatus?.visibility = visibility } /** @@ -292,26 +292,26 @@ class MoGoHmiFragment : MvpFragment * @param checkLightId 0-都是默认不亮起,1-红,2-黄,3-绿 */ override fun showWarningTrafficLight(checkLightId: Int) { - viewTrafficLightVr.showWarningTrafficLight(checkLightId) + viewTrafficLightVr?.showWarningTrafficLight(checkLightId) } /** * 关闭红绿灯预警展示,并重制灯态 */ override fun disableWarningTrafficLight() { - viewTrafficLightVr.disableWarningTrafficLight() + viewTrafficLightVr?.disableWarningTrafficLight() } override fun changeCountdownRed(redNum: Int) { - viewTrafficLightVr.changeCountdownRed(redNum) + viewTrafficLightVr?.changeCountdownRed(redNum) } override fun changeCountdownYellow(yellowNum: Int) { - viewTrafficLightVr.changeCountdownYellow(yellowNum) + viewTrafficLightVr?.changeCountdownYellow(yellowNum) } override fun changeCountdownGreen(greenNum: Int) { - viewTrafficLightVr.changeCountdownGreen(greenNum) + viewTrafficLightVr?.changeCountdownGreen(greenNum) } /** @@ -320,7 +320,7 @@ class MoGoHmiFragment : MvpFragment * @param greenNum 绿灯倒计时 */ override fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int) { - viewTrafficLightVr.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum) + viewTrafficLightVr?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum) } /** @@ -328,11 +328,11 @@ class MoGoHmiFragment : MvpFragment */ override fun showLimitingVelocity(limitingSpeed: Int) { if (limitingSpeed > 0) { - tvLimitingVelocity.visibility = View.VISIBLE - tvLimitingVelocity.text = "$limitingSpeed" + tvLimitingVelocity?.visibility = View.VISIBLE + tvLimitingVelocity?.text = "$limitingSpeed" } else { - tvLimitingVelocity.visibility = View.INVISIBLE - tvLimitingVelocity.text = "0" + tvLimitingVelocity?.visibility = View.INVISIBLE + tvLimitingVelocity?.text = "0" } } @@ -340,8 +340,8 @@ class MoGoHmiFragment : MvpFragment * 控制关闭限速标志及内容 */ override fun disableLimitingVelocity() { - tvLimitingVelocity.visibility = View.GONE - tvLimitingVelocity.text = "0" + tvLimitingVelocity?.visibility = View.GONE + tvLimitingVelocity?.text = "0" } /** @@ -350,7 +350,7 @@ class MoGoHmiFragment : MvpFragment * @see WarningDirectionEnum */ override fun showWarning(direction: WarningDirectionEnum) { - flV2XWarningView.showWarning(direction) + flV2XWarningView?.showWarning(direction) } /** @@ -360,7 +360,7 @@ class MoGoHmiFragment : MvpFragment * @param closeTime 倒计时 */ override fun showWarning(direction: WarningDirectionEnum, closeTime: Long) { - flV2XWarningView.showWarning(direction, closeTime) + flV2XWarningView?.showWarning(direction, closeTime) } /** @@ -369,7 +369,7 @@ class MoGoHmiFragment : MvpFragment */ override fun showNoticeForTrafficWithData(trafficStylePushData: NoticeTrafficStylePushData?) { ThreadUtils.runOnUiThread { - activity.let { + activity?.let { val noticeBannerView = this.context?.let { it1 -> NoticeBannerView(it1) } noticeBannerView?.refreshWithData(trafficStylePushData) mNoticeFloat = it?.let { it1 -> @@ -418,10 +418,10 @@ class MoGoHmiFragment : MvpFragment override fun showNoticeNormalData(normalData: NoticeNormalData?) { ThreadUtils.runOnUiThread { - activity.let { + activity?.let { val noticeBannerView = this.context?.let { it1 -> NoticeNormalBannerView(it1) } noticeBannerView?.setPushData(normalData) - mNoticeFloat = it?.let { it1 -> + mNoticeFloat = it.let { it1 -> noticeBannerView?.let { it2 -> WarningFloat.with(it1) .setTag(tag) @@ -433,8 +433,8 @@ class MoGoHmiFragment : MvpFragment .addWarningStatusListener(object : IMoGoWarningStatusListener { override fun onShow() { // 创建弹窗成功才进行TTS播报 -// AIAssist.getInstance(activity) -// .speakTTSVoice("") + // AIAssist.getInstance(activity) + // .speakTTSVoice("") } }) .setAnimator(object : DefaultAnimator() {