Storage type not showing up as N/A sometimes issue#389
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-389
Related Issues
Issue 389
Description
When pantryLife != null but storage tips is null (in more info), the storage tips displayed nothing while it should have displayed N/A. Issue is now fixed, N/A is displayed.
Steps to Test
(List the steps needed to test this merge request here using bullets, for ex:)
- Create a Shelf Stable Foods item Crackers (remember UPC barcode)
- Go to more info
- Scroll down and check to make sure N/A is displayed on both Storage Type and Storage Tips
Relevant Screenshots
Relevant Logs
// Display pantry life information
if (pantryLife != null) {
((TextView) view.findViewById(R.id.storage_type))
.setText(pantryLife.getDesc() != null ? pantryLife.getDesc() : "N/A");
((TextView) view.findViewById(R.id.storage_tips))
.setText(pantryLife.getTips() != null ? pantryLife.getTips() : "N/A");
} else {
((TextView) view.findViewById(R.id.storage_type)).setText("N/A");
((TextView) view.findViewById(R.id.storage_tips)).setText("N/A");
}
Developer Notes
(List any notes you have about what you did here using bullets, for ex:)
- I just copied the conditional thing that displays N/A from Storage Tips and added it to Storage type and changed .getTips() to .getDesc(), as can be seen from the screenshot and the java code