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.FragmentTransactionCallback

    Nested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter

    androidx.recyclerview.widget.RecyclerView.Adapter.StateRestorationPolicy
  • Constructor Summary

    Constructors
    Constructor
    Description
    AdminModePagerAdapter(androidx.fragment.app.FragmentActivity fragmentActivity)
    Constructor for AdminModePagerAdapter.
  • Method Summary

    Modifier and Type
    Method
    Description
    androidx.fragment.app.Fragment
    createFragment(int position)
    Creates and returns the appropriate fragment for the specified tab position.
    int
    Returns 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, unregisterFragmentTransactionCallback

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      createFragment in class androidx.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:
      getItemCount in class androidx.recyclerview.widget.RecyclerView.Adapter<androidx.viewpager2.adapter.FragmentViewHolder>
      Returns:
      The total number of admin tabs (5 in this case). Author: Pouyan