Package com.cheetahdigital.messages.ui
Class MessagesAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<VH>
-
- com.cheetahdigital.uikit.widget.list.ListAdapter<D,VH>
-
- com.cheetahdigital.uikit.widget.list.EndlessListAdapter<Message,androidx.recyclerview.widget.RecyclerView.ViewHolder>
-
- com.cheetahdigital.messages.ui.MessagesAdapter
-
-
Constructor Summary
Constructors Constructor Description MessagesAdapter(java.util.List<Message> dataList, MessagesClickListener listener)
Constructor forMessagesAdapter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bindNormalViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder holder, int position)
Called when viewholder is not an instance ofEmptyViewHolder
protected MessagesViewHolder
createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Called when view type is notListAdapter.VIEW_TYPE_HEADER
Message
removeItemId(int id)
Remove an item from the list using the object id-
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
-
MessagesAdapter
public MessagesAdapter(@NonNull java.util.List<Message> dataList, @NonNull MessagesClickListener listener)
Constructor forMessagesAdapter
- Parameters:
dataList
- list ofMessage
to be displayedlistener
- theMessagesClickListener
for handling clicks on a Message
-
-
Method Detail
-
createNormalViewHolder
protected MessagesViewHolder createNormalViewHolder(android.view.ViewGroup parent, int viewType)
Called when view type is notListAdapter.VIEW_TYPE_HEADER
- Specified by:
createNormalViewHolder
in classcom.cheetahdigital.uikit.widget.list.ListAdapter<Message,androidx.recyclerview.widget.RecyclerView.ViewHolder>
- Parameters:
parent
- view group where current view is addedviewType
- view type of the new view- Returns:
- A new ViewHolder that holds a View of the given view type.
-
bindNormalViewHolder
protected void bindNormalViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder holder, int position)
Called when viewholder is not an instance ofEmptyViewHolder
- Specified by:
bindNormalViewHolder
in classcom.cheetahdigital.uikit.widget.list.ListAdapter<Message,androidx.recyclerview.widget.RecyclerView.ViewHolder>
- Parameters:
holder
- instance ofMessagesViewHolder
position
- position of the current view being binded
-
-