Class ViewPagerAdapter
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder>
com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter
public class ViewPagerAdapter
extends RecyclerView.Adapter<com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder>
A
RecyclerView.Adapter
to show different views as pages.
It will be used internally to add dummy views inside the view pager.
-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
RecyclerView.Adapter.StateRestorationPolicy
-
Constructor Summary
ConstructorDescriptionViewPagerAdapter
(int pageCount) Constructor to initialize an object of this class. -
Method Summary
Modifier and TypeMethodDescriptionint
void
onBindViewHolder
(com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder holder, int position) com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder
onCreateViewHolder
(ViewGroup parent, int viewType) Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, findRelativeAdapterPositionIn, getItemId, getItemViewType, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, setStateRestorationPolicy, unregisterAdapterDataObserver
-
Constructor Details
-
ViewPagerAdapter
public ViewPagerAdapter(int pageCount) Constructor to initialize an object of this class.- Parameters:
pageCount
- The item count for this adapter.
-
-
Method Details
-
onCreateViewHolder
@NonNull public com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) - Specified by:
onCreateViewHolder
in classRecyclerView.Adapter<com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder>
-
getItemCount
public int getItemCount()- Specified by:
getItemCount
in classRecyclerView.Adapter<com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder>
-