Class ItemAdapter<Item>

  • Direct Known Subclasses:
    EditItemAdapter, IngredientDetailAdapter, MealPlanItemAdapter

    public abstract class ItemAdapter<Item>
    extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.recyclerview.widget.RecyclerView.ViewHolder>
    The class ItemAdapter is used to display items in a RecyclerView
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<Item> items
      list of ItemAdapter
    • Constructor Summary

      Constructors 
      Constructor Description
      ItemAdapter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getItemCount()  
      java.util.List<Item> getItems()  
      void setItems​(java.util.List<Item> items)  
      • Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter

        bindViewHolder, createViewHolder, getItemId, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onBindViewHolder, onCreateViewHolder, 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
    • Constructor Detail

      • ItemAdapter

        public ItemAdapter()
    • Method Detail

      • getItems

        public java.util.List<Item> getItems()
      • setItems

        public void setItems​(java.util.List<Item> items)
        Parameters:
        items - the list of items
      • getItemCount

        public int getItemCount()
        Specified by:
        getItemCount in class androidx.recyclerview.widget.RecyclerView.Adapter<androidx.recyclerview.widget.RecyclerView.ViewHolder>
        Returns:
        count of the number of ingredients in our list