Class ShoppingCartController


  • public class ShoppingCartController
    extends java.lang.Object
    ShoppingCartIngredientController is a class that contains methods for interacting with the shopping cart
    • Constructor Detail

      • ShoppingCartController

        public ShoppingCartController​(android.app.Activity activity)
        The constructor for the controller.
        Parameters:
        activity - The activity that the controller is attached to.
    • Method Detail

      • getSearchResults

        public void getSearchResults​(java.lang.String field)
        getSearchResults returns the search results for the given query.
        Parameters:
        field - The field to search.
      • sortByField

        public void sortByField​(java.lang.String field)
        sortByField sorts the shopping cart by the given field.
        Parameters:
        field - The field to sort by.
      • setAdapter

        public void setAdapter​(ShoppingCartIngredientAdapter adapter)
        Sets adapter to the given adapter.
        Parameters:
        adapter - the adapter to set
      • generateShoppingCart

        public void generateShoppingCart()
        generateShoppingCart generates the shopping cart from the given meal plan and storage ingredients.
      • updateCheckedStatus

        public void updateCheckedStatus​(java.lang.String id,
                                        boolean isChecked)
      • addIngredientToStorage

        public void addIngredientToStorage​(ShoppingCartIngredient shoppingCartIngredient,
                                           StorageIngredient storageIngredient)
        addIngredientToStorage adds the given ingredient to the storage.
        Parameters:
        shoppingCartIngredient - the ingredient to add.
        storageIngredient - the storage ingredient to add.