|
|
@ -8,22 +8,17 @@ import io.legado.app.base.adapter.SimpleRecyclerAdapter |
|
|
|
import io.legado.app.data.entities.SearchBook |
|
|
|
import io.legado.app.data.entities.SearchBook |
|
|
|
import kotlinx.android.synthetic.main.item_search.view.* |
|
|
|
import kotlinx.android.synthetic.main.item_search.view.* |
|
|
|
|
|
|
|
|
|
|
|
class SearchAdapter(context: Context) : SimpleRecyclerAdapter<SearchBook>(context) { |
|
|
|
class SearchAdapter(context: Context) : SimpleRecyclerAdapter<SearchBook>(context, R.layout.item_search) { |
|
|
|
|
|
|
|
|
|
|
|
init { |
|
|
|
init { |
|
|
|
addItemViewDelegate(TestItemDelegate(context)) |
|
|
|
addItemViewDelegate(TestItemDelegate(context)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override val layoutID: Int |
|
|
|
|
|
|
|
get() = R.layout.item_search |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun convert(holder: ItemViewHolder, item: SearchBook, payloads: MutableList<Any>) { |
|
|
|
override fun convert(holder: ItemViewHolder, item: SearchBook, payloads: MutableList<Any>) { |
|
|
|
holder.itemView.bookName.text = "我欲封天" |
|
|
|
holder.itemView.bookName.text = "我欲封天" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
internal class TestItemDelegate(context: Context) : ItemViewDelegate<SearchBook>(context){ |
|
|
|
internal class TestItemDelegate(context: Context) : ItemViewDelegate<SearchBook>(context, R.layout.item_search) { |
|
|
|
override val layoutID: Int |
|
|
|
|
|
|
|
get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun convert(holder: ItemViewHolder, item: SearchBook, payloads: MutableList<Any>) { |
|
|
|
override fun convert(holder: ItemViewHolder, item: SearchBook, payloads: MutableList<Any>) { |
|
|
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates. |
|
|
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates. |
|
|
|