Class DynamicRecyclerViewAdapter<VH extends RecyclerView.ViewHolder>
java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<VH>
com.pranavpandey.android.dynamic.support.recyclerview.adapter.DynamicRecyclerViewAdapter<VH>
- Type Parameters:
- VH- The type of the recycler view holder.
- Direct Known Subclasses:
- DynamicBinderAdapter,- DynamicPresetsAdapter
public abstract class DynamicRecyclerViewAdapter<VH extends RecyclerView.ViewHolder>
extends RecyclerView.Adapter<VH>
A 
RecyclerView.Adapter to display items in different sections.
 Each section can have a section header also.
Extend this adapter and implement DynamicRecyclerViewAdapter.DynamicRecyclerViewItem interface
 in the object class.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceImplement this interface in the object class to get item type and section header text.static @interfaceValid item types for this adapter.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intConstant for the type empty view.static final intConstant for the type item.static final intConstant for the type section divider.static final intConstant for the type section header.static final intConstant for the type item setting.static final intConstant for the type unknown.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the context associated with the recycler view.Returns the layout associated with the recycler view.Get the recycler view displaying this adapter.booleanChecks whether the recycler view associated with this adapter is computing layout.voidonAttachedToRecyclerView(RecyclerView recyclerView) Methods inherited from class androidx.recyclerview.widget.RecyclerView.AdapterbindViewHolder, createViewHolder, getItemCount, getItemId, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onBindViewHolder, onBindViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
- 
Field Details- 
TYPE_UNKNOWNpublic static final int TYPE_UNKNOWNConstant for the type unknown.- See Also:
 
- 
TYPE_EMPTY_VIEWpublic static final int TYPE_EMPTY_VIEWConstant for the type empty view.- See Also:
 
- 
TYPE_SECTION_HEADERpublic static final int TYPE_SECTION_HEADERConstant for the type section header.- See Also:
 
- 
TYPE_ITEMpublic static final int TYPE_ITEMConstant for the type item.- See Also:
 
- 
TYPE_SETTINGpublic static final int TYPE_SETTINGConstant for the type item setting.- See Also:
 
- 
TYPE_SECTION_DIVIDERpublic static final int TYPE_SECTION_DIVIDERConstant for the type section divider.- See Also:
 
 
- 
- 
Constructor Details- 
DynamicRecyclerViewAdapterpublic DynamicRecyclerViewAdapter()
 
- 
- 
Method Details- 
onAttachedToRecyclerView- Overrides:
- onAttachedToRecyclerViewin class- RecyclerView.Adapter<VH extends RecyclerView.ViewHolder>
 
- 
isComputingLayoutpublic boolean isComputingLayout()Checks whether the recycler view associated with this adapter is computing layout.- Returns:
- trueif the recycler view is computing layout.
 
- 
getRecyclerViewGet the recycler view displaying this adapter.- Returns:
- The recycler view displaying this adapter.
 
- 
getContextReturns the context associated with the recycler view.- Returns:
- The context associated with the recycler view.
 
- 
getLayoutManagerReturns the layout associated with the recycler view.- Returns:
- The layout associated with the recycler view.
 
 
-