package com.swiftcleaner.chovey.view.adapter;

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

import com.swiftcleaner.chovey.view.fragment.GuideEndFragment;
import com.swiftcleaner.chovey.view.fragment.GuideOneFragment;
import com.swiftcleaner.chovey.view.fragment.GuideThreeFragment;
import com.swiftcleaner.chovey.view.fragment.GuideTwoFragment;

/**
 * 作者：马海钊
 * 时间：2025/2/5 19:37
 * 功能：
 */
public class ViewPagerAdapter extends FragmentStatePagerAdapter {
    public ViewPagerAdapter(@NonNull FragmentManager fm, int behavior) {
        super(fm, behavior);
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0:
                return new GuideOneFragment();
            case 1:
                return new GuideTwoFragment();
            case 2:
                return new GuideThreeFragment();
            case 3:
                return new GuideEndFragment();
            default:
                return new GuideOneFragment();
        }
    }

    @Override
    public int getCount() {
        return 4; // 总共4个页面
    }
}
