Class MessagesAdapter


  • public class MessagesAdapter
    extends com.cheetahdigital.uikit.widget.list.EndlessListAdapter<Message,​androidx.recyclerview.widget.RecyclerView.ViewHolder>
    List Adapter for Message
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.cheetahdigital.uikit.widget.list.EndlessListAdapter

        com.cheetahdigital.uikit.widget.list.EndlessListAdapter.ProgressViewHolder, com.cheetahdigital.uikit.widget.list.EndlessListAdapter.ReloadViewHolder
      • Nested classes/interfaces inherited from class com.cheetahdigital.uikit.widget.list.ListAdapter

        com.cheetahdigital.uikit.widget.list.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
    • 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 of EmptyViewHolder
      protected MessagesViewHolder createNormalViewHolder​(android.view.ViewGroup parent, int viewType)
      Called when view type is not ListAdapter.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createNormalViewHolder

        protected MessagesViewHolder createNormalViewHolder​(android.view.ViewGroup parent,
                                                            int viewType)
        Called when view type is not ListAdapter.VIEW_TYPE_HEADER
        Specified by:
        createNormalViewHolder in class com.cheetahdigital.uikit.widget.list.ListAdapter<Message,​androidx.recyclerview.widget.RecyclerView.ViewHolder>
        Parameters:
        parent - view group where current view is added
        viewType - 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 of EmptyViewHolder
        Specified by:
        bindNormalViewHolder in class com.cheetahdigital.uikit.widget.list.ListAdapter<Message,​androidx.recyclerview.widget.RecyclerView.ViewHolder>
        Parameters:
        holder - instance of MessagesViewHolder
        position - position of the current view being binded
      • removeItemId

        @Nullable
        public Message removeItemId​(int id)
        Remove an item from the list using the object id
        Parameters:
        id - id of the object to remove
        Returns:
        Message that is removed