package com.wd.workoffice.ui.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.FlowBean;

import java.util.List;

import androidx.annotation.Nullable;

/**
 * Created by flexible on 2018/8/13.
 */

public class ContactsMoneyFlowAdapter extends BaseQuickAdapter<FlowBean.RecordsBean, BaseViewHolder> {
    int type;

    public ContactsMoneyFlowAdapter(int layoutResId, List data) {
        super(layoutResId, data);
    }

    public ContactsMoneyFlowAdapter(int layoutResId, @Nullable List<FlowBean.RecordsBean> data, int type) {
        super(layoutResId, data);
        this.type = type;
    }

    @Override
    protected void convert(BaseViewHolder helper, FlowBean.RecordsBean item) {
        helper.setText(R.id.tv_price, String.valueOf(item.getMoney()));
        helper.setText(R.id.tv_time, item.getCreatedTime());
        helper.setText(R.id.tv_desc, item.getLinkSerialNumber());
        helper.setText(R.id.tv_dep, item.getInvoiceTypeName());
        if (type == 3) {
            helper.setText(R.id.tv_desc, item.getCauseText());
        }
    }
}

