package com.dahe.gldriver.adapter

import android.content.Context
import android.view.ViewGroup
import android.widget.Button
import android.widget.LinearLayout
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.gldriver.R
import com.dahe.gldriver.bean.CarBean
import com.dahe.glex.bean.WayBillBean

/**
 * @ClassName WaybillAdapter
 * @Author 用户
 * @Date 2024/1/23 16:27
 * @Description TODO
 */
class SelectCarAdapter :
    BaseQuickAdapter<CarBean, QuickViewHolder>() {
    override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: CarBean?) {
        holder.run {
            setText(R.id.tvCarNum, item?.vehicleNum)
            setText(R.id.tvCarType, """${item?.vehicleType}""")
            setText(R.id.tvCarLen, """车长:${item?.carLong}""")
            setText(R.id.tvCarWei, """核定载重:${item?.approvedLoad}""")
            setSelected(R.id.llContent, item?.isSelect!!)
        }
    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): QuickViewHolder {
        // 返回一个 ViewHolder
        return QuickViewHolder(R.layout.item_car, parent)
    }
}