From e2dd058430ef92c315b0e2fd59c88efa141e8944 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Sat, 28 Nov 2020 14:03:26 +0530 Subject: [PATCH] Use BindableItem in PickerIconItem. --- .../local/subscription/item/PickerIconItem.kt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/item/PickerIconItem.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/item/PickerIconItem.kt index 4f3678e95..11fc4833a 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/item/PickerIconItem.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/item/PickerIconItem.kt @@ -1,20 +1,25 @@ package org.schabi.newpipe.local.subscription.item import android.content.Context +import android.view.View import androidx.annotation.DrawableRes -import com.xwray.groupie.kotlinandroidextensions.GroupieViewHolder -import com.xwray.groupie.kotlinandroidextensions.Item -import kotlinx.android.synthetic.main.picker_icon_item.icon_view +import com.xwray.groupie.viewbinding.BindableItem import org.schabi.newpipe.R +import org.schabi.newpipe.databinding.PickerIconItemBinding import org.schabi.newpipe.local.subscription.FeedGroupIcon -class PickerIconItem(context: Context, val icon: FeedGroupIcon) : Item() { +class PickerIconItem( + context: Context, + val icon: FeedGroupIcon +) : BindableItem() { @DrawableRes val iconRes: Int = icon.getDrawableRes(context) override fun getLayout(): Int = R.layout.picker_icon_item - override fun bind(viewHolder: GroupieViewHolder, position: Int) { - viewHolder.icon_view.setImageResource(iconRes) + override fun bind(viewBinding: PickerIconItemBinding, position: Int) { + viewBinding.iconView.setImageResource(iconRes) } + + override fun initializeViewBinding(view: View) = PickerIconItemBinding.bind(view) }