package rallyedto.dumpedto.editionedto

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.SuperioredtoBinding
import com.bumptech.glide.Glide
import rallyedto.farewelledto.Strategicedto.inflate
import rallyedto.talledto.blewedto.Musicaledto

class Moodedto : RecyclerView.Adapter<Moodedto.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.superioredto.inflate(parent))
    }

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

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

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