aboutsummaryrefslogtreecommitdiff
path: root/fastadapter-viewbinding/src/main/kotlin/ca
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-10-20 02:15:24 -0700
committerAllan Wang <me@allanwang.ca>2019-10-20 02:15:24 -0700
commit955643f7c42603153ff69b4e4bb6a5ed7c9de96b (patch)
tree296cfcfe95d3df1c8fa1d8ef022772d73cdf566f /fastadapter-viewbinding/src/main/kotlin/ca
parent302d3351e9866b71b1e525c0e5ba883fe022ba5c (diff)
downloadkau-955643f7c42603153ff69b4e4bb6a5ed7c9de96b.tar.gz
kau-955643f7c42603153ff69b4e4bb6a5ed7c9de96b.tar.bz2
kau-955643f7c42603153ff69b4e4bb6a5ed7c9de96b.zip
Use view binding for sample checkbox and fix pref header
Diffstat (limited to 'fastadapter-viewbinding/src/main/kotlin/ca')
-rw-r--r--fastadapter-viewbinding/src/main/kotlin/ca/allanwang/fastadapter/viewbinding/BindingItem.kt5
1 files changed, 3 insertions, 2 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 d40be3d..a475615 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
@@ -16,6 +16,7 @@
package ca.allanwang.fastadapter.viewbinding
import android.content.Context
+import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
@@ -45,10 +46,10 @@ abstract class BindingItem<Binding : ViewBinding>(open val data: Any?) :
override val type: Int
get() = layoutRes
- abstract fun createBinding(context: Context, parent: ViewGroup?): Binding
+ abstract fun createBinding(layoutInflater: LayoutInflater, parent: ViewGroup?): Binding
override fun createView(ctx: Context, parent: ViewGroup?): View {
- val binding = createBinding(ctx, parent)
+ val binding = createBinding(LayoutInflater.from(ctx), parent)
setBinding(binding.root, binding)
return binding.root
}