-
public interface RotarySnapBehaviorAn interface for snapping with rotary
-
-
Method Summary
Modifier and Type Method Description abstract UnitprepareSnapForItems(Integer moveForElements, Boolean sequentialSnap)Preparing snapping. abstract UnitstartSnappingSession(Boolean toClosestItem)Performs snapping to the specified in prepareSnapForItems element If toClosestItem is true - then the snapping will happen to the closest item only. abstract FloatsnapThreshold(Boolean duringSnap)A threshold after which snapping happens. -
-
Method Detail
-
prepareSnapForItems
abstract Unit prepareSnapForItems(Integer moveForElements, Boolean sequentialSnap)
Preparing snapping. This method should be called before startSnappingSession is called.
Snapping is done for current + moveForElements items.
If sequentialSnap is true, items are summed up together. For example, if prepareSnapForItems is called with moveForElements = 2, 3, 5 -> then the snapping will happen to current + 10 items
If sequentialSnap is false, then moveForElements are not summed up together.
-
startSnappingSession
abstract Unit startSnappingSession(Boolean toClosestItem)
Performs snapping to the specified in prepareSnapForItems element If toClosestItem is true - then the snapping will happen to the closest item only. If it's set to false - then it'll snap to the element specified in prepareSnapForItems method.
-
snapThreshold
abstract Float snapThreshold(Boolean duringSnap)
A threshold after which snapping happens. There can be 2 thresholds - before snap and during snap (while snap is happening ). During-snap threshold is usually longer than before-snap so that the list will not scroll too fast.
-
-
-
-