From 99f1e76a4d8d35d4d3ca1aadf68bbc227a70ba01 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 27 Jul 2019 17:56:41 -0700 Subject: Migrate some items --- fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt | 6 +++--- fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'fastadapter') diff --git a/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt index 47c465c..f9f06b9 100644 --- a/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt +++ b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt @@ -46,18 +46,18 @@ import com.mikepenz.iconics.typeface.IIcon */ class CardIItem( val builder: Config.() -> Unit = {} -) : KauIItem( +) : KauIItem< CardIItem.ViewHolder>( R.layout.kau_iitem_card, ::ViewHolder, R.id.kau_item_card ), ThemableIItem by ThemableIItemDelegate() { companion object { fun bindClickEvents(fastAdapter: FastAdapter>) { - fastAdapter.withEventHook(object : ClickEventHook>() { + fastAdapter.addEventHook(object : ClickEventHook>() { override fun onBindMany(viewHolder: RecyclerView.ViewHolder): List? { return if (viewHolder is ViewHolder) listOf(viewHolder.card, viewHolder.button) else null } - override fun onClick(v: View, position: Int, adapter: FastAdapter>, item: IItem<*>) { + override fun onClick(v: View, position: Int, fastAdapter: FastAdapter>, item: IItem<*>) { if (item !is CardIItem) return with(item.configs) { when (v.id) { diff --git a/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt index 2c488b1..551cb59 100644 --- a/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt +++ b/fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt @@ -34,7 +34,7 @@ import ca.allanwang.kau.utils.string class HeaderIItem( text: String? = null, var textRes: Int = INVALID_ID -) : KauIItem( +) : KauIItem( R.layout.kau_iitem_header, { ViewHolder(it) }, R.id.kau_item_header_big_margin_top ), ThemableIItem by ThemableIItemDelegate() { -- cgit v1.2.3