Add API for users to check and be notified of scrolling state #202
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.
Hi! I've had a lot of success with JTCalendar on a recent project and just finished updating it to the 2.x version. I found that it can involve a lot of work to properly update the calendar asyncronously (as encouraged in the README for long-running update tasks) because you have to avoid reloading the calendar manager while either scroll view is still scrolling or else the contentOffset and/or view layouts seem to get messed up. After doing a lot of this work outside of JTCalendar, it seemed like it would be something that would be needed by others so I moved the changes into the library instead.
This change adds
scrolling
properties to the menu and horizontal content views so that users can check the current state before callingreload
and adds two more delegate methods called when the content scroll view finishes scrolling. This also occurs when the content scrolling is triggered by menu view scrolling. This means that users can update their data cache whencalendarDidLoad*Page
is called and then reload the calendar when the newcalendarDidFinishScrollingTo*Page
is called.I haven't made any changes to the vertical content view because I wasn't using it in the project this came from, but can either leave it to you or continue with that once you have a chance to look at the work thus far. Thanks!