package com.zxhy.fastfilemanagerpro.kokomanager

import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.zxhy.fastfilemanagerpro.R
import com.zxhy.fastfilemanagerpro.databinding.ItemKokoImageBinding
import com.zxhy.fastfilemanagerpro.kokoadapter.CommonAdapter
import com.zxhy.fastfilemanagerpro.kokotools.GlideHelper.loadImageView
import com.zxhy.fastfilemanagerpro.kokotools.XmlEx.inflate

class KoRecentkoAdapter : CommonAdapter<KoRecentkoAdapter.KoRecentkoViewHolder>() {

    inner class KoRecentkoViewHolder(view: View) : ViewHolder(view) {
        val binding = ItemKokoImageBinding.bind(view)
    }

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

    override fun onBindViewHolder(holder: KoRecentkoViewHolder, position: Int) {
        val context = holder.binding.root.context
        val data = fileList[position]
        holder.binding.apply {
            iv.loadImageView(context, data.uri)
        }
    }


}