Package com.xffffff.wellfed.navigation
Class NavigationCollectionAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<androidx.viewpager2.adapter.FragmentViewHolder>
-
- androidx.viewpager2.adapter.FragmentStateAdapter
-
- com.xffffff.wellfed.navigation.NavigationCollectionAdapter
-
- All Implemented Interfaces:
androidx.viewpager2.adapter.StatefulAdapter
public class NavigationCollectionAdapter extends androidx.viewpager2.adapter.FragmentStateAdapter
NavigationCollectionAdapter is the adapter for the navigation collection that handles the fragments for each tab in the bottom navigation bar
-
-
Constructor Summary
Constructors Constructor Description NavigationCollectionAdapter(androidx.fragment.app.FragmentActivity fa)
Constructor for the NavigationCollectionAdapter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description androidx.fragment.app.Fragment
createFragment(int position)
createFragment creates a new fragment for the tab at the given positionint
getItemCount()
getItemCount returns the number of tabs in the bottom navigation bar-
Methods inherited from class androidx.viewpager2.adapter.FragmentStateAdapter
containsItem, getItemId, onAttachedToRecyclerView, onBindViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewRecycled, restoreState, saveState, setHasStableIds
-
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onBindViewHolder, onViewDetachedFromWindow, registerAdapterDataObserver, unregisterAdapterDataObserver
-
-
-
-
Method Detail
-
createFragment
@NonNull public androidx.fragment.app.Fragment createFragment(int position)
createFragment creates a new fragment for the tab at the given position- Specified by:
createFragment
in classandroidx.viewpager2.adapter.FragmentStateAdapter
- Parameters:
position
- the position of the tab- Returns:
- the fragment for the tab at the given position
-
getItemCount
public int getItemCount()
getItemCount returns the number of tabs in the bottom navigation bar- Specified by:
getItemCount
in classandroidx.recyclerview.widget.RecyclerView.Adapter<androidx.viewpager2.adapter.FragmentViewHolder>
- Returns:
- the number of tabs in the bottom navigation bar
-
-