fix:订阅源封面,icon的缺省headers的优先级:书源>全局

pull/1766/head
Xwite 3 years ago
parent 3f49ef95ff
commit 6ecb62177b
  1. 4
      app/src/main/java/io/legado/app/help/glide/ImageLoader.kt
  2. 2
      app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt
  3. 2
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter.kt
  4. 2
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter1.kt
  5. 2
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesAdapter2.kt
  6. 2
      app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt

@ -28,7 +28,9 @@ object ImageLoader {
} }
path.isAbsUrl() -> { path.isAbsUrl() -> {
kotlin.runCatching { kotlin.runCatching {
val source = sourceOrigin?.let { appDb.bookSourceDao.getBookSource(it) } val source = sourceOrigin?.let {
appDb.bookSourceDao.getBookSource(it) ?: appDb.rssSourceDao.getByKey(it)
}
val url = AnalyzeUrl(path, source = source).getGlideUrl() val url = AnalyzeUrl(path, source = source).getGlideUrl()
GlideApp.with(context).load(url) GlideApp.with(context).load(url)
}.getOrDefault( }.getOrDefault(

@ -27,7 +27,7 @@ class RssAdapter(context: Context, val callBack: CallBack) :
) { ) {
binding.apply { binding.apply {
tvName.text = item.sourceName tvName.text = item.sourceName
ImageLoader.load(context, item.sourceIcon) ImageLoader.load(context, item.sourceIcon, item.sourceUrl)
.centerCrop() .centerCrop()
.placeholder(R.drawable.image_rss) .placeholder(R.drawable.image_rss)
.error(R.drawable.image_rss) .error(R.drawable.image_rss)

@ -38,7 +38,7 @@ class RssArticlesAdapter(context: Context, callBack: CallBack) :
if (item.image.isNullOrBlank() && !callBack.isGridLayout) { if (item.image.isNullOrBlank() && !callBack.isGridLayout) {
imageView.gone() imageView.gone()
} else { } else {
ImageLoader.load(context, item.image).apply { ImageLoader.load(context, item.image, item.origin).apply {
if (callBack.isGridLayout) { if (callBack.isGridLayout) {
placeholder(R.drawable.image_rss_article) placeholder(R.drawable.image_rss_article)
} else { } else {

@ -36,7 +36,7 @@ class RssArticlesAdapter1(context: Context, callBack: CallBack) :
if (item.image.isNullOrBlank() && !callBack.isGridLayout) { if (item.image.isNullOrBlank() && !callBack.isGridLayout) {
imageView.gone() imageView.gone()
} else { } else {
ImageLoader.load(context, item.image).apply { ImageLoader.load(context, item.image, item.origin).apply {
if (callBack.isGridLayout) { if (callBack.isGridLayout) {
placeholder(R.drawable.image_rss_article) placeholder(R.drawable.image_rss_article)
} else { } else {

@ -36,7 +36,7 @@ class RssArticlesAdapter2(context: Context, callBack: CallBack) :
if (item.image.isNullOrBlank() && !callBack.isGridLayout) { if (item.image.isNullOrBlank() && !callBack.isGridLayout) {
imageView.gone() imageView.gone()
} else { } else {
ImageLoader.load(context, item.image).apply { ImageLoader.load(context, item.image, item.origin).apply {
if (callBack.isGridLayout) { if (callBack.isGridLayout) {
placeholder(R.drawable.image_rss_article) placeholder(R.drawable.image_rss_article)
} else { } else {

@ -35,7 +35,7 @@ class RssFavoritesAdapter(context: Context, val callBack: CallBack) :
if (item.image.isNullOrBlank()) { if (item.image.isNullOrBlank()) {
imageView.gone() imageView.gone()
} else { } else {
ImageLoader.load(context, item.image) ImageLoader.load(context, item.image, item.origin)
.addListener(object : RequestListener<Drawable> { .addListener(object : RequestListener<Drawable> {
override fun onLoadFailed( override fun onLoadFailed(
e: GlideException?, e: GlideException?,

Loading…
Cancel
Save