package com.sipai.jspatrol.Fault.adapter;

import android.content.Context;

import com.sipai.jspatrol.Bean.FaultFlow;
import com.sipai.jspatrol.R;
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;

import java.util.List;

/**
 * created by lvliming on 2020/12/14
 */
public class FaultFlowAdapter extends SuperBaseAdapter<FaultFlow> {
    private Context context;
    private List<FaultFlow> list;

    public FaultFlowAdapter(Context context, List<FaultFlow> data) {
        super(context, data);
        this.context = context;
        this.list = data;
    }

    @Override
    protected void convert(BaseViewHolder holder, FaultFlow item, int position) {
        item = list.get(position);
        holder.setText(R.id.moudle_item_fault_flow_tv_num,String.valueOf(position+1));
        holder.setText(R.id.moudle_item_fault_flow_tv_title,item.getTaskName());
        holder.setText(R.id.moudle_item_fault_flow_tv_content,item.getRecord());
        holder.setText(R.id.moudle_item_fault_flow_tv_time,item.getInsdt());
//        holder.setText(R.id.moudle_item_fault_flow_tv_num,String.valueOf(position+1));
    }

    @Override
    protected int getItemViewLayoutId(int position, FaultFlow item) {
        return R.layout.item_fault_flow;
    }
}
