mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
05481ac32c
commit
75bd24b133
@ -21,7 +21,12 @@ object ImageLoader {
|
||||
fun load(context: Context, path: String?): RequestBuilder<Drawable> {
|
||||
return when {
|
||||
path.isNullOrEmpty() -> Glide.with(context).load(path)
|
||||
path.isAbsUrl() -> GlideApp.with(context).load(AnalyzeUrl(path).getGlideUrl())
|
||||
path.isAbsUrl() -> {
|
||||
val url = kotlin.runCatching {
|
||||
AnalyzeUrl(path).getGlideUrl()
|
||||
}.getOrDefault(path)
|
||||
GlideApp.with(context).load(url)
|
||||
}
|
||||
path.isContentScheme() -> Glide.with(context).load(Uri.parse(path))
|
||||
else -> kotlin.runCatching {
|
||||
Glide.with(context).load(File(path))
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.legado.app.ui.rss.article
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.view.ViewGroup
|
||||
@ -24,6 +25,7 @@ class RssArticlesAdapter(context: Context, callBack: CallBack) :
|
||||
return ItemRssArticleBinding.inflate(inflater, parent, false)
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun convert(
|
||||
holder: ItemViewHolder,
|
||||
binding: ItemRssArticleBinding,
|
||||
|
Loading…
Reference in New Issue
Block a user