Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

hpique
Copy link

@hpique hpique commented Apr 1, 2013

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 move currentView 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 of LXReorderableCollectionViewFlowLayout's logic.

Totally understand if you don't want this change in master.

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...
Copy link
Author

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?

@lxcid
Copy link
Owner

lxcid commented Apr 1, 2013

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.

@hpique
Copy link
Author

hpique commented Apr 1, 2013

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.

@mRs-
Copy link

mRs- commented May 16, 2013

Hey, do you find some time to merge this?

@roiholtzman
Copy link

Hey, This is a great addition!
I would really like to use this flow. Can you please share a project in which it's implemented? Or maybe explain how to use it?
Thanks, Roi

@hpique
Copy link
Author

hpique commented May 28, 2014

@roiholtzman I'm not actively supporting this fork. Feel free to take over!

@roiholtzman
Copy link

Does the latest version suppose to handle scrolling that looks like the iOS springboard?

@hpique
Copy link
Author

hpique commented May 28, 2014

That works like, not looks like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants