package com.base.scanqrclear.luma

import android.view.LayoutInflater
import android.view.ViewGroup
import com.base.scanqrclear.databinding.ItemAppProcessBinding

class AppProcessAdapter : BaseAdapter<AppInfoBean, ItemAppProcessBinding>() {

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup
    ): ItemAppProcessBinding {
        return ItemAppProcessBinding.inflate(layoutInflater, parent, false)
    }

    override fun bind(
        holder: BaseViewHolder<ItemAppProcessBinding>,
        position: Int,
        item: AppInfoBean
    ) {
        holder.binding.tvName.text = item.appName
        holder.binding.ivIcon.setImageDrawable(item.icon)
        holder.binding.tvStop.setOnClickListener { callback?.onClicked(it, position, item) }
    }

}