From 592b25d7deae7b2cf0b053b3f4e3efca34ec71d3 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 5 Dec 2019 15:57:03 +0800 Subject: [PATCH] up --- .../legado/app/ui/changecover/CoverAdapter.kt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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