Added feature to calculate BMR and daily calories based on activity level #248
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.
This patch addresses issue #238.
The following features were added:
In Weight Track -> Index, the BMR for the user is calculated based on two formulas, the Mifflin-St Jeor equation, and the Katch-McArdle formula. The latter formula is said to be more accurate for individuals who are leaner. For those with body fat levels equal to or lower than 15%, the app uses the Katch-McArdle Formula to calculate BMR. When body fat is greater than 15%, the Mifflin-St Jeor equation is utilized. The body fat cutoff value can be changed.
Estimated daily calories are now provided in Weight Track -> Index as well. This calculation is based off the user's BMR. A spinner allows the user to select their activity level. This selected activity level is saved even when the app is closed. Depending on which activity level is selected, a different multiplier is used against the BMR to produce the daily calorie value. If the user decides to change the activity level, the daily calorie recommendation will be updated in real-time.
The equations used to perform these calculations can be referenced here: https://www.calculator.net/bmr-calculator.html
Screenshots have been provided for more info.
Please let me know if you have any questions/comments.
Thanks