Commit ddccacbb authored by wanglei's avatar wanglei

...

parent f78e32f5
......@@ -174,7 +174,7 @@ object WeatherUtils {
/**
* 同步
*/
fun getWeatherData() {
fun getWeatherData() = runCatching {
val client = OkHttpClient.Builder().apply {
if (BuildConfig.DEBUG) {
addInterceptor(HttpLoggingInterceptor().apply {
......
......@@ -100,7 +100,6 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
val weatherCityBean = WeatherUtils.getWeatherEntity()
val weather = weatherCityBean?.list?.random()
if (weather != null) {
launch(Dispatchers.Main) {
LogEx.logDebug(TAG, "weather 开始 ${weather.fxDate}")
......@@ -147,6 +146,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
}
}
} else {
launch(Dispatchers.Main) {
if (isAgree) {
AnimationUtils.startAlphaAnimation(binding.pb, 400, null) {
callback.invoke()
......@@ -169,6 +169,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
}
}
}
}
}.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