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 java.util.List;

import androidx.annotation.Nullable;

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

public class ProProcessAdapter extends BaseQuickAdapter<OrderDetail.OrderItemsBean.ItemFlowsBean, BaseViewHolder> {


    public ProProcessAdapter(int layoutResId, @Nullable List<OrderDetail.OrderItemsBean.ItemFlowsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderDetail.OrderItemsBean.ItemFlowsBean 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.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.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());
    }

}

