|
|
@ -5,7 +5,6 @@ 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.SearchBook |
|
|
|
import io.legado.app.data.entities.SearchBook |
|
|
|
import io.legado.app.help.ImageLoader |
|
|
|
|
|
|
|
import kotlinx.android.synthetic.main.item_cover.view.* |
|
|
|
import kotlinx.android.synthetic.main.item_cover.view.* |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
|
|
|
|
|
|
|
@ -14,12 +13,7 @@ class CoverAdapter(context: Context, val callBack: CallBack) : |
|
|
|
|
|
|
|
|
|
|
|
override fun convert(holder: ItemViewHolder, item: SearchBook, payloads: MutableList<Any>) { |
|
|
|
override fun convert(holder: ItemViewHolder, item: SearchBook, payloads: MutableList<Any>) { |
|
|
|
with(holder.itemView) { |
|
|
|
with(holder.itemView) { |
|
|
|
item.coverUrl?.let { |
|
|
|
iv_cover.load(item.coverUrl, item.name) |
|
|
|
ImageLoader.load(context, it) |
|
|
|
|
|
|
|
.error(R.drawable.image_cover_default) |
|
|
|
|
|
|
|
.centerCrop() |
|
|
|
|
|
|
|
.into(iv_cover) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tv_source.text = item.originName |
|
|
|
tv_source.text = item.originName |
|
|
|
onClick { |
|
|
|
onClick { |
|
|
|
callBack.changeTo(item.coverUrl!!) |
|
|
|
callBack.changeTo(item.coverUrl!!) |
|
|
|