Class PlacesAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<VH>
-
- com.cheetahdigital.uikit.widget.list.ListAdapter<D,VH>
-
- com.cheetahdigital.uikit.widget.list.EndlessListAdapter<Place,PlaceViewHolder>
-
- com.cheetahdigital.locations.ui.places.list.PlacesAdapter
-
public class PlacesAdapter extends EndlessListAdapter<Place,PlaceViewHolder>
The adapter class forPlacesListFragment
-
-
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 PlacesAdapter(java.util.List<Place> dataList)
Constructor that accepts the list ofPlace
PlacesAdapter(java.util.List<Place> dataList, OnPlaceClickListener listener)
Constructor that accepts the list ofPlace
and click listenerOnPlaceClickListener
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bindNormalViewHolder(PlaceViewHolder holder, int position)
Abstract method to bind the normal view holder.protected PlaceViewHolder
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
-
PlacesAdapter
public PlacesAdapter(@NonNull java.util.List<Place> dataList)
Constructor that accepts the list ofPlace
- Parameters:
dataList
- list of Place
-
PlacesAdapter
public PlacesAdapter(@NonNull java.util.List<Place> dataList, OnPlaceClickListener listener)
Constructor that accepts the list ofPlace
and click listenerOnPlaceClickListener
- Parameters:
dataList
- list of Placelistener
-OnPlaceClickListener
-
-
Method Detail
-
createNormalViewHolder
protected PlaceViewHolder createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Description copied from class:ListAdapter
Abstract method to create normal view holder.- Specified by:
createNormalViewHolder
in classListAdapter<Place,PlaceViewHolder>
- Parameters:
parent
- used to get resourceviewType
- type of view- Returns:
- view holder for non special items
-
bindNormalViewHolder
protected void bindNormalViewHolder(PlaceViewHolder holder, int position)
Description copied from class:ListAdapter
Abstract method to bind the normal view holder.- Specified by:
bindNormalViewHolder
in classListAdapter<Place,PlaceViewHolder>
- Parameters:
holder
- view holder to vindSposition
- index of the item
-
-