package com.wd.workoffice.ui.adapter;


import android.graphics.Color;

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

import java.util.List;

import androidx.annotation.Nullable;

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

public class ReturnHistoryAdapter extends BaseQuickAdapter<ReturnApplyBean.RecordsBean, BaseViewHolder> {


    public ReturnHistoryAdapter(int layoutResId, @Nullable List<ReturnApplyBean.RecordsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ReturnApplyBean.RecordsBean item) {
        if (helper.getAdapterPosition() == 0) {
            helper.setTextColor(R.id.tv_status, Color.parseColor("#ff359486"));
            helper.setTextColor(R.id.tv_time, Color.parseColor("#ff359486"));
            helper.setTextColor(R.id.tv_remark, Color.parseColor("#ff359486"));
            helper.setBackgroundRes(R.id.tv_dep, R.drawable.shape_green_btn);
            helper.setGone(R.id.iv_last, true);
            helper.setGone(R.id.iv_simple, false);
        } else {
            helper.setTextColor(R.id.tv_status, helper.getConvertView().getResources().getColor(R.color.flexible_text_gray));
            helper.setTextColor(R.id.tv_time, helper.getConvertView().getResources().getColor(R.color.flexible_text_gray));
            helper.setTextColor(R.id.tv_remark, helper.getConvertView().getResources().getColor(R.color.flexible_text_gray));
            helper.setBackgroundRes(R.id.tv_dep, R.drawable.shape_blue_btn);
            helper.setGone(R.id.iv_last, false);
            helper.setGone(R.id.iv_simple, true);
        }
//        helper.setText(R.id.tv_status, item.getOptUserName() + item.getEventCodeName());
//        helper.setText(R.id.tv_time, item.getCreatedTime());
//        helper.setText(R.id.tv_remark, "备注：" + item.getOptComment());
    }

}

