-
Notifications
You must be signed in to change notification settings - Fork 0
Crc cards (reviewed)
addItem(): uses Item
deleteItem(): uses Item
getName()
getItems(): lazy-loads from DB into the list, uses the ShoppingListDataAdapter
calculateTotalSpent(): uses Item
calculateTotalCostOfList(): uses Item
updatePantryOrderToMatchOrderInList() (when re-arranging)
updateShoppingOrderToMatchOrderInList() (when re-arranging)
name: String
id in database: long
items: list of Items
incrementNumberToBuy()
resetNumberToBuy()
calculateTotalSpent(): only if item has been bought. Useful to keep running total in store.
calculateTotalPrice(): useful to keep total price once everything is bought (how much money I should bring to store)
name, databaseID, databaseID of the shopping list this item belongs to, isBought, numberToStock, numberToBuy, cost, sizeOfUnit, label, pantryOrder, shoppingOrder
display() uses a custom array adapter and ShoppingList[] Includes appropriate title message
launch a StockActivity or a ShopActivity via an intent, sending the name of the ShoppingList.
addList(name: String): uses ShoppingList
deleteList(name: String): uses ShoppingList, ShoppingListDataAdapter, and ItemDataAdapter to delete items
List of names of ShoppingLists (loaded from the database)
ShoppingListDataAdapter
ItemDataAdapter
abstract display() uses ShoppingList
editItem() launches a dialog: uses Item, ItemDataAdapter Just nest the dialog?
addItem() launches an autocomplete field: uses Item, ItemDataAdapter
deleteItem(): uses Item, ItemDataAdapter
launchActivity() launches another activity using an intent
ShoppingList of items
ItemDataAdapter
display(): details about each item in multiple size fonts. Uses an array adapter.
updateNumberToBuy (via increment or reset): uses ShoppingList, ItemDataAdapter
resetAllItems(): resets numToBuy all to 0
display()
trackWhichHaveBeenBought using the Items’ bought flags
calculateTotalSpent(): uses ShoppingList
calculateTotalPriceOfList(): uses ShoppingList
unmarkAllItems(): if shopping list, marks all as unbought
display()
loadList(): uses ShoppingListDataAdapter, ItemDataAdapter
saveList(): uses ItemDataAdapter
rearrange order in the list (via drag and drop)
ShoppingList of items
ItemDataAdapter
color, message (maybe in Title Bar) (depend on whether stock or sort)
Font sizes
Currency type (position and symbol, eg $ or K)
Store names (a list of strings, persisted as a single string)
Current activity (main, stock, or shop), so can start at right one. Don’t bother restarting at a sort activity.
open()
close()
insertList()
updateList()
editList()
loadAllLists()
insertItem(Item)
deleteItem(Item)
updateItem(Item)
loadAllItemsWithListID(listId)
deleteAllItemsWithListID(listId)
updateAllItemsInListID(ShoppingList) (after rearranging list)
###Attributes SQLiteDatabase
DatabaseHelper
Uses Android’s DBOpenHelper
SQLite structure: Two tables:
-
Shopping lists
-
Items. Each row includes: rowId, idOfMyShoppingList, listName, item data (item name, numberToBuy, price, etc)