Interface ISnapConfig
interface ISnapConfig
Extends com.amazon.apmf.IStandard
The interface for retrieving Snap configuration.
This interface defines methods for retrieving configuration parameters
related to Snap animations.
Methods
getSnapToInterval()
float getSnapToInterval()
Get the snapping interval for touch scrolling.
When set, the snapping interval causes the Scrollable to stop at multiples of the value of
snapToInterval during touch scrolling. This can be used for paginating through children that have
lengths smaller than the scrollable. Typically, this is used in combination with snapToAlignment.
Returns
float
The snapping interval if enabled, or 0.0f if snapping is disabled.
getSnapToAlignment()
ScrollSnapAlignment getSnapToAlignment()
Get the alignment of snap points within this Scrollable.
Use this method to retrieve where snaps will stop in relation to this Scrollable. The alignment
specifies whether snaps will align with the start, center, or end of the Scrollable.
Returns
ScrollSnapAlignment
The ScrollSnapAlignment enum value representing the snap alignment.
shouldSnapToStart()
bool shouldSnapToStart()
Check if snapping to the start position is enabled.
This method checks whether snapping to the start of the list is enabled. By default,
the beginning of the list counts as a snap offset. You can disable this behavior by
setting snapToStart to false to allow the list to scroll freely between its start
and the first snapToOffsets offset.
Returns
bool
true if snapping to the start is enabled, false otherwise.
shouldSnapToEnd()
bool shouldSnapToEnd()
Check if snapping to the end position is enabled.
This method checks whether snapping to the end of the list is enabled. By default,
the end of the list counts as a snap offset. You can disable this behavior by
setting snapToEnd to false to allow the list to scroll freely between its end
and the last snapToOffsets offset.
Returns
bool
true if snapping to the end is enabled, false otherwise.
getSnapToOffsets()
float[] getSnapToOffsets()
Get the array of predefined snap offsets used during scrolling animations.
This method returns an array of float values representing the predefined snap offsets
used during scrolling animations. These offsets are used when snapping behavior is
enabled, and scrolling animations align with one of these positions when they come to a stop.
Returns
float[]
Array of float values representing predefined snap offsets.
isPagingEnabled()
bool isPagingEnabled()
Check if paging behavior is currently enabled for scrolling animations.
Paging behavior is often used in scrollable views to align the content to discrete
pages or items. When paging is enabled, scrolling animations will snap to the nearest
page boundary, providing a smooth and predictable user experience.
Returns
bool
true if paging behavior is enabled, or false if disabled.

