|
|
|
@ -30,11 +30,11 @@ class RssArticlesAdapter(context: Context, layoutId: Int, val callBack: CallBack |
|
|
|
|
if (item.image.isNullOrBlank() && !callBack.isGridLayout) { |
|
|
|
|
image_view.gone() |
|
|
|
|
} else { |
|
|
|
|
val imageLoader = ImageLoader.load(context, item.image) |
|
|
|
|
ImageLoader.load(context, item.image).apply { |
|
|
|
|
if (callBack.isGridLayout) { |
|
|
|
|
imageLoader.placeholder(R.drawable.image_rss_article) |
|
|
|
|
placeholder(R.drawable.image_rss_article) |
|
|
|
|
} else { |
|
|
|
|
imageLoader.addListener(object : RequestListener<Drawable> { |
|
|
|
|
addListener(object : RequestListener<Drawable> { |
|
|
|
|
override fun onLoadFailed( |
|
|
|
|
e: GlideException?, |
|
|
|
|
model: Any?, |
|
|
|
@ -58,7 +58,7 @@ class RssArticlesAdapter(context: Context, layoutId: Int, val callBack: CallBack |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
imageLoader.into(image_view) |
|
|
|
|
}.into(image_view) |
|
|
|
|
} |
|
|
|
|
if (item.read) { |
|
|
|
|
tv_title.textColorResource = R.color.tv_text_summary |
|
|
|
|