package com.mytatvarnsdk.adapter;

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

import java.util.ArrayList;

/**
 * Created by minyuchun on 2019/11/27.
 * @author minyuchun
 */

public class AdapterFragment extends FragmentPagerAdapter{

    private ArrayList<Fragment> mFragments = new ArrayList<>();

    public AdapterFragment(FragmentManager fm, ArrayList<Fragment> fragments) {
        super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
        mFragments = fragments;
    }

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

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