SnapperLayoutInfo

abstract class SnapperLayoutInfo

Contains the necessary information about the scrolling layout for SnapperFlingBehavior to determine how to fling.

Constructors

Link copied to clipboard
fun SnapperLayoutInfo()

Functions

Link copied to clipboard
abstract fun canScrollTowardsEnd(): Boolean

Returns true if the layout has some scroll range remaining to scroll towards the end.

Link copied to clipboard
abstract fun canScrollTowardsStart(): Boolean

Returns true if the layout has some scroll range remaining to scroll towards the start.

Link copied to clipboard
abstract fun determineTargetIndex(    velocity: Float,     decayAnimationSpec: DecayAnimationSpec<Float>,     maximumFlingDistance: Float): Int

Calculate the desired target which should be scrolled to for the given velocity.

Link copied to clipboard
abstract fun distanceToIndexSnap(index: Int): Int

Calculate the distance in pixels needed to scroll to the given index. The value returned signifies which direction to scroll in:

Properties

Link copied to clipboard
abstract val currentItem: SnapperLayoutItemInfo?

The current item which covers the desired snap point, or null if there is no item. The item returned may not yet currently be snapped into the final position.

Link copied to clipboard
abstract val endScrollOffset: Int

The end offset of where items can be scrolled to. This value should only include scrollable regions. For example this should not include fixed content padding. For most layouts, this will the width of the container, minus content padding.

Link copied to clipboard
abstract val startScrollOffset: Int

The start offset of where items can be scrolled to. This value should only include scrollable regions. For example this should not include fixed content padding. For most layouts, this will be 0.

Link copied to clipboard
abstract val totalItemsCount: Int

The total count of items attached to the layout.

Link copied to clipboard
abstract val visibleItems: Sequence<SnapperLayoutItemInfo>

A sequence containing the currently visible items in the layout.

Inheritors

Link copied to clipboard

Sources

Link copied to clipboard