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.AudiocodeBean;
import com.easygbs.easygbd.viewadapter.CommonAdapter;
import com.easygbs.easygbd.viewadapter.ViewHolder;

import java.util.List;

public class AudiocodeAdapter extends CommonAdapter<AudiocodeBean> {
    public String TAG= AudiocodeAdapter.class.getSimpleName();
    private Context context;
    private MainActivity mMainActivity;
    public List<AudiocodeBean> AudiocodeBeanList;

    public AudiocodeAdapter(Context context, MainActivity mMainActivity, int layoutId, List<AudiocodeBean> AudiocodeBeanList) {
        super(context, layoutId, AudiocodeBeanList);
        this.context = context;
        this.mMainActivity=mMainActivity;
        this.AudiocodeBeanList=AudiocodeBeanList;
    }

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

        int isst=mAudiocodeBean.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));
        }
    }
}