package com.example.administrator.zhapp.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;

import com.example.administrator.zhapp.entity.XwaqglInfo;

import java.util.List;

/**
 * 签点记录适配器
 */
public class XwaqAdapter extends BaseAdapter {

    private Context context;
    private List<XwaqglInfo.ItemInfo> list;

    public XwaqAdapter(Context context, List<XwaqglInfo.ItemInfo> list) {
        this.context = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public XwaqglInfo.ItemInfo getItem(int i) {
        return list.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        CheckBox cb = new CheckBox(context);
        cb.setText(getItem(i).getText());
        return cb;
    }
}
