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

Center Snap with support to snap to edge items #21

Closed
XtreeIvI opened this issue Apr 24, 2017 · 7 comments
Closed

Center Snap with support to snap to edge items #21

XtreeIvI opened this issue Apr 24, 2017 · 7 comments
Milestone

Comments

@XtreeIvI
Copy link

XtreeIvI commented Apr 24, 2017

GravirySnapHelper is awesome comparing to default LinearSnapHelper. But It would be perfect if it is support also Gravity.CENTER and simultaneously snap to first and last item if scrolled to one of the edges.
Regretfully LinearSnapHelper (though snap to center) can't snap to side items as your GravirySnapHelper does. So in order your GravirySnapHelper become far more superior you should add Gravity.CENTER. Thanks. Also I found that if I set snapToLastItem(true) it does not snap, though it snap to edge items by default.

@rubensousa
Copy link
Owner

I don't understand why Gravity.CENTER support should be added. Care to explain an use case for this?

@XtreeIvI
Copy link
Author

XtreeIvI commented May 3, 2017

actually Gravity.CENTER with ability to snap for first and last item. LinearSnapHelper does not support snap for side items.

@bobymicroby
Copy link

in LinearSnapHelper you dont have the snapListener, so +1 for Gravity.CENTER :)

@rubensousa
Copy link
Owner

@XtreeIvI, it doesn't make sense (in my opinion) to support CENTER and then snapping first and last items at the same time. That means it'll only be centered before the first scroll. After the first scroll, it'll either be snapped at START or END.

I'll consider adding CENTER support to replace the need for using 2 different SnapHelpers.

@GLiccardo
Copy link

GLiccardo commented May 15, 2017

actually Gravity.CENTER with ability to snap for first and last item. LinearSnapHelper does not support snap for side items.

+1
It is important when you have the first and last items with margins to screen edges

@rubensousa rubensousa added this to the 2.2.0 milestone Aug 30, 2019
@rubensousa
Copy link
Owner

@XtreeIvI this will be added in 2.2.0

@rubensousa
Copy link
Owner

Released in 2.2.0. Just pass Gravity.CENTER and you get this behavior by default

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

No branches or pull requests

4 participants