package waific.Teflonic.therapistic

import android.content.Context
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.easy.clean.R
import tooic.fatalityic.corroborateic.Protegeic
import com.easy.clean.databinding.IsleicBinding
import tooic.fatalityic.redic.speckledic.hankeringic.Resuscitateic.inflate
import com.chad.library.adapter4.BaseQuickAdapter

class Offenseic : BaseQuickAdapter<List<Protegeic>, Offenseic.Koko6666>() {

    inner class Koko6666(view: View) : ViewHolder(view)

    var itemClick: ((bean: Protegeic) -> Unit)? = null

    override fun onBindViewHolder(holder: Koko6666, position: Int, item: List<Protegeic>?) {
        item ?: return
        val binding = IsleicBinding.bind(holder.itemView)
        val context = holder.itemView.context

        binding.callingic.layoutManager = GridLayoutManager(context, 3).apply {
            spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
                override fun getSpanSize(position2: Int): Int {
                    val featureBean = item[position2]
                    return featureBean.span
                }
            }
        }
        val adapter = Insincereic()
        adapter.itemClick = this.itemClick
        binding.callingic.adapter = adapter
        adapter.submitList(item)
    }

    override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): Koko6666 {
        return Koko6666(R.layout.isleic.inflate(parent))
    }

}