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

import java.util.List;

public class AudiochannelAdapter extends CommonAdapter<AudiochannelBean> {
    public String TAG= AudiochannelAdapter.class.getSimpleName();
    private Context context;
    private MainActivity mMainActivity;
    public List<AudiochannelBean> AudiochannelBeanList;

    public AudiochannelAdapter(Context context, MainActivity mMainActivity, int layoutId, List<AudiochannelBean> AudiochannelBeanList){
        super(context, layoutId, AudiochannelBeanList);
        this.context = context;
        this.mMainActivity=mMainActivity;
        this.AudiochannelBeanList=AudiochannelBeanList;
    }

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

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