rubensousa/GravitySnapHelper

Center Snap with support to snap to edge items

XtreeIvI opened this issue · 7 comments

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.

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

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

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

@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.

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

@XtreeIvI this will be added in 2.2.0

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