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.LoglevelBean;
import com.easygbs.easygbd.viewadapter.CommonAdapter;
import com.easygbs.easygbd.viewadapter.ViewHolder;
import java.util.List;

public class LoglevelAdapter extends CommonAdapter<LoglevelBean> {
    public String TAG= LoglevelAdapter.class.getSimpleName();
    private Context context;
    private MainActivity mMainActivity;
    public List<LoglevelBean> LoglevelBeanList;

    public LoglevelAdapter(Context context, MainActivity mMainActivity, int layoutId, List<LoglevelBean> LoglevelBeanList) {
        super(context, layoutId,LoglevelBeanList);
        this.context = context;
        this.mMainActivity=mMainActivity;
        this.LoglevelBeanList=LoglevelBeanList;
    }

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

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