package com.rehome.meetingbook.adapter;

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

import com.rehome.meetingbook.bean.AppointmentDateDetailListBean;
import com.rehome.meetingbook.databinding.AdapterAppointmentDateBinding;
import com.rehome.meetingbook.databinding.AdapterContactBinding;

import java.util.List;

/**
 * Create By HuangWenFei
 * 创建日期：2022-12-21 09:30
 * 描述：
 */
public class AppointmentDateAdapter extends MyAdapter<AdapterAppointmentDateBinding>{

    private List<AppointmentDateDetailListBean.RowsBean> datas;

    public AppointmentDateAdapter(Context context, List<AppointmentDateDetailListBean.RowsBean> datas) {
        super(context);
        this.datas=datas;
    }

    @Override
    protected void handleData(int position, AdapterAppointmentDateBinding binding) {
        AppointmentDateDetailListBean.RowsBean item = datas.get(position);
        binding.tvDesc.setText(item.getPskssj_s()+" 至 "+item.getPskssj_e()+"共："+item.getRs()+"人，还可预约"+ item.getKyyrs() + "人");
    }

    @Override
    protected AdapterAppointmentDateBinding getBinding(LayoutInflater inflater, ViewGroup parent) {
        return AdapterAppointmentDateBinding.inflate(inflater, parent, false);
    }

    @Override
    public int getCount() {
        return datas.size();
    }

    @Override
    public Object getItem(int position) {
        return datas.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }
}
