package com.stm.asset.base;

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

import java.util.List;

/**
 * 类名称：FragPageAdapter
 * 类描述：Fragment页面适配器
 * 创建人：story
 * 创建时间：2021-12-07 16:41
 */
public class FragPageAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragmentsList;

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

    public FragPageAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragmentsList = fragments;
    }

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

    @NonNull
    @Override
    public Fragment getItem(int arg0) {
        return fragmentsList.get(arg0);
    }

    @Override
    public int getItemPosition(@NonNull Object object) {
        return super.getItemPosition(object);
    }
}
