ScrollHandler

class ScrollHandler(initialMaxValue: Float = 0.0f) : ScrollListenerHost

Handles scroll events.

Parameters

initialMaxValue

the initial maximum scroll amount.

Constructors

Link copied to clipboard
constructor(setScrollAmount: (Float) -> Unit = {}, maxScrollDistance: Float = 0.0f)

Handles scroll events.

constructor(initialMaxValue: Float = 0.0f)

Properties

Link copied to clipboard

The current scroll amount (in pixels).

Link copied to clipboard

The maximum scroll amount (in pixels).

Link copied to clipboard

The maximum scroll amount (in pixels).

Link copied to clipboard

The current scroll amount (in pixels).

Functions

Link copied to clipboard

Checks whether a scroll by the given delta value is possible.

Link copied to clipboard

Updates value to match the provided InitialScroll.

Link copied to clipboard
fun handleScroll(targetScroll: Float): Float

Updates value to targetScroll, which is restricted to the interval [0, maxValue].

Link copied to clipboard

Increments value by delta if the result of the operation belongs to the interval [0, maxValue].

Link copied to clipboard
open override fun registerScrollListener(scrollListener: ScrollListener)

Registers a ScrollListener.

Link copied to clipboard
open override fun removeScrollListener(scrollListener: ScrollListener)

Removes a ScrollListener.