Class ChallengesAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<VH>
-
- com.cheetahdigital.uikit.widget.list.ListAdapter<D,VH>
-
- com.cheetahdigital.uikit.widget.list.EndlessListAdapter<Challenge,ChallengesViewHolder>
-
- com.cheetahdigital.challenges.ui.challenges.ChallengesAdapter
-
public class ChallengesAdapter extends com.cheetahdigital.uikit.widget.list.EndlessListAdapter<Challenge,ChallengesViewHolder>
Class that is displayed as list item inChallengesListFragment
-
-
Constructor Summary
Constructors Constructor Description ChallengesAdapter(java.util.List<Challenge> data)
Simple constructorChallengesAdapter(java.util.List<Challenge> data, ChallengeClickListener listener)
Constructor to override the default item click behavior
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bindNormalViewHolder(ChallengesViewHolder holder, int position)
Abstract method to bind the normal view holder.protected ChallengesViewHolder
createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Abstract method to create normal view holder.void
hideZeroMetrics(boolean hide)
Hide metrics views if zero valuevoid
showMetrics(boolean show)
Show metrics views-
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
-
ChallengesAdapter
public ChallengesAdapter(java.util.List<Challenge> data)
Simple constructor- Parameters:
data
- list ofChallenge
-
ChallengesAdapter
public ChallengesAdapter(java.util.List<Challenge> data, ChallengeClickListener listener)
Constructor to override the default item click behavior- Parameters:
data
- list ofChallenge
listener
- theChallengeClickListener
-
-
Method Detail
-
createNormalViewHolder
protected ChallengesViewHolder createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Description copied from class:com.cheetahdigital.uikit.widget.list.ListAdapter
Abstract method to create normal view holder.- Specified by:
createNormalViewHolder
in classcom.cheetahdigital.uikit.widget.list.ListAdapter<Challenge,ChallengesViewHolder>
- Parameters:
parent
- used to get resourceviewType
- type of view- Returns:
- view holder for non special items
-
bindNormalViewHolder
protected void bindNormalViewHolder(ChallengesViewHolder holder, int position)
Description copied from class:com.cheetahdigital.uikit.widget.list.ListAdapter
Abstract method to bind the normal view holder.- Specified by:
bindNormalViewHolder
in classcom.cheetahdigital.uikit.widget.list.ListAdapter<Challenge,ChallengesViewHolder>
- Parameters:
holder
- view holder to vindSposition
- index of the item
-
showMetrics
public void showMetrics(boolean show)
Show metrics views- Parameters:
show
- true to show, false otherwise
-
hideZeroMetrics
public void hideZeroMetrics(boolean hide)
Hide metrics views if zero value- Parameters:
hide
- true to hide, false otherwise
-
-