package com.fun.airhornprank.adapter;

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

import com.fun.airhornprank.fragment.CustomFragment;
import com.fun.airhornprank.fragment.LikeFragment;
import com.fun.airhornprank.fragment.MainFragment;
import com.fun.airhornprank.fragment.RankingFragment;

import java.util.ArrayList;
import java.util.List;

public class PageAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> mlist = new ArrayList<>();

    public PageAdapter(@NonNull FragmentManager fm) {
        super(fm);
        mlist.add(new MainFragment());
        mlist.add(new CustomFragment());
        mlist.add(new RankingFragment());
        mlist.add(new LikeFragment());
    }

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

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