diff options
author | Allan Wang <me@allanwang.ca> | 2021-10-24 17:45:09 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-10-24 17:45:09 -0700 |
commit | 222709bc15ace77ebf03e5a8e17e0bf026520970 (patch) | |
tree | 802f80dc3e6956b9e8bdf15f4d265f3b863fa58d /fastadapter-viewbinding/src/main/kotlin | |
parent | 8c95d32ce4a82ec00590c428d163a3604b7d44ec (diff) | |
download | kau-222709bc15ace77ebf03e5a8e17e0bf026520970.tar.gz kau-222709bc15ace77ebf03e5a8e17e0bf026520970.tar.bz2 kau-222709bc15ace77ebf03e5a8e17e0bf026520970.zip |
Many version bumps
Diffstat (limited to 'fastadapter-viewbinding/src/main/kotlin')
-rw-r--r-- | fastadapter-viewbinding/src/main/kotlin/ca/allanwang/fastadapter/viewbinding/BindingItem.kt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fastadapter-viewbinding/src/main/kotlin/ca/allanwang/fastadapter/viewbinding/BindingItem.kt b/fastadapter-viewbinding/src/main/kotlin/ca/allanwang/fastadapter/viewbinding/BindingItem.kt index ff694f0..a289dc8 100644 --- a/fastadapter-viewbinding/src/main/kotlin/ca/allanwang/fastadapter/viewbinding/BindingItem.kt +++ b/fastadapter-viewbinding/src/main/kotlin/ca/allanwang/fastadapter/viewbinding/BindingItem.kt @@ -42,8 +42,8 @@ interface BindingLayout<Binding : ViewBinding> { } abstract class BindingItem<Binding : ViewBinding>(open val data: Any?) : - AbstractItem<BindingItem.ViewHolder>(), - BindingLayout<Binding> { + AbstractItem<BindingItem.ViewHolder>(), + BindingLayout<Binding> { override val type: Int get() = layoutRes @@ -81,7 +81,7 @@ abstract class BindingItem<Binding : ViewBinding>(open val data: Any?) : open fun Binding.unbindView(holder: ViewHolder) {} final override fun getViewHolder(v: View): ViewHolder = - ViewHolder(v, layoutRes) + ViewHolder(v, layoutRes) override fun failedToRecycle(holder: ViewHolder): Boolean { KL.e { "Failed to recycle" } @@ -97,7 +97,7 @@ abstract class BindingItem<Binding : ViewBinding>(open val data: Any?) : override fun hashCode(): Int = data.hashCode() class ViewHolder(itemView: View, internal val layoutRes: Int) : - RecyclerView.ViewHolder(itemView) { + RecyclerView.ViewHolder(itemView) { /** * Retrieves a binding. @@ -119,7 +119,7 @@ abstract class BindingItem<Binding : ViewBinding>(open val data: Any?) : } abstract class BindingClickEventHook<Binding : ViewBinding, Item : BindingItem<Binding>>(val identifier: BindingLayout<Binding>) : - ClickEventHook<Item>() { + ClickEventHook<Item>() { private fun RecyclerView.ViewHolder.binding(): Binding? { val holder = this as? BindingItem.ViewHolder ?: return null @@ -146,7 +146,7 @@ abstract class BindingClickEventHook<Binding : ViewBinding, Item : BindingItem<B } open fun Binding.onBindMany(viewHolder: RecyclerView.ViewHolder): List<View>? = - super.onBindMany(viewHolder) + super.onBindMany(viewHolder) final override fun onClick(v: View, position: Int, fastAdapter: FastAdapter<Item>, item: Item) { BindingItem.getBinding<Binding>(v).onClick(v, position, fastAdapter, item) |