Class IngredientSearchAdapter.ViewHolder

  • Enclosing class:
    IngredientSearchAdapter

    public static class IngredientSearchAdapter.ViewHolder
    extends androidx.recyclerview.widget.RecyclerView.ViewHolder
    Holds the views for the ingredients in the search
    • Field Summary

      • Fields inherited from class androidx.recyclerview.widget.RecyclerView.ViewHolder

        itemView
    • Constructor Summary

      Constructors 
      Constructor Description
      ViewHolder​(android.view.View view)
      Creates a ViewHolder for an ingredient
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(Ingredient ingredient, OnItemClickListener listener)
      Binds an ingredient to a ViewHolder, to properly display the data
      • Methods inherited from class androidx.recyclerview.widget.RecyclerView.ViewHolder

        getAdapterPosition, getItemId, getItemViewType, getLayoutPosition, getOldPosition, getPosition, isRecyclable, setIsRecyclable, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ViewHolder

        public ViewHolder​(@NonNull
                          android.view.View view)
        Creates a ViewHolder for an ingredient
        Parameters:
        view - the view to use
    • Method Detail

      • bind

        public void bind​(Ingredient ingredient,
                         OnItemClickListener listener)
        Binds an ingredient to a ViewHolder, to properly display the data
        Parameters:
        ingredient - the Ingredient to bind to the ViewHolder
        listener - the ingredient click listener to bind to the ViewHolder