Class PunchcardAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<VH>
-
- com.cheetahdigital.uikit.widget.list.ListAdapter<D,VH>
-
- com.cheetahdigital.uikit.widget.list.EndlessListAndGridAdapter<PunchcardInstance,PunchcardViewHolder>
-
- com.cheetahdigital.punchcards.ui.list.PunchcardAdapter
-
public class PunchcardAdapter extends EndlessListAndGridAdapter<PunchcardInstance,PunchcardViewHolder>
The Adapter to be used for the list of Punchcards
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.cheetahdigital.uikit.widget.list.EndlessListAndGridAdapter
EndlessListAndGridAdapter.ProgressViewHolder, EndlessListAndGridAdapter.ReloadViewHolder
-
Nested classes/interfaces inherited from class com.cheetahdigital.uikit.widget.list.ListAdapter
ListAdapter.EmptyViewHolder
-
-
Field Summary
-
Fields inherited from class com.cheetahdigital.uikit.widget.list.EndlessListAndGridAdapter
VIEW_TYPE_PROGRESS, VIEW_TYPE_RELOAD
-
Fields inherited from class com.cheetahdigital.uikit.widget.list.ListAdapter
VIEW_TYPE_HEADER, VIEW_TYPE_NORMAL
-
-
Constructor Summary
Constructors Constructor Description PunchcardAdapter(java.util.List<PunchcardInstance> dataList)
Constructor for the PunchcardAdapter which accepts a list ofPunchcardInstance
objects and thePunchcardListener
that will dictate the action to be performed when items are clickedPunchcardAdapter(java.util.List<PunchcardInstance> dataList, PunchcardListener listener)
Constructor for the PunchcardAdapter which accepts a list ofPunchcardInstance
objects and thePunchcardListener
that will dictate the action to be performed when items are clicked
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bindNormalViewHolder(PunchcardViewHolder holder, int position)
Abstract method to bind the normal view holder.protected PunchcardViewHolder
createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Abstract method to create normal view holder.-
Methods inherited from class com.cheetahdigital.uikit.widget.list.EndlessListAndGridAdapter
getItemCount, getItemViewType, getReload, isAppending, isGridView, onBindViewHolder, onCreateViewHolder, setIsAppending, setIsGridView, setReload
-
Methods inherited from class com.cheetahdigital.uikit.widget.list.ListAdapter
addAll, addItem, addItem, clear, getDataList, getItemAt, getPlaceHolderResource, insertItems, isListEmpty, removeItem, replaceItemAt, setCustomEmptyMessageResource, setPlaceHolderResource, sort
-
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, getItemId, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
-
-
-
-
Constructor Detail
-
PunchcardAdapter
public PunchcardAdapter(java.util.List<PunchcardInstance> dataList)
Constructor for the PunchcardAdapter which accepts a list ofPunchcardInstance
objects and thePunchcardListener
that will dictate the action to be performed when items are clicked- Parameters:
dataList
- list ofPunchcardInstance
to be displayed
-
PunchcardAdapter
public PunchcardAdapter(java.util.List<PunchcardInstance> dataList, PunchcardListener listener)
Constructor for the PunchcardAdapter which accepts a list ofPunchcardInstance
objects and thePunchcardListener
that will dictate the action to be performed when items are clicked- Parameters:
dataList
- list ofPunchcardInstance
to be displayedlistener
- thePunchcardListener
for handling clicks on PunchcardInstance
-
-
Method Detail
-
createNormalViewHolder
protected PunchcardViewHolder createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Description copied from class:ListAdapter
Abstract method to create normal view holder.- Specified by:
createNormalViewHolder
in classListAdapter<PunchcardInstance,PunchcardViewHolder>
- Parameters:
parent
- used to get resourceviewType
- type of view- Returns:
- view holder for non special items
-
bindNormalViewHolder
protected void bindNormalViewHolder(PunchcardViewHolder holder, int position)
Description copied from class:ListAdapter
Abstract method to bind the normal view holder.- Specified by:
bindNormalViewHolder
in classListAdapter<PunchcardInstance,PunchcardViewHolder>
- Parameters:
holder
- view holder to vindSposition
- index of the item
-
-