package com.audio.record.screen.test.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.audio.record.screen.test.App
import com.audio.record.screen.test.base.BaseAdapter
import com.audio.record.screen.test.databinding.AdapterCropBinding
import com.audio.record.screen.test.databinding.AdapterThumbBinding
import com.bumptech.glide.Glide

class CropAdapter(context: Context, private var click: (cropRatio:String) -> Unit) :
    BaseAdapter<String, AdapterCropBinding>(context) {
    override fun getViewBinding(parent: ViewGroup?): AdapterCropBinding {
        return AdapterCropBinding.inflate(LayoutInflater.from(parent!!.context), parent, false)
    }

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
        val itemHolder: VHolder<AdapterCropBinding> = holder as VHolder<AdapterCropBinding>

        val item = data[position]
        with(itemHolder.vb.btn) {
            text = item
            setOnClickListener {
                click.invoke(item)
            }
        }


    }

}