package com.example.prettywallpapers.prettyadapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.example.prettywallpapers.fragment.HomeFragment;
import com.example.prettywallpapers.fragment.CategoryFragment;
import com.example.prettywallpapers.fragment.LikeFragment;

public class FragmentAdapter extends FragmentStateAdapter {
    public FragmentAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        switch (position){
            case 0:
                return new HomeFragment();
            case 1:
                return new CategoryFragment();
            default:
                return new LikeFragment();
        }
    }

    @Override
    public int getItemCount() {
        return 3;
    }
}
