package com.dskj.daikuan.adapter;

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

import java.util.ArrayList;
import java.util.List;

public class GoodsAdapter extends FragmentStateAdapter {
    private ArrayList<String> listTitle;
    private List<Fragment> listFragment;


    public GoodsAdapter(@NonNull FragmentActivity fragmentActivity, ArrayList<String> listTitle, List<Fragment> listFragment) {
        super(fragmentActivity);
        this.listTitle = listTitle;
        this.listFragment = listFragment;
    }


    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return listFragment.get(position);
    }

    @Override
    public int getItemCount() {
        return listFragment.size();
    }

}