package com.base.browserwhite.ui.activity.search

import android.content.Context
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.base.browserwhite.R
import com.base.browserwhite.bean.SearchRecordBean
import com.base.browserwhite.databinding.ItemSearchrecordBinding
import com.base.browserwhite.utils.XmlEx.inflate
import com.chad.library.adapter4.BaseQuickAdapter

class SearchRecordAdapter : BaseQuickAdapter<SearchRecordBean, SearchRecordAdapter.SearchRecordViewHolder>() {
    inner class SearchRecordViewHolder(view: View) : ViewHolder(view) {

    }

    override fun onBindViewHolder(holder: SearchRecordViewHolder, position: Int, item: SearchRecordBean?) {
        if (item == null) return
        val binding = ItemSearchrecordBinding.bind(holder.itemView)
        binding.tvContent.text = item.content
    }

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