ScrollIndicatorState


Represents the state required to draw a scroll indicator (e.g., a scrollbar), which is typically provided by a scrollable component.

For scrollable components with a large number of items, such as lazy layouts, implementations may need to provide a reasonable heuristic for properties like scrollOffset and contentSize, as calculating the exact value might be computationally expensive or impossible.

Summary

Public properties

Int

The total size of the scrollable content, typically in pixels.

Cmn
Int

The current scroll offset of the content from the start, typically in pixels.

Cmn
Int

The size of the visible portion of the scrollable content, typically in pixels.

Cmn

Public properties

contentSize

val contentSizeInt

The total size of the scrollable content, typically in pixels.

For a vertical scrollable component, this is the total height of the content. For a horizontal scrollable component, this is the total width of the content.

For lazy layouts, this value may represent an estimated total size of content, and may change as scrollOffset changes.

The scroll range (how far the content can scroll) can be determined by subtracting the viewportSize from this contentSize.

Implementations should return Int.MAX_VALUE if this value is not yet known.

scrollOffset

val scrollOffsetInt

The current scroll offset of the content from the start, typically in pixels.

For a vertical scrollable component, this is the Y offset. For a horizontal scrollable component, this is the X offset.

For lazy layouts, this value may represent an estimated scroll offset.

Implementations should return Int.MAX_VALUE if this value is not yet known.

viewportSize

val viewportSizeInt

The size of the visible portion of the scrollable content, typically in pixels.

For a vertical scrollable component, this is the height of the viewport. For a horizontal scrollable component, this is the width of the viewport.

Implementations should return Int.MAX_VALUE if this value is not yet known.