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.CricketFragment;
import com.team.app.fragment.FootballFragment;
import com.team.app.fragment.NewsFragment;

public class HomePagerController extends FragmentPagerAdapter {

    private final int tabCount;

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

    @NonNull
    public Fragment getItem(int i) {
        if (i == 0) {
            return new CricketFragment();
        }
        if (i == 1) {
            return new NewsFragment();
        }
        if (i != 2) {
            return null;
        }
        return new FootballFragment();
    }

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