Commit ddccacbb authored by wanglei's avatar wanglei

...

parent f78e32f5
...@@ -174,7 +174,7 @@ object WeatherUtils { ...@@ -174,7 +174,7 @@ object WeatherUtils {
/** /**
* 同步 * 同步
*/ */
fun getWeatherData() { fun getWeatherData() = runCatching {
val client = OkHttpClient.Builder().apply { val client = OkHttpClient.Builder().apply {
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
addInterceptor(HttpLoggingInterceptor().apply { addInterceptor(HttpLoggingInterceptor().apply {
......
...@@ -100,7 +100,6 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(), ...@@ -100,7 +100,6 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
val weatherCityBean = WeatherUtils.getWeatherEntity() val weatherCityBean = WeatherUtils.getWeatherEntity()
val weather = weatherCityBean?.list?.random() val weather = weatherCityBean?.list?.random()
if (weather != null) { if (weather != null) {
launch(Dispatchers.Main) { launch(Dispatchers.Main) {
LogEx.logDebug(TAG, "weather 开始 ${weather.fxDate}") LogEx.logDebug(TAG, "weather 开始 ${weather.fxDate}")
...@@ -147,6 +146,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(), ...@@ -147,6 +146,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
} }
} }
} else { } else {
launch(Dispatchers.Main) {
if (isAgree) { if (isAgree) {
AnimationUtils.startAlphaAnimation(binding.pb, 400, null) { AnimationUtils.startAlphaAnimation(binding.pb, 400, null) {
callback.invoke() callback.invoke()
...@@ -169,6 +169,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(), ...@@ -169,6 +169,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
} }
} }
} }
}
}.start() }.start()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment