-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix #61, #85, #73(partially): add tracking of 36 nutrients #80
base: master
Are you sure you want to change the base?
Conversation
Do you have any plans to finish (test) this? The lack of macro tracking is the only thing preventing me from being able to use the app :'( |
Hi, finally I had some time to look into this again. I merged the recent changes and refactored it a little. I also fixed the database upgrade issue, now it should be possible to upgrade an existing installation without loosing the data - I only tested this on my phone though. |
Just want to add that Ive been using this branch for a while and think it works very well and is a good addition to the app. Exactly what I needed. |
…th and week stat. fragment
Hi, In the newly added Settings-Activity users can choose which nutrient to track. For every nutrient and the calories one can set a daily goal and whether one should surpass this goal or not. In the overview activity the goals are shown as progress bars. The following screenshot shows an example, where 4 nutrients have goals set. The sugar goal shall not be surpassed and it isn't, so the progress bar is green. The goal of 150g protein shall be surpassed every day, so the progress bar is orange, since that isn't the case. Salt and fiber progress bars show the behaviour when a goal is surpassed. This fixes #61 , #85 and #73 in a way. Visualising the daily goals was inspired by @christianfl #61 (comment) I added an upgrade route for the database, so anyone who used the previous version with the macro nutrient tracking should be able to update with no problem - but I did only test this once on my phone. |
Without me noticing one of my previous commits introduced a bug where the settings activity would not allow to enable any nutrient tracking. This is fixed now. |
I added the possibility to edit saved products. Now users can add nutrients to Products they already added in the app. This is especially useful if one takes a product from OpenFoodFacts, which most often do not contain infos like vitamin content, and wants to add e.g. vitamin c content. |
Very cool, I'll try it out and report back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I assume db version should be 3. Also I just tested this build and it gives me a NPE every time I choose something from the search results.
It looks good so far, though.
/*** | ||
* Migrate database so it also contains micro nutriments. | ||
*/ | ||
static final Migration MIGRATION_2_3 = new Migration(2, 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Database is set to v2 but there is a migration to v3?
Is this a mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right about the database version. I did not look into this for a long time though.
I can look into the npe in like one or two weeks. Do you have more information on the exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I also took a look and fixed some bugs:
- At some places product.key was used instead of offKey which leads to Zero values in database products
- The click listener in search products was weird implemented. If there was a reason for it I don't get it. I cleaned it up a little which fixed the crash mentioned above.
How can i contribute my changes? This will be my first contribution to an Open Source Project on GitHub.
I have done the changes in the forked repositpory of @conrad57 an have them only local on my machine.
@Kamuno And there are merge conflicts. Which branch do I have to merge into this to resolve the conflicts?
Privacy - to indicate I read CONTRIBUTING.md
This enhances the app so users can add macro nutrients to the products they add (#61 ). The macro nutrients for each entry are listed in the overview and below the overview heading the total macros are shown also. Products added from the OpenFoodFacts search also contain macros - if OFF provides them. The statisitics show a graph view for every macro below the energy graph view - carbs & sugar and fat & saturated fat each share a graph view.
I was not able to test how this enhacement works when updating an existing version of the app, I guess there need changes to be done to some database stuff, so that the upgrade works.