package com.sjkj.appthreefloor_tsgz.adapter;

import android.content.Context;
import android.graphics.Color;

import com.sjkj.appthreefloor_tsgz.R;
import com.sjkj.appthreefloor_tsgz.bean.EventDetailsBean;
import com.sjkj.appthreefloor_tsgz.databinding.ItemDetailsListBinding;
import com.sjkj.base_lib.adapter.BaseRecAdapter;

import java.util.List;

public class EventDetailsAdapter extends BaseRecAdapter<EventDetailsBean.DeptsBean, ItemDetailsListBinding> {

    public EventDetailsAdapter(Context context) {
        super(context);
    }

    public EventDetailsAdapter(Context context, List<EventDetailsBean.DeptsBean> list) {
        super(context, list);
    }

    @Override
    protected int getLayoutResId(int viewType) {
        return R.layout.item_details_list;
    }

    @Override
    protected void onBindItem(ItemDetailsListBinding binding, EventDetailsBean.DeptsBean bean, int position) {
        binding.setModel(bean);
        binding.executePendingBindings();
        if (position % 2 == 0) {
            binding.llTitleBackground.setBackgroundColor(Color.parseColor("#FFFFFF"));
        } else {
            binding.llTitleBackground.setBackgroundColor(Color.parseColor("#F7F7F7"));
        }
        if (bean.getStatus().equals("20")) {
            //待签收
            binding.tvStatus.setTextColor(Color.parseColor("#04BF60"));
            binding.tvStatus.setText("待签收");
        } else if (bean.getStatus().equals("30")) {
            //处理中
            binding.tvStatus.setText("处理中");
            binding.tvStatus.setTextColor(Color.parseColor("#409EFF"));
        } else if (bean.getStatus().equals("40")) {
            //办结
            binding.tvStatus.setText("办结");
            binding.tvStatus.setTextColor(Color.parseColor("#FF6A00"));
        } else if (bean.getStatus().equals("50")) {
            //归档
            binding.tvStatus.setText("归档");
            binding.tvStatus.setTextColor(Color.parseColor("#5D5DFF"));
        }

    }


}
