|
|
@ -4,13 +4,22 @@ import android.content.Context |
|
|
|
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 |
|
|
|
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: SearchBook, payloads: MutableList<Any>) { |
|
|
|
|
|
|
|
with(holder.itemView) { |
|
|
|
override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList<Any>) { |
|
|
|
item.coverUrl?.let { |
|
|
|
|
|
|
|
ImageLoader.load(context, it) |
|
|
|
|
|
|
|
.centerCrop() |
|
|
|
|
|
|
|
.into(iv_cover) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tv_source.text = item.originName |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |