package com.example.tampopo_client.views;

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

public class MyFragmentAdapter extends FragmentStateAdapter {

    public MyFragmentAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        if (position == 0) {
            // フラグメント①：申請を受けた
            return new FriendListFragment();
        } else {
            // フラグメント②：友達リスト
            return new FriendReceivedFragment();
        }
    }

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

