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() {