Class DateAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<VH>
-
- com.cheetahdigital.uikit.widget.list.ListAdapter<EventDate,DateViewHolder>
-
- com.cheetahdigital.event.ui.eventdate.list.DateAdapter
-
public class DateAdapter extends com.cheetahdigital.uikit.widget.list.ListAdapter<EventDate,DateViewHolder>
The adapter forEventDateListAdapter
-
-
Constructor Summary
Constructors Constructor Description DateAdapter(android.content.Context context, java.util.List<EventDate> dataList)Constructor forDateAdapterDateAdapter(android.content.Context context, java.util.List<EventDate> dataList, OnDateSelectedListener listener)Constructor forDateAdapter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(java.util.List<EventDate> data)Appends all of the elements in the specified collection to the end of this list and notifies registered observers that the item list has been changed.protected voidbindNormalViewHolder(DateViewHolder holder, int position)Abstract method to bind the normal view holder.protected DateViewHoldercreateNormalViewHolder(android.view.ViewGroup parent, int viewType)Abstract method to create normal view holder.voidenableUseOriginalWidth(boolean useOriginalWidth)Enable the use of original widthvoidnext()Select the next item and update the properties of the view to be in selected statevoidprevious()Select previous item and update the properties of the view in selected statevoidsetOriginalWidth(int originalWidth)Set the original width of each date cellvoidsetSelectedIndex(int selectedIndex)Set the current selected indexvoidupdateSelectedIndex(int index)Update the selected index and the views for the current cell-
Methods inherited from class com.cheetahdigital.uikit.widget.list.ListAdapter
addItem, addItem, clear, getDataList, getItemAt, getItemCount, getItemViewType, getPlaceHolderResource, insertItems, isListEmpty, onBindViewHolder, onCreateViewHolder, 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
-
DateAdapter
public DateAdapter(android.content.Context context, java.util.List<EventDate> dataList)Constructor forDateAdapter- Parameters:
context- context of the view that the adapter to be attacheddataList- list ofEventDateto be displayed
-
DateAdapter
public DateAdapter(android.content.Context context, java.util.List<EventDate> dataList, OnDateSelectedListener listener)Constructor forDateAdapter- Parameters:
context- context of the view that the adapter to be attacheddataList- list ofEventDateto be displayedlistener- theOnDateSelectedListenerthat handles when a date is clicked
-
-
Method Detail
-
createNormalViewHolder
protected DateViewHolder createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Description copied from class:com.cheetahdigital.uikit.widget.list.ListAdapterAbstract method to create normal view holder.- Specified by:
createNormalViewHolderin classcom.cheetahdigital.uikit.widget.list.ListAdapter<EventDate,DateViewHolder>- Parameters:
parent- used to get resourceviewType- type of view- Returns:
- view holder for non special items
-
bindNormalViewHolder
protected void bindNormalViewHolder(DateViewHolder holder, int position)
Description copied from class:com.cheetahdigital.uikit.widget.list.ListAdapterAbstract method to bind the normal view holder.- Specified by:
bindNormalViewHolderin classcom.cheetahdigital.uikit.widget.list.ListAdapter<EventDate,DateViewHolder>- Parameters:
holder- view holder to vindSposition- index of the item
-
addAll
public void addAll(java.util.List<EventDate> data)
Description copied from class:com.cheetahdigital.uikit.widget.list.ListAdapterAppends all of the elements in the specified collection to the end of this list and notifies registered observers that the item list has been changed.- Overrides:
addAllin classcom.cheetahdigital.uikit.widget.list.ListAdapter<EventDate,DateViewHolder>- Parameters:
data- list of items to add
-
enableUseOriginalWidth
public void enableUseOriginalWidth(boolean useOriginalWidth)
Enable the use of original width- Parameters:
useOriginalWidth-trueto use original width, elsefalse
-
setOriginalWidth
public void setOriginalWidth(int originalWidth)
Set the original width of each date cell- Parameters:
originalWidth- widht of date cell
-
setSelectedIndex
public void setSelectedIndex(int selectedIndex)
Set the current selected index- Parameters:
selectedIndex- current index selected
-
updateSelectedIndex
public void updateSelectedIndex(int index)
Update the selected index and the views for the current cell- Parameters:
index- index to set as selected
-
next
public void next()
Select the next item and update the properties of the view to be in selected state
-
previous
public void previous()
Select previous item and update the properties of the view in selected state
-
-