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.StockFlowBean;
import com.wd.workoffice.util.MathUtils;

import java.util.List;

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

public class WorkStockDetailFlowAdapter extends BaseQuickAdapter<StockFlowBean.RecordsBean, BaseViewHolder> {

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

    @Override
    protected void convert(BaseViewHolder helper, StockFlowBean.RecordsBean item) {
        helper.setText(R.id.tv_name, item.getLinkSerialNumber());
        helper.setText(R.id.tv_move,  MathUtils.converData(item.getQuantity(),3));
        helper.setText(R.id.tv_balance, MathUtils.converData(item.getAfterOver(),3));
        helper.setText(R.id.tv_time, item.getCreatedTime());
        helper.setText(R.id.tv_flow_type, item.getTypeName());
        helper.addOnClickListener(R.id.tv_flow);
    }
}

