package com.example.applock.lockadapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class ViewPaperAdapter extends FragmentPagerAdapter {

    private List<Fragment> fmlist;
    private String[] tabtitle;
    public ViewPaperAdapter(FragmentManager supportFragmentManager, List<Fragment> fragmentList, String[] tabTitle) {
        super(supportFragmentManager);
        fmlist = fragmentList;
        tabtitle = tabTitle;

    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fmlist.get(position);
    }

    @Override
    public int getCount() {
        return fmlist.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return tabtitle[position];
    }
}
