|
|
@ -1,6 +1,11 @@ |
|
|
|
package io.legado.app.ui.rss.article |
|
|
|
package io.legado.app.ui.rss.article |
|
|
|
|
|
|
|
|
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
|
|
|
|
import android.graphics.drawable.Drawable |
|
|
|
|
|
|
|
import com.bumptech.glide.load.DataSource |
|
|
|
|
|
|
|
import com.bumptech.glide.load.engine.GlideException |
|
|
|
|
|
|
|
import com.bumptech.glide.request.RequestListener |
|
|
|
|
|
|
|
import com.bumptech.glide.request.target.Target |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.base.adapter.ItemViewHolder |
|
|
|
import io.legado.app.base.adapter.ItemViewHolder |
|
|
|
import io.legado.app.base.adapter.SimpleRecyclerAdapter |
|
|
|
import io.legado.app.base.adapter.SimpleRecyclerAdapter |
|
|
@ -26,8 +31,30 @@ class RssArticlesAdapter(context: Context, val callBack: CallBack) : |
|
|
|
if (item.image.isNullOrBlank()) { |
|
|
|
if (item.image.isNullOrBlank()) { |
|
|
|
image_view.gone() |
|
|
|
image_view.gone() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
image_view.visible() |
|
|
|
|
|
|
|
ImageLoader.load(context, item.image) |
|
|
|
ImageLoader.load(context, item.image) |
|
|
|
|
|
|
|
.addListener(object : RequestListener<Drawable> { |
|
|
|
|
|
|
|
override fun onLoadFailed( |
|
|
|
|
|
|
|
e: GlideException?, |
|
|
|
|
|
|
|
model: Any?, |
|
|
|
|
|
|
|
target: Target<Drawable>?, |
|
|
|
|
|
|
|
isFirstResource: Boolean |
|
|
|
|
|
|
|
): Boolean { |
|
|
|
|
|
|
|
image_view.gone() |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onResourceReady( |
|
|
|
|
|
|
|
resource: Drawable?, |
|
|
|
|
|
|
|
model: Any?, |
|
|
|
|
|
|
|
target: Target<Drawable>?, |
|
|
|
|
|
|
|
dataSource: DataSource?, |
|
|
|
|
|
|
|
isFirstResource: Boolean |
|
|
|
|
|
|
|
): Boolean { |
|
|
|
|
|
|
|
image_view.visible() |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
.into(image_view) |
|
|
|
.into(image_view) |
|
|
|
} |
|
|
|
} |
|
|
|
if (item.read) { |
|
|
|
if (item.read) { |
|
|
|