Class MealPlanItemAdapter<Item>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MealPlanItemAdapter.ItemViewHolder
      ItemViewHolder class holds the view for the item.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onBindViewHolder​(androidx.recyclerview.widget.RecyclerView.ViewHolder holder, int position)
      onBindViewHolder method binds a MealPlan object and a MealPlanViewHolder object.
      MealPlanItemAdapter.ItemViewHolder onCreateViewHolder​(android.view.ViewGroup parent, int viewType)
      inflates the view
      void setOnItemClickListener​(OnItemClickListener<Item> onItemClickListener)
      Sets the listener for an item click in the Recyclerview
      • 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, 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

      • MealPlanItemAdapter

        public MealPlanItemAdapter()
    • Method Detail

      • onCreateViewHolder

        @NonNull
        public MealPlanItemAdapter.ItemViewHolder onCreateViewHolder​(@NonNull
                                                                     android.view.ViewGroup parent,
                                                                     int viewType)
        inflates the view
        Specified by:
        onCreateViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<androidx.recyclerview.widget.RecyclerView.ViewHolder>
        Parameters:
        parent - activity that handles the ingredients
        viewType - type of view
        Returns:
        the view
      • onBindViewHolder

        public void onBindViewHolder​(@NonNull
                                     androidx.recyclerview.widget.RecyclerView.ViewHolder holder,
                                     int position)
        onBindViewHolder method binds a MealPlan object and a MealPlanViewHolder object.
        Specified by:
        onBindViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<androidx.recyclerview.widget.RecyclerView.ViewHolder>
        Parameters:
        holder - the view holder
        position - the position of the item in the ArrayList
      • setOnItemClickListener

        public void setOnItemClickListener​(OnItemClickListener<Item> onItemClickListener)
        Sets the listener for an item click in the Recyclerview
        Parameters:
        onItemClickListener - the listener to set