Adding StatusFragment to indicate if the item can stay in the pantry
License and Copyright Notice
By submitting this issue or commenting on this issue, or contributing any content to this issue, you certify under the Developer Certificate of Origin that the content you post may be licensed under GPLv3 (for code) or CC-BY-SA 4.0 International (for non-code content).
Branch Name
issue_227_traffic_light_fragment
Related Issues
- Closes #227 (closed);
Dependencies
NOTE: I'm leaving these dependencies listed here, but am removing the requirement of them needing to be merged first. This merge request should be ok to be merge without the need of merging these dependencies.
Description
This merge request will add a new fragment/UI that appears after SelectPrintedExpirationDateFragment
that will display the items shelf life status using "traffic light" colors.
-
#BBBBBB
Gray means the shelf life is unknown. (EithershelfLife = null
orshelfLife.getMetric() = null
) -
#EE0000
Red means the item is no longer good and should be discarded. -
#EEEE00
Yellow means the item is within 30 days of expiration. -
#00EE00
Green means the item is good for 30 days or more.
This fragment will have a "More Info" button that goes to MoreInfoFragment
(currently named DisplayTrueExpirationFragment
). This fragment will also allow the user to return to SelectPrintedExpirationDateFragment
if they have another of the same item with a different expiration date.
Steps to Test
- Go to the 'Check Expiration Date' feature within the app.
- Scan or enter a barcode.
- Fill in the required information if in
SelectItemFragment
, or press confirm if inConfirmItemFragment
. - Press 'Accept'
- Select a random date.
- Press 'Accept'
- You should now see the new
StatusFragment
- Make sure it is displaying the correct data.
- Repeat all the previous steps with different items and dates.
- You should now see the new
- Press the "More Info" button.
- Make sure info was passed correctly to
MoreInfoFragment
- Make sure info was passed correctly to
- Press the back button.
- Press the back button.
- You should now be taken back to
SelectPrintedExpirationDateFragment
.
- You should now be taken back to
Make sure you are able to enter another printed expiration date for.
Relevant Screenshots
Relevant Logs
N/A
Developer Notes
- Added new
StatusFragment
- Updated nav graphs for new fragment
- Added 5 different possible statuses
-
#BBBBBB
Unknown -
#EE0000
Red - Discard -
#EEEE00
Yellow - Warning -
#00EE00
Green - Safe -
#00EE00
Green Infinity - Safe and Indefinite
-
- Added listener for back button
-
Added expiration date calculation according to the new issue #228 (closed)- Note this does not completely fix the issue.
- Update welcome message in
StartFragment
. - Merged recent changes from !228 (merged) into this branch.
- Used max directly when calculating the expiration date until we get a more solid answer about issue #228 (closed).
- Renamed
DisplayTrueExpirationFragment
toMoreInfoFragment
so the name better reflects what the fragment is used for.
LABELS
NEST
component:check-expiration-date
type::feature
status::doing