diff options
author | Allan Wang <allanwang@google.com> | 2019-07-27 17:56:41 -0700 |
---|---|---|
committer | Allan Wang <allanwang@google.com> | 2019-07-27 17:56:41 -0700 |
commit | 99f1e76a4d8d35d4d3ca1aadf68bbc227a70ba01 (patch) | |
tree | 2910c610362ca7e94c69ea7ae949aa1f1616ca42 /fastadapter | |
parent | 50c8012e2fe88d6b275d1a3269033590962caa7f (diff) | |
download | kau-99f1e76a4d8d35d4d3ca1aadf68bbc227a70ba01.tar.gz kau-99f1e76a4d8d35d4d3ca1aadf68bbc227a70ba01.tar.bz2 kau-99f1e76a4d8d35d4d3ca1aadf68bbc227a70ba01.zip |
Migrate some items
Diffstat (limited to 'fastadapter')
-rw-r--r-- | fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/CardIItem.kt | 6 | ||||
-rw-r--r-- | fastadapter/src/main/kotlin/ca/allanwang/kau/iitems/HeaderIItem.kt | 2 |
2 files changed, 4 insertions, 4 deletions
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<CardIItem, CardIItem.ViewHolder>( +) : KauIItem< CardIItem.ViewHolder>( R.layout.kau_iitem_card, ::ViewHolder, R.id.kau_item_card ), ThemableIItem by ThemableIItemDelegate() { companion object { fun bindClickEvents(fastAdapter: FastAdapter<IItem<*>>) { - fastAdapter.withEventHook(object : ClickEventHook<IItem<*>>() { + fastAdapter.addEventHook(object : ClickEventHook<IItem<*>>() { override fun onBindMany(viewHolder: RecyclerView.ViewHolder): List<View>? { return if (viewHolder is ViewHolder) listOf(viewHolder.card, viewHolder.button) else null } - override fun onClick(v: View, position: Int, adapter: FastAdapter<IItem<*>>, item: IItem<*>) { + override fun onClick(v: View, position: Int, fastAdapter: FastAdapter<IItem<*>>, 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<HeaderIItem, HeaderIItem.ViewHolder>( +) : KauIItem<HeaderIItem.ViewHolder>( R.layout.kau_iitem_header, { ViewHolder(it) }, R.id.kau_item_header_big_margin_top ), ThemableIItem by ThemableIItemDelegate() { |