Package com.example.rocket_launch.admin
Class AdminModePagerAdapter
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<androidx.viewpager2.adapter.FragmentViewHolder>
androidx.viewpager2.adapter.FragmentStateAdapter
com.example.rocket_launch.admin.AdminModePagerAdapter
- All Implemented Interfaces:
androidx.viewpager2.adapter.StatefulAdapter
public class AdminModePagerAdapter
extends androidx.viewpager2.adapter.FragmentStateAdapter
Adapter used for displaying the different tabs in the admin interface.
Each tab corresponds to a specific admin management section.
Author: Pouyan
-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.viewpager2.adapter.FragmentStateAdapter
androidx.viewpager2.adapter.FragmentStateAdapter.ExperimentalFragmentStateAdapterApi, androidx.viewpager2.adapter.FragmentStateAdapter.FragmentTransactionCallbackNested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy -
Constructor Summary
ConstructorsConstructorDescriptionAdminModePagerAdapter(androidx.fragment.app.FragmentActivity fragmentActivity) Constructor for AdminModePagerAdapter. -
Method Summary
Modifier and TypeMethodDescriptionandroidx.fragment.app.FragmentcreateFragment(int position) Creates and returns the appropriate fragment for the specified tab position.intReturns the total number of tabs available in the admin interface.Methods inherited from class androidx.viewpager2.adapter.FragmentStateAdapter
containsItem, getItemId, onAttachedToRecyclerView, onBindViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewRecycled, registerFragmentTransactionCallback, restoreState, saveState, setHasStableIds, unregisterFragmentTransactionCallbackMethods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, findRelativeAdapterPositionIn, getItemViewType, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onBindViewHolder, onViewDetachedFromWindow, registerAdapterDataObserver, setStateRestorationPolicy, unregisterAdapterDataObserver
-
Constructor Details
-
AdminModePagerAdapter
public AdminModePagerAdapter(@NonNull androidx.fragment.app.FragmentActivity fragmentActivity) Constructor for AdminModePagerAdapter.- Parameters:
fragmentActivity- The activity that hosts the admin tabs. Author: Pouyan
-
-
Method Details
-
createFragment
@NonNull public androidx.fragment.app.Fragment createFragment(int position) Creates and returns the appropriate fragment for the specified tab position.- Specified by:
createFragmentin classandroidx.viewpager2.adapter.FragmentStateAdapter- Parameters:
position- The index of the selected tab.- Returns:
- The fragment corresponding to the tab. Author: Pouyan
-
getItemCount
public int getItemCount()Returns the total number of tabs available in the admin interface.- Specified by:
getItemCountin classandroidx.recyclerview.widget.RecyclerView.Adapter<androidx.viewpager2.adapter.FragmentViewHolder>- Returns:
- The total number of admin tabs (5 in this case). Author: Pouyan
-