package com.baoshi.swms.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import java.util.List;

/**
 * 运单调配适配器
 *
 * @author Zhendong Zhou
 * @date   2021/12/3 18:11
 */
public class WaybillDispatch extends FragmentStateAdapter {
    List<Fragment> fragmentList;

    public WaybillDispatch(@NonNull FragmentManager fragmentManager, @NonNull Lifecycle lifecycle,
                           List<Fragment> fragments) {
        super(fragmentManager, lifecycle);
        fragmentList = fragments;
    }
    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return fragmentList.get(position);
    }
    @Override
    public int getItemCount() {
        return fragmentList.size();
    }
}
