Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add calorie per 100g calculator to 'Add a new entry' screen #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaredandrews
Copy link

@jaredandrews jaredandrews commented Mar 26, 2023

(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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant