package com.dbs.mplus.fatima.adapter;

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

import java.util.ArrayList;

public class ViewPagerAdapter extends FragmentStatePagerAdapter {

  ArrayList<Fragment> mData = new ArrayList<Fragment>();

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

  public void addItem(Fragment item) {
    mData.add(item);
  }

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

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

