forest icon indicating copy to clipboard operation
forest copied to clipboard

feat: :sparkles: allow for collection of multiple trees per day

Open DontBlameMe99 opened this issue 1 year ago • 2 comments

Modify the code to allow for multiple trees per day.

This commit also changes the display of the trees per day in the Stats -> Details view

New version of the details page (After the change

new

Old version of the details page (Before the change

old

What has changed
  • Modified SQL (in DayDao.kt) statement to use steps / goal instead of just counting the days where the steps >= goal
  • Modified other (StatsSummary.kt, StatsDetailsViewModel.kt) code locations to use steps / goal instead of just using steps >= goal
  • Changed the display of the daily tree goal from "just achieved" to "x trees collected" (see old vs new version of the details page)
  • Removed/Refactored (now) unnecessary things in the strings.xml- Changed the StatsDetailsViewModel.kt from a simple boolean if the tree has been collected to an int which indicates how many trees were collected on that day
  • Changed the StatsDetailsState.kt from a simple boolean if the tree has been collected to an int which indicates how many trees were collected on that day

closed #8

DontBlameMe99 avatar Jul 07 '24 10:07 DontBlameMe99

And by the way, don't hesitate to create multiple commits. It's generally a bad idea to force push them to origin. If you want to fix something in the commit you created and not yet pushed, you can use git commit --amend (read more how to use it).

bartek537 avatar Jul 11 '24 19:07 bartek537

And by the way, don't hesitate to create multiple commits. It's generally a bad idea to force push them to origin. If you want to fix something in the commit you created and not yet pushed, you can use git commit --amend (read more how to use it).

Perfect that I read that just AFTER creating that commit ._. Yeah, thanks for letting me know. I love to learn and clearly you have more experience than me! :heart:

DontBlameMe99 avatar Jul 11 '24 22:07 DontBlameMe99