package com.bbitcn.silk.adapter;

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

import com.bbitcn.silk.ui.fragment.QueryFragment;

/**
 * @Author：DuanKaiji
 */
public class PageAdapter extends FragmentStateAdapter {
    public PageAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @Override
    public Fragment createFragment(int position) {
        switch (position) {
            case 1:
            default:
                return new QueryFragment(3, 3,2);
            case 2:
                return new QueryFragment(3, 0,3);
        }

    }

    @Override
    public int getItemCount() {
        return 2;
    }

}