fix:订阅源封面,icon的缺省headers的优先级:书源>全局
This commit is contained in:
@@ -28,7 +28,9 @@ object ImageLoader {
|
||||
}
|
||||
path.isAbsUrl() -> {
|
||||
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()
|
||||
GlideApp.with(context).load(url)
|
||||
}.getOrDefault(
|
||||
|
||||
@@ -27,7 +27,7 @@ class RssAdapter(context: Context, val callBack: CallBack) :
|
||||
) {
|
||||
binding.apply {
|
||||
tvName.text = item.sourceName
|
||||
ImageLoader.load(context, item.sourceIcon)
|
||||
ImageLoader.load(context, item.sourceIcon, item.sourceUrl)
|
||||
.centerCrop()
|
||||
.placeholder(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) {
|
||||
imageView.gone()
|
||||
} else {
|
||||
ImageLoader.load(context, item.image).apply {
|
||||
ImageLoader.load(context, item.image, item.origin).apply {
|
||||
if (callBack.isGridLayout) {
|
||||
placeholder(R.drawable.image_rss_article)
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ class RssArticlesAdapter1(context: Context, callBack: CallBack) :
|
||||
if (item.image.isNullOrBlank() && !callBack.isGridLayout) {
|
||||
imageView.gone()
|
||||
} else {
|
||||
ImageLoader.load(context, item.image).apply {
|
||||
ImageLoader.load(context, item.image, item.origin).apply {
|
||||
if (callBack.isGridLayout) {
|
||||
placeholder(R.drawable.image_rss_article)
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ class RssArticlesAdapter2(context: Context, callBack: CallBack) :
|
||||
if (item.image.isNullOrBlank() && !callBack.isGridLayout) {
|
||||
imageView.gone()
|
||||
} else {
|
||||
ImageLoader.load(context, item.image).apply {
|
||||
ImageLoader.load(context, item.image, item.origin).apply {
|
||||
if (callBack.isGridLayout) {
|
||||
placeholder(R.drawable.image_rss_article)
|
||||
} else {
|
||||
|
||||
@@ -35,7 +35,7 @@ class RssFavoritesAdapter(context: Context, val callBack: CallBack) :
|
||||
if (item.image.isNullOrBlank()) {
|
||||
imageView.gone()
|
||||
} else {
|
||||
ImageLoader.load(context, item.image)
|
||||
ImageLoader.load(context, item.image, item.origin)
|
||||
.addListener(object : RequestListener<Drawable> {
|
||||
override fun onLoadFailed(
|
||||
e: GlideException?,
|
||||
|
||||
Reference in New Issue
Block a user