-
Notifications
You must be signed in to change notification settings - Fork 54
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
Adds a new Statistics Page #940
base: fields_modifications
Are you sure you want to change the base?
Conversation
First of all this looks awesome!
|
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.
See above comment for requested changes.
@akshat22 for the heatmap, you're going to need to either use the heatmap composable or adapt one of the vertical scrolling calendar views. |
|
The Config Activity Fields icon is different, is that on purpose? Tried to select a date range, I think it crashes if you only have one date:
|
DataHelper database; | ||
List<String> seasons = new ArrayList<>(); | ||
RecyclerView rvStatisticsCard; | ||
private int toggleVariable = 0; // 0: Total, 1: Year, 2: Month |
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 it would be best to define an enum here
Date date; | ||
|
||
// e.g. '2024-03' | ||
if (cardTitle.length() == 7) { |
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 can use ReyclerView ViewTypes to solve this in a more modular way.
reference: https://stackoverflow.com/questions/26245139/how-to-create-recyclerview-with-multiple-view-types
LocalDate heatMapStartDate, heatMapEndDate; | ||
Calendar dateSelectorStartRange, dateSelectorEndRange; | ||
DateTimeFormatter timeStampFormat; | ||
private static final String TIME_STAMP_PATTERN = "yyyy-MM-dd HH:mm:ss.SSSZZZZZ"; |
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.
You can reference this in SqlUtil.kt
private int getColorForObservations(int observations) { | ||
if (observations == 1) { | ||
return 0xFFb2f2bb; | ||
} else if (observations < 5) { | ||
return 0xFF69db7c; | ||
} else if (observations < 8) { | ||
return 0xFF40c057; | ||
} else { | ||
return 0xFF2f9e44; | ||
} |
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.
These should be theme attributes. Threshold value magic numbers should be defined as constants.
@chaneylc This is in reference to one of Trevor's notes in the previous comment to switch the icons for Fields and Plots.
Noted, will fix this. |
I've changed the target to fields_modifications which is going to be our base v6 version where this will be released. I have a few minor requests for updates to close this out and get it merged:
|
Description
Adds a new statistics page #871 to Field Book with the following features:
Type of change
What type of changes does your code introduce? Put an
x
in boxes that apply.CHANGE
(fix or feature that would cause existing functionality to not work as expected)FEATURE
(non-breaking change which adds functionality)BUGFIX
(non-breaking change which fixes an issue)ENHANCEMENT
(non-breaking change which improves existing functionality)NONE
(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Checklist:
Changelog entry
Please add a one-line changelog entry below. This will be copied to the changelog file during the release process.