Class AwardsAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<VH>
-
- com.cheetahdigital.uikit.widget.list.ListAdapter<D,VH>
-
- com.cheetahdigital.uikit.widget.list.EndlessListAdapter<Award,androidx.recyclerview.widget.RecyclerView.ViewHolder>
-
- com.cheetahdigital.rewards.ui.awards.AwardsAdapter
-
public class AwardsAdapter extends EndlessListAdapter<Award,androidx.recyclerview.widget.RecyclerView.ViewHolder>
The adapter forAwardsListFragment
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.cheetahdigital.uikit.widget.list.EndlessListAdapter
EndlessListAdapter.ProgressViewHolder, EndlessListAdapter.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.EndlessListAdapter
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 AwardsAdapter(java.util.List<Award> data)
Simple constructor with no ClickListenerAwardsAdapter(java.util.List<Award> data, ItemClickListener<Award> clickListener)
Constructor to use in creating the AwardsAdapter with a click listener
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bindNormalViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder holder, int position)
Abstract method to bind the normal view holder.protected androidx.recyclerview.widget.RecyclerView.ViewHolder
createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Abstract method to create normal view holder.-
Methods inherited from class com.cheetahdigital.uikit.widget.list.EndlessListAdapter
getItemCount, getItemViewType, getReload, isAppending, onBindViewHolder, onCreateViewHolder, setIsAppending, 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
-
AwardsAdapter
public AwardsAdapter(java.util.List<Award> data)
Simple constructor with no ClickListener- Parameters:
data
- list of awards to be shown on the list
-
AwardsAdapter
public AwardsAdapter(java.util.List<Award> data, ItemClickListener<Award> clickListener)
Constructor to use in creating the AwardsAdapter with a click listener- Parameters:
data
- list of awards to be shown on the listclickListener
- listener to handle item clicks on the list
-
-
Method Detail
-
createNormalViewHolder
protected androidx.recyclerview.widget.RecyclerView.ViewHolder createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Description copied from class:ListAdapter
Abstract method to create normal view holder.- Specified by:
createNormalViewHolder
in classListAdapter<Award,androidx.recyclerview.widget.RecyclerView.ViewHolder>
- Parameters:
parent
- used to get resourceviewType
- type of view- Returns:
- view holder for non special items
-
bindNormalViewHolder
protected void bindNormalViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder holder, int position)
Description copied from class:ListAdapter
Abstract method to bind the normal view holder.- Specified by:
bindNormalViewHolder
in classListAdapter<Award,androidx.recyclerview.widget.RecyclerView.ViewHolder>
- Parameters:
holder
- view holder to vindSposition
- index of the item
-
-