pull/53/head
kunfei 5 years ago
parent 997b9a994a
commit 592b25d7de
  1. 19
      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<SearchBook>(context, R.layout.item_cover) {
class CoverAdapter(context: Context) : SimpleRecyclerAdapter<Book>(context, R.layout.item_cover) {
override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList<Any>) {
override fun convert(holder: ItemViewHolder, item: SearchBook, payloads: MutableList<Any>) {
with(holder.itemView) {
item.coverUrl?.let {
ImageLoader.load(context, it)
.centerCrop()
.into(iv_cover)
}
tv_source.text = item.originName
}
}
}
Loading…
Cancel
Save