package com.dahe.mylibrary.adapter;

import android.widget.CheckBox;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dahe.mylibrary.R;
import com.dahe.mylibrary.bean.CarBean;
import com.dahe.mylibrary.bean.NodeBean;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class CarAdapter extends BaseQuickAdapter<CarBean, BaseViewHolder> {

    public CarAdapter(int layoutResId, @Nullable List<CarBean> data) {
        super(R.layout.item_car_select, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder helper, CarBean item) {
        helper.setText(R.id.tv_title, item.getVehicle())
                .setText(R.id.tv_lxr, "司机信息:"+item.getDriverName() + "  " + item.getDriverPhone())
                .setText(R.id.tv_zz, "载重(Kg):"+item.getApprovedLoad())
                .setText(R.id.tv_ckg, "长宽高(毫米):"+item.getOutlineLong()+"*"+item.getOutlineWide()+"*"+item.getOutlineHigh());
        CheckBox cb = helper.getView(R.id.cb);
        cb.setChecked(item.isSelect());
    }
}
