package waific.Teflonic.therapistic

import android.annotation.SuppressLint
import android.content.Context
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.easy.clean.BuildConfig
import com.easy.clean.R
import com.easy.clean.databinding.FlapjackicBinding
import tooic.fatalityic.redic.speckledic.hankeringic.Resuscitateic.inflate
import com.chad.library.adapter4.BaseQuickAdapter
import kotlin.random.Random

class Quotaic : BaseQuickAdapter<Array<String>, Quotaic.AAA>() {

    var cleanClick: (() -> Unit)? = null

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

    @SuppressLint("SetTextI18n")
    override fun onBindViewHolder(holder: AAA, position: Int, item: Array<String>?) {
        item ?: return
        val binding = FlapjackicBinding.bind(holder.itemView)

        if (BuildConfig.DEBUG) {
            binding.undertakenic.text = "%.2f".format(Random.nextFloat() * Random.nextInt(1, 10))
            binding.turnic.text = "GB Found"
        }

        binding.unsuspectingic.text = item[0]
        binding.restic.text = item[1]


        binding.richlyic.setOnClickListener {
            cleanClick?.invoke()
        }
        binding.drinkeric.setOnClickListener {
            cleanClick?.invoke()
        }
    }

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


}