package com.tenlionsoft.oamodule.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
import com.tenlionsoft.oamodule.R;
import com.tenlionsoft.oamodule.beans.ByCarRecordBean;
import com.tenlionsoft.oamodule.holder.ByCarRecordHolder;

import java.util.List;

/**
 * 作者: adam
 * 日期: 2022/4/13 - 11:15 上午
 * 邮箱: itgaojian@163.com
 * 描述:
 */
public class ByCarRecordAdapter extends BaseRecyclerAdapter<ByCarRecordBean, ByCarRecordHolder> {

    public ByCarRecordAdapter(Context ctx, List<ByCarRecordBean> list) {
        super(ctx, list);
    }

    @Override
    public ByCarRecordHolder createHolder(ViewGroup parent, int viewType) {
        View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_by_car_record, parent, false);
        return new ByCarRecordHolder(itemView);
    }

    @Override
    public void bindHolder(ByCarRecordHolder holder, int i) {
        ByCarRecordBean bean = mData.get(i);
        holder.mTvCar.setText("车辆:" + bean.getCarApplyCarName());
        holder.mTvDriver.setText("驾驶员:" + bean.getCarApplyDriverName());
        holder.mTvStartTime.setText("开始时间:" + bean.getCarApplyStartTime());
        holder.mTvEndTime.setText("结束时间:" + bean.getCarApplyEndTime());
        holder.mTvPassenger.setText("乘车人:" + bean.getCarApplyPassengerNames());

    }
}
