提交 84431ceb 作者: enjoy

优化INIT

上级 2734777a
...@@ -12,7 +12,7 @@ import com.work.provide_tool.app.IApp.Companion.app ...@@ -12,7 +12,7 @@ import com.work.provide_tool.app.IApp.Companion.app
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext //import kotlinx.coroutines.withContext
fun getAppColor(id:Int): Int { fun getAppColor(id:Int): Int {
...@@ -82,7 +82,8 @@ private fun glideGeneralOption(url:Any?,iv:ImageView?,requestOptions:RequestOpti ...@@ -82,7 +82,8 @@ private fun glideGeneralOption(url:Any?,iv:ImageView?,requestOptions:RequestOpti
return return
} }
if(url is String){ when (url) {
is String -> {
url.run { url.run {
if(isEmpty()){ if(isEmpty()){
return return
...@@ -92,15 +93,20 @@ private fun glideGeneralOption(url:Any?,iv:ImageView?,requestOptions:RequestOpti ...@@ -92,15 +93,20 @@ private fun glideGeneralOption(url:Any?,iv:ImageView?,requestOptions:RequestOpti
replace("https","http") replace("https","http")
} }
} }
}else if(url is Int){ }
is Int -> {
url.run { url.run {
if(this == 0){ if(this == 0){
return return
} }
} }
}else{ }
else -> {
ToastUtil.show("glide load $url ??") ToastUtil.show("glide load $url ??")
} }
}
Glide.with(app).load(url).apply(requestOptions).into(iv) Glide.with(app).load(url).apply(requestOptions).into(iv)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论