package com.base.scanqrclear.ui.concatadapt

import android.content.Context
import android.view.ViewGroup
import com.base.scanqrclear.R
import com.base.scanqrclear.ads.AdsMgr
import com.base.scanqrclear.databinding.ItemAdBinding
import com.base.scanqrclear.ui.adapter.CommonViewHolder
import com.base.scanqrclear.utils.XmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter

class AdAdapter : BaseQuickAdapter<Any, CommonViewHolder>() {
    override fun onBindViewHolder(holder: CommonViewHolder, position: Int, item: Any?) {
        item ?: return
        val binding = ItemAdBinding.bind(holder.itemView)

        AdsMgr.showNative(binding.flAd,R.layout.layout_admob_item)
    }

    override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): CommonViewHolder {

        return CommonViewHolder(R.layout.item_ad.inflate(parent))
    }

}