package com.example.administrator.zhapp.fragment.sbxdjgl;

import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import com.example.administrator.zhapp.R;
import com.example.administrator.zhapp.activity.sbxdjgl.SqdActivity;
import com.example.administrator.zhapp.adapter.QdjlAdapter;
import com.example.administrator.zhapp.entity.QdjuInfo;
import com.example.administrator.zhapp.fragment.BaseFragment;
import java.util.ArrayList;
import java.util.List;

/**
 * 设备巡点检管理-签点记录
 */
public class QianDjlFragment extends BaseFragment {

    ListView lv;
    private SqdActivity mActivity;
    private View headView;
    private List<QdjuInfo> list;
    private QdjlAdapter adapter;

    public QianDjlFragment() {
    }

    public static QianDjlFragment newInstance() {
        QianDjlFragment fragment = new QianDjlFragment();
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public int getContentViewId() {
        return R.layout.fragment_qian_djl;
    }

    @Override
    protected void initView() {
        mActivity = (SqdActivity) getActivity();
        lv = (ListView) view.findViewById(R.id.lv);
        headView = View.inflate(context, R.layout.qdjl_item, null);
        headView.findViewById(R.id.head).setVisibility(View.VISIBLE);
    }

    public void initData() {

        list = new ArrayList<>();
        QdjuInfo info = new QdjuInfo(1, "A级质检员", "黄庆辉");
        QdjuInfo info1 = new QdjuInfo(2, "B级质检员", "薛东");
        QdjuInfo info2 = new QdjuInfo(3, "C级质检员", "陈嘉");
        QdjuInfo info3 = new QdjuInfo(4, "监理工程师", "苏红");
        list.add(info);
        list.add(info1);
        list.add(info2);
        list.add(info3);
        adapter = new QdjlAdapter(context, list);
        lv.addHeaderView(headView, null, false);
        lv.setAdapter(adapter);
    }
}
