Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ISnapConfigBuilder

interface ISnapConfigBuilder
Extends com.amazon.apmf.IStandard The interface for building Snap configuration objects. This interface defines methods for setting various configuration parameters for Snap animations and building a corresponding Snap configuration object.

Methods

snapToInterval()

void snapToInterval(float interval)
Set the snapping interval. 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.

Parameters

interval
float — Required The snapping interval to set. Value = 0.0f disables interval snapping, while any other non-zero value enables interval snapping.

snapToAlignment()

void snapToAlignment(ScrollSnapAlignment alignment)
Set the alignment of snap points within this Scrollable. Use this method to specify where snaps will stop in relation to this Scrollable. The alignment determines whether snaps will align with the start, center, or end of the Scrollable.

Parameters

alignment
ScrollSnapAlignment — Required The ScrollSnapAlignment enum value specifying the snap alignment. Default is ScrollSnapAlignment::Start

snapToStart()

void snapToStart(bool snapToStart)
Enable or disable snapping to the start position during scrolling animations. Use this method to enable or disable snapping to the start position. By default, the beginning of the list counts as a snap offset. Setting snapToStart to false allows the list to scroll freely between its start and the first snapToOffsets offset.

Parameters

snapToStart
bool — Required Set to true to enable snapping to the start position, or false to disable it.

snapToEnd()

void snapToEnd(bool snapToEnd)
Enable or disable snapping to the end position during scrolling animations. This method allows you to control whether scrolling animations should snap to the end position when the animation comes to a stop. When snapping to the end is enabled, the view will align with the end position once the animation finishes.

Parameters

snapToEnd
bool — Required Set to true to enable snapping to the end position, or false to disable it. Note: By default, the end of the list counts as a snap offset. Setting snapToEnd to false allows the list to scroll freely between its end and the last snapToOffsets offset.

snapToOffsets()

void snapToOffsets(float[] snapToOffsets)
Set an array of predefined offsets for snapping during scrolling animations. This method allows you to specify an array of predefined offsets to which scrolling animations can snap when they come to a stop. Enabling snapping via setSnapToOffsets and providing these offsets ensures that the view aligns with one of these positions when the animation ends.

Parameters

snapToOffsets
float[] — Required An array of float values representing predefined snap offsets. Note: When set, these predefined offsets cause the scrollable to stop at these defined positions. This can be used for paginating through variously sized children that have lengths smaller than the scrollable. It’s typically used in combination with a fast deceleration rate and overrides less configurable properties like pagingEnabled and snapToInterval.

pagingEnabled()

void pagingEnabled(bool pagingEnabled)
Enable or disable paging behavior 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.

Parameters

pagingEnabled
bool — Required Set to true to enable paging behavior, or false to disable it.

build()

ISnapConfig* build()
This method creates the instance of ISnapConfig

Returns

ISnapConfig* The new ISnapConfig instance.
Last modified on October 29, 2026