package com.dahe.pass.adapter;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

/**
 * Created by Administrator on 2018/7/16 0016.
 */

public class MyHomePagerAdapter extends FragmentStatePagerAdapter {
    private String[] mTitles;
    private ArrayList<Fragment> mFragments = new ArrayList<>();

    public MyHomePagerAdapter(FragmentManager fm) {
        super(fm);
    }

    public MyHomePagerAdapter(FragmentManager fm, String[] mTitles, ArrayList<Fragment> mFragments) {
        super(fm);
        this.mTitles = mTitles;
        this.mFragments = mFragments;
    }

    // 初始化每个页卡选项
//    @Override
//    public Object instantiateItem(ViewGroup arg0, int arg1) {
//        // TODO Auto-generated method stub
//        node_return super.instantiateItem(arg0, arg1);
//    }

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

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }
}
