diff --git a/app/src/main/java/io/legado/app/ui/changecover/CoverAdapter.kt b/app/src/main/java/io/legado/app/ui/changecover/CoverAdapter.kt index 93dc6252b..408acbeb4 100644 --- a/app/src/main/java/io/legado/app/ui/changecover/CoverAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/changecover/CoverAdapter.kt @@ -4,13 +4,22 @@ import android.content.Context import io.legado.app.R import io.legado.app.base.adapter.ItemViewHolder import io.legado.app.base.adapter.SimpleRecyclerAdapter -import io.legado.app.data.entities.Book +import io.legado.app.data.entities.SearchBook +import io.legado.app.help.ImageLoader +import kotlinx.android.synthetic.main.item_cover.view.* +class CoverAdapter(context: Context) : + SimpleRecyclerAdapter(context, R.layout.item_cover) { -class CoverAdapter(context: Context) : SimpleRecyclerAdapter(context, R.layout.item_cover) { - - override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList) { - + override fun convert(holder: ItemViewHolder, item: SearchBook, payloads: MutableList) { + with(holder.itemView) { + item.coverUrl?.let { + ImageLoader.load(context, it) + .centerCrop() + .into(iv_cover) + } + tv_source.text = item.originName + } } } \ No newline at end of file