package com.team.app.controllers;

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

import com.team.app.fragment.CodesFragment;
import com.team.app.fragment.PreviewFragment;
import com.team.app.fragment.TeamFragment;

public class GamePagerController extends FragmentPagerAdapter {

    private final int tabCount;

    public GamePagerController(FragmentManager fragmentManager,int theme, int i) {
        super(fragmentManager,theme);
        this.tabCount = i;
    }

    @NonNull
    public Fragment getItem(int i) {
        if (i == 0) {
            return new PreviewFragment();
        }
        if (i == 1) {
            return new CodesFragment();
        }
        if (i != 2) {
            return null;
        }
        return new TeamFragment();
    }

    public int getCount() {
        return this.tabCount;
    }
}
