package com.ycgis.macall.personalcenter.v.adapter;

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

import com.rs.macall.androidx.basemodel.base.BaseViewBindFragment;
import com.ycgis.macall.personalcenter.p.callback.OnFragmentOnClickListener;
import com.ycgis.macall.personalcenter.v.fragment.EmptyFragment;
import com.ycgis.macall.personalcenter.v.fragment.Home2Fragment;
import com.ycgis.macall.personalcenter.v.fragment.HomeFragment;
import com.ycgis.macall.personalcenter.v.fragment.MessageFragment;
import com.ycgis.macall.personalcenter.v.fragment.MyFragment;
import com.ycgis.macall.personalcenter.v.fragment.WorkbenchFragment;

import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * created by:   Macall
 * create time:  2023/10/25 17:11
 * copyright:    @ruansee.com
 * Describe:
 */
public class MainFragmentAdapter extends FragmentStateAdapter {


    public MainFragmentAdapter(@NonNull @NotNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }


    @NonNull
    @NotNull
    @Override
    public BaseViewBindFragment createFragment(int position) {
        if (position == 0){
            return Home2Fragment.newInstance("", "");
        }else
        if (position == 1){
            return MessageFragment.newInstance();
        }else
        if (position == 2){
            return WorkbenchFragment.newInstance();
        }else
        if (position == 3){
            return MyFragment.newInstance();
        }
        return EmptyFragment.newInstance("","");
    }

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