pull/1395/head
gedoor 3 years ago
parent 05481ac32c
commit 75bd24b133
  1. 7
      app/src/main/java/io/legado/app/help/glide/ImageLoader.kt
  2. 2
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter.kt

@ -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…
Cancel
Save