package com.easygbs.easygbd.adapter;
import android.content.Context;
import android.widget.TextView;
import com.easygbs.easygbd.R;
import com.easygbs.easygbd.activity.MainActivity;
import com.easygbs.easygbd.bean.SamplingrateBean;
import com.easygbs.easygbd.viewadapter.CommonAdapter;
import com.easygbs.easygbd.viewadapter.ViewHolder;
import java.util.List;

public class SamplingrateAdapter extends CommonAdapter<SamplingrateBean> {
    public String TAG= SamplingrateAdapter.class.getSimpleName();
    private Context context;
    private MainActivity mMainActivity;
    public List<SamplingrateBean> SamplingrateBeanList;

    public SamplingrateAdapter(Context context, MainActivity mMainActivity, int layoutId, List<SamplingrateBean> SamplingrateBeanList){
        super(context,layoutId,SamplingrateBeanList);
        this.context = context;
        this.mMainActivity=mMainActivity;
        this.SamplingrateBeanList=SamplingrateBeanList;
    }

    @Override
    protected void convert(ViewHolder holder, SamplingrateBean mSamplingrateBean, int position) {
        TextView tvName = holder.getView(R.id.tvname);
        String name=mSamplingrateBean.getName();
        tvName.setText(name);

        int isst=mSamplingrateBean.getIsst();
        if(isst==0){
            tvName.setTextColor(context.getResources().getColor(R.color.color_4d4d4d));
        }else if(isst==1){
            tvName.setTextColor(context.getResources().getColor(R.color.color_01c9a7));
        }
    }
}