Fixes #2532745 - Support flick._minVelocity and drag distance thresholds in ScrollView Paginator#258
Closed
derek wants to merge 13 commits into
Closed
Fixes #2532745 - Support flick._minVelocity and drag distance thresholds in ScrollView Paginator#258derek wants to merge 13 commits into
derek wants to merge 13 commits into
Conversation
…oll values when it is a dual-axis instance.
Contributor
Author
There was a problem hiding this comment.
This could just reuse the index variable available in the method.
This was referenced Sep 14, 2012
Contributor
Author
|
Merge delayed until post-370GA |
Contributor
Author
|
Merged into 3.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is a follow-up pull request to discussion @ #250. Trac ticket #2532745
ScrollView's Paginator plugin previously respected a
minVelocityvalue to trigger a page change, but this was left out of the 3.7.0 cleanup as a preference for more simple code. However, it was discussed that this should probably be reintroduced.Also left out was a drag distance threshold as a minimum for page change. So for example, on a 500px widget, previously the distance dragged would need to be >=250px to trigger a page change, otherwise it would snap back. But in 3.7.0 this could be triggered with just a 1px drag. Arguments can be made for either behavior, and it should probably be a configurable value, but to respect backwards compatibility until it can be researched further, it has been reintroduced.
These two related updates are primarily confined to two methods inside
paginator-plugin.js_beforeHostFlick- Reacts to the flick behavior, which is now responsible for handling pagination instead of deferring to the drag listener. Additional logic has been added to determine ability to scroll on the paginator's axis, as well as determining pagination direction. This method will prevent ScrollView'sflicklistener from firing, since the post-drag action is already determined (a page)._afterHostGestureMoveEnd- Reacts to drag events. Additional logic added to determine the distance of the drag, and compare that to the halfway point of the page node's width/height.When reintroducing code/logic, it can sometimes be helpful to compare old vs new. They are not directly comparable because different
on/aftercalls, as well as the host methods doing slightly different things as well. But for the curious:3.6.0 _flickFrame
3.7.0 _beforeHostFlick
3.6.0 _onGestureMoveEnd
3.7.0 _afterHostGestureMoveEnd
A few additional notes
_maxScroll{X/Y}values could be reset to zero, subsequently preventing normal interaction with ScrollView. This was due to some logic specifically for dual-axis instances but was not wrapped in a check to ensure it was dual-axis. Fixed, line #426.