Fixing issue with prior year missing in SelectPrintedExpirationDateFragment
BRANCH NAME
issue_224_prior_years_missing
RELATED ISSUES
Closes #224 (closed);
DEPENDANTS
DESCRIPTION
Fixing issue with prior years missing in SelectPrintedExirationDateFragment
when selecting a year.
This merge request also includes some enhancements for SelectPrintedExpirationDateFragment
:
- General layout and code clean-up/organization
- Dedicated "UPC" label
- Converted
PopupMenus
toNumberPickers
SELECTABLE YEAR RANGE REASONING
I ran the following query on the Nest.db database using the printLongestShelfLife()
method below to get the maximum shelf-life that exists:
SELECT min, MAX(max), metric FROM view_shelf_lives_and_type_info_joined WHERE metric = Years
public void printLongestShelfLife() {
String qry = "SELECT min, MAX(max), metric FROM view_shelf_lives_and_type_info_joined WHERE metric = ?";
Cursor c = db.rawQuery(qry, new String[]{"Years"});
c.moveToFirst();
Log.d("LongestShelfLife", c.getInt(0) + " - " + c.getInt(1)
+ " " + c.getString(2));
c.close();
}
This was the resulting log statement:
D/LongestShelfLife: 8 - 10 Years
Since the longest shelf-life that exists is 10 years, I set the range of selectable years to 10 years prior and 10 years post the current year.
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
. - Select a random date.
- Press 'Accept'.
Confirm that the item and date is still being properly sent to the next fragment and that the prior years are now a selectable option.
NOTES
- Added a dedicated "UPC" label
- Converted
PopupMenus
toNumberPickers
to prevent extremely longPopupMenus
- Fixed issue #224 (closed)
- Cleaned-up layout and fragment code
RELEVANT SCREENSHOTS
Here is a screenshot of the new layout design:
LABELS
NEST
component:check-expiration-date
type::bug
type::enhancement
status::done