package com.exquisite.adapter;

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

import com.exquisite.fragment.LikeFragment;
import com.exquisite.fragment.MainFragment;
import com.exquisite.fragment.SettingFragment;

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

public class PageAdapter extends FragmentPagerAdapter {
    private final List<Fragment> list = new ArrayList<>();

    public PageAdapter(@NonNull FragmentManager fm) {
        super(fm);
        list.add(new MainFragment());
        list.add(new LikeFragment());
        list.add(new SettingFragment());

    }

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

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