Add calorie per 100g calculator to 'Add a new entry' screen #103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Sorry for opening this pull request twice, I didn't fully understand how GitHub forks work and I dirtied up my original PR and messed up a second one, both that been deleted)
I'm not sure how it works in other countries but in the USA, packaged food will often display the calories per serving size, where the serving size is listed in grams.
For example, I have a package of chocolate cookies in front of me right now. The serving size is 28 grams with a calorie count of 120.
I am often frustrated by this convention when inputting new food items into this app. Sometimes the math can be done in my head, but other times I need to switch to the calculator app.
In this PR, I add a calculator button to the "kCal/100g" field on the "add a new entry" screen. This calculator is a pop up dialog which lets you enter a calorie to gram ratio and then it calculates the "kCal/100g" value. When you click save, it places it into the field.
See https://imgur.com/a/sj21gj1 to view this functionality in action.
Once again, I have added German and French translations via Google Translate.
I also got the calculator icon
(ic_calculate_24dp.xml)
with the "add vector asset" tool in Android Studio.