-
Notifications
You must be signed in to change notification settings - Fork 19
Conversation
1763a8a
to
f7238f3
Compare
Can you, please, explain more about flingDirection? |
You can determine that by: |
Thanks, I reached behavior I wanted to 👍 |
lib/src/main/kotlin/dev/chrisbanes/snapper/SnapperFlingBehavior.kt
Outdated
Show resolved
Hide resolved
This block which returns the index which the apps wishes to snap to. The block is provided with the SnapperLayoutInfo and the index which Snapper has determined is the correct target index. Callers can override this value as they see fit. A common use case could be rounding up/down to achieve groupings of items, which was the intention of #12
Had to remove the default value to avoid overload ambiguity.
This maintains binary compatibility.
6901db2
to
d3b5a06
Compare
Also added some docs for the new parameter
This block which returns the index which the apps wishes to snap to. The block is provided with the SnapperLayoutInfo and the index which Snapper has determined is the correct target index. Callers can override this value as they see fit.
A common use case could be rounding up/down to achieve groupings of items, which was the intention of #12.
A very simple version could look this this:
You could also look at the
layout.currentItem
to determine the fling direction to influence which direction to round.