Class StorageIngredientAdapter

  • All Implemented Interfaces:
    com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>

    public class StorageIngredientAdapter
    extends DBAdapter<StorageIngredientAdapter.ViewHolder>
    The adapter class for the storage ingredient list.
    • Constructor Detail

      • StorageIngredientAdapter

        public StorageIngredientAdapter​(StorageIngredientDB db)
        The constructor for the adapter.
        Parameters:
        db - the storage ingredient DB
    • Method Detail

      • onCreateViewHolder

        @NonNull
        public StorageIngredientAdapter.ViewHolder onCreateViewHolder​(@NonNull
                                                                      android.view.ViewGroup parent,
                                                                      int viewType)
        onCreateViewHolder is called when the view holder is created.
        Specified by:
        onCreateViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<StorageIngredientAdapter.ViewHolder>
        Parameters:
        parent - the parent view group
        viewType - the view type
        Returns:
        the view holder
      • onBindViewHolder

        public void onBindViewHolder​(@NonNull
                                     StorageIngredientAdapter.ViewHolder holder,
                                     int position)
        onBindViewHolder is called when the view holder is bound.
        Specified by:
        onBindViewHolder in class androidx.recyclerview.widget.RecyclerView.Adapter<StorageIngredientAdapter.ViewHolder>
        Parameters:
        holder - the view holder
        position - the position of the storage ingredient in the list
      • setOnItemClickListener

        public void setOnItemClickListener​(OnItemClickListener listener)