Checking the expiration date fragment overview
the code for checking the expiration date into the appropriate fragments
- StartFragment: goes to ScanFragment or EnterUpcFragment depending upon which button is selected
- ScanFragment: scan's the item's UPC, displays the upc at the bottom and when the confirmation button is selected it should lookup the upc in the local database, if it is found go to fragment_confirm_item.xml or go to fragment_select_item.xml (need to think about what happens if the scanning fails)
- EnterUpcFragment: user types in the upc, validates the upc and when the user clicks loopkup to look for the upc in the local database; goes to fragment_confirm_item.xml if found and fragment_select_item.xml it not in the local database yet (look at the code in EnterUpc.java)
- ConfirmItemFragment: confirmation screen that allows the user to confirm it is the item they want - if correct, goes to fragment_select_printed_expiration_date.xml, if not correct go to fragment_select_item.xml to enter the category & item
- SelectItemFragment: user selects category & item options - the item is then added into the local database and then moves to fragment_select_printed_expiration_date.xml (look at code in NestNewUPC.java and ItemInformation.java)
- SelectPrintedExpirationDateFragment: select expiration date using a date picker and then moves to fragment_display_true_expiration (look at code in ItemInformation.java)
- DisplayTrueExpirationFragment: calculates the true expiration date based upon the printed expiration date and the data from the Foodkeeper api (look at code in FinalDate.java) - this will be done as part of issue #91 (closed)
NOTE: when using code from other java files be sure to cite it in your commit message - for example,
git commit -m "Copied the scanner code from Scanner.java to ScanFragment.java and updated to work from within a fragment"
Edited by Lori Postner