From b4db94488935b4601ed47f625cea67467fe43e11 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Wed, 29 Jul 2020 11:03:47 +0800 Subject: [PATCH] bug fix: UI-2.0/UI-883 tvCountDown must not be null --- .../module/splash/fragment/BydSplashFragment.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt index bcd4301496..1148d63378 100644 --- a/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt +++ b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt @@ -34,12 +34,14 @@ class BydSplashFragment :MvpFragment(),Han override fun handleMessage(msg: Message): Boolean { if (msg.what == MSG_COUNT_DOWN) { - countDownTime-- - if(countDownTime>0) { - tvCountDown.text = countDownTime.toString() - handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY) - }else{ - hideSplash() + tvCountDown?.also { + countDownTime-- + if(countDownTime>0) { + it.text = countDownTime.toString() + handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY) + }else{ + hideSplash() + } } return true }