package com.auto.clicker.autoclicker.ui.adapter.menu;

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

import com.auto.clicker.autoclicker.ui.fragment.menu.HowMultiFragment;
import com.auto.clicker.autoclicker.ui.fragment.menu.HowSingleFragment;

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

public class HowAdapter extends FragmentStateAdapter {
    private final List<Fragment> fragmentList;

    public HowAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
        fragmentList = new ArrayList<>();
        fragmentList.add(new HowSingleFragment());
        fragmentList.add(new HowMultiFragment());
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getItemCount() {
        return fragmentList.size();
    }
}
