From 955643f7c42603153ff69b4e4bb6a5ed7c9de96b Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 20 Oct 2019 02:15:24 -0700 Subject: Use view binding for sample checkbox and fix pref header --- .../main/kotlin/ca/allanwang/fastadapter/viewbinding/BindingItem.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fastadapter-viewbinding/src/main/kotlin/ca') 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(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 } -- cgit v1.2.3