diff --git a/app/src/main/java/com/skydoves/disneymotions/view/viewholder/BindingLazy.kt b/app/src/main/java/com/skydoves/disneymotions/view/viewholder/BindingLazy.kt index 4fe71a8..70f1810 100644 --- a/app/src/main/java/com/skydoves/disneymotions/view/viewholder/BindingLazy.kt +++ b/app/src/main/java/com/skydoves/disneymotions/view/viewholder/BindingLazy.kt @@ -16,11 +16,11 @@ package com.skydoves.disneymotions.view.viewholder -import android.view.View import androidx.databinding.DataBindingUtil import androidx.databinding.ViewDataBinding +import com.skydoves.baserecyclerviewadapter.BaseViewHolder -inline fun bindings(view: View): Lazy = +inline fun BaseViewHolder.bindings(): Lazy = lazy(LazyThreadSafetyMode.NONE) { - requireNotNull(DataBindingUtil.bind(view)) { "cannot find the matched view to layout." } + requireNotNull(DataBindingUtil.bind(itemView)) { "cannot find the matched view to layout." } } diff --git a/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterCircleViewHolder.kt b/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterCircleViewHolder.kt index 9160277..d9fce0f 100644 --- a/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterCircleViewHolder.kt +++ b/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterCircleViewHolder.kt @@ -26,7 +26,7 @@ import com.skydoves.disneymotions.view.ui.details.PosterDetailActivity class PosterCircleViewHolder(view: View) : BaseViewHolder(view) { private lateinit var data: Poster - private val binding: ItemPosterCircleBinding by bindings(view) + private val binding: ItemPosterCircleBinding by bindings() override fun bindData(data: Any) { if (data is Poster) { diff --git a/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterLineViewHolder.kt b/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterLineViewHolder.kt index 2d01516..dd5ac34 100644 --- a/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterLineViewHolder.kt +++ b/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterLineViewHolder.kt @@ -26,7 +26,7 @@ import com.skydoves.disneymotions.view.ui.details.PosterDetailActivity class PosterLineViewHolder(view: View) : BaseViewHolder(view) { private lateinit var data: Poster - private val binding: ItemPosterLineBinding by bindings(view) + private val binding: ItemPosterLineBinding by bindings() override fun bindData(data: Any) { if (data is Poster) { diff --git a/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterViewHolder.kt b/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterViewHolder.kt index 4e22003..8e5cd85 100644 --- a/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterViewHolder.kt +++ b/app/src/main/java/com/skydoves/disneymotions/view/viewholder/PosterViewHolder.kt @@ -26,7 +26,7 @@ import com.skydoves.disneymotions.view.ui.details.PosterDetailActivity class PosterViewHolder(view: View) : BaseViewHolder(view) { private lateinit var data: Poster - private val binding: ItemPosterBinding by bindings(view) + private val binding: ItemPosterBinding by bindings() override fun bindData(data: Any) { if (data is Poster) {