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

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.setting.ActionFragment;
import com.auto.clicker.autoclicker.ui.fragment.setting.UISizeFragment;

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

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

    public SettingAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
        fragmentList = new ArrayList<>();
        fragmentList.add(new ActionFragment());
        fragmentList.add(new UISizeFragment());
    }

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

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