package com.base.scanqrclear.ui.main

import android.content.Context
import android.view.ViewGroup
import android.widget.ImageView
import androidx.fragment.app.Fragment
import com.base.scanqrclear.R
import com.base.scanqrclear.base.goToAc
import com.base.scanqrclear.databinding.ItemHeadCreateBinding
import com.base.scanqrclear.ui.adapter.CommonViewHolder
import com.base.scanqrclear.utils.XmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter

class HeadAdapter(
    val fragment: Fragment
) : BaseQuickAdapter<Any, CommonViewHolder>() {
     var guideIv: ImageView? = null
    override fun onBindViewHolder(holder: CommonViewHolder, position: Int, item: Any?) {
        item ?: return
        val binding = ItemHeadCreateBinding.bind(holder.itemView)
        guideIv = binding.ivScan
        binding.tvLogo.setOnClickListener {
            fragment.goToAc(ScanAc::class.java)
        }
    }

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


}