-
Notifications
You must be signed in to change notification settings - Fork 328
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
Springboard-like page scrolling #23
base: master
Are you sure you want to change the base?
Conversation
With this change we don't need to update currentView.center on each pan. This will allow us to change the page with a nice animation when collectionView.pagingEnabled.
default: { | ||
// Do nothing... |
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.
Just noticed that I accidentally made a change here too. That said, makes sense to invalidate the scroll timer if the gesture was cancelled or failed, doesn't it?
Wow thanks for this pull request. It looks cool! I should start spending some time building more examples to show case. I'll try review this and merge this in soon though. I had this experimental drag and drop branch I used in a project. Although I haven't figure out how to merge it into the master, maybe with this I can try to replicate some bit of spring board's behavior! Should be cool. Although one of the reason I couldn't merge in the branch is that it is causing more problems to an already problematic animation when shifting cells. |
Let me know if there's anything I can do to help. Yes, more examples would be nice to simplify testing. And maybe a unit test project. |
Hey, do you find some time to merge this? |
Hey, This is a great addition! |
@roiholtzman I'm not actively supporting this fork. Feel free to take over! |
Does the latest version suppose to handle scrolling that looks like the iOS springboard? |
That works like, not looks like. |
Added Springboard-like page scrolling for when the collection view has paging enabled and updated the example. We needed this for collection views that can only scroll to the page offset, and also it feels more "natural".
This feature required an architectural change:
currentView
is now a sibling of the collection view instead of its child. This avoids overcomplicated calculations to movecurrentView
with the page change animation. Also, this should work better when the collection view is smaller than its parent.All the page calculations were added to a separate
UICollectionViewFlowLayout
category, as they are independent ofLXReorderableCollectionViewFlowLayout
's logic.Totally understand if you don't want this change in master.