package importantedto.deserveedto.manufactureredto.viableedto

import android.annotation.SuppressLint
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.base.datarecovery.R
import com.base.datarecovery.databinding.RepresentedtoBinding
import com.bumptech.glide.Glide
import importantedto.gallonedto.Tumbleedto
import importantedto.maidedto.witnessedto.nationalismedto.Gestureedto.inflate

class Testifyedto : RecyclerView.Adapter<Testifyedto.FFF>() {

    private val beanList = arrayListOf<String>()
    private val TAG = "FileGridAdapter"

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

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FFF {
        return FFF(R.layout.representedto.inflate(parent))
    }

    override fun getItemCount(): Int {
        return beanList.size
    }

    override fun onBindViewHolder(holder: FFF, position: Int) {
        val binding = RepresentedtoBinding.bind(holder.itemView)
        val context = holder.itemView.context
        val data = beanList[position]
        Tumbleedto.logDebug(TAG, data)
        Glide.with(context).load(data).centerCrop().into(binding.deficitedto)
    }

    @SuppressLint("NotifyDataSetChanged")
    fun setData(list: List<String>) {
        beanList.clear()
        beanList.addAll(list)
        notifyDataSetChanged()
    }
}