Package-level declarations

Types

Link copied to clipboard
value class Visibility

The visibility of a Component, mirroring View.VISIBLE and View.INVISIBLE.

Functions

Link copied to clipboard
fun Style.onFocusedVisible(visibleWidthRatio: Float = 0.0f, visibleHeightRatio: Float = 0.0f, callback: (FocusedVisibleEvent) -> Unit): Style

Registers a callback to be called when either the Component occupies at least half of the viewport, or, if the Component is smaller than half the viewport, when it is fully visible.

Link copied to clipboard
fun Style.onFullImpression(visibleWidthRatio: Float = 0.0f, visibleHeightRatio: Float = 0.0f, callback: (FullImpressionVisibleEvent) -> Unit): Style

Registers a callback to be called when all parts of a Component have been made visible at some point, termed a "full impression". A full impression is defined as:

Link copied to clipboard
fun Style.onInvisible(visibleWidthRatio: Float = 0.0f, visibleHeightRatio: Float = 0.0f, callback: (InvisibleEvent) -> Unit): Style

Registers a callback to be called when a Component becomes fully invisible (e.g. scrolled off or unmounted).

Link copied to clipboard
fun Style.onUnfocusedVisible(visibleWidthRatio: Float = 0.0f, visibleHeightRatio: Float = 0.0f, callback: (UnfocusedVisibleEvent) -> Unit): Style

Registers a callback to be called when the Component is no longer focused, i.e. it is not fully visible and does not occupy at least half the viewport.

Link copied to clipboard
fun Style.onVisibilityChanged(visibleWidthRatio: Float = 0.0f, visibleHeightRatio: Float = 0.0f, callback: (VisibilityChangedEvent) -> Unit): Style

Registers a callback to be called when the visible rect of a Component changes.

Link copied to clipboard
fun Style.onVisible(visibleWidthRatio: Float = 0.0f, visibleHeightRatio: Float = 0.0f, callback: (VisibleEvent) -> Unit): Style

Registers a callback to be called when a Component becomes visible on screen.

Link copied to clipboard
fun Style.onVisibleWithTag(visibleWidthRatio: Float = 0.0f, visibleHeightRatio: Float = 0.0f, tag: () -> String?, callback: (VisibleEvent) -> Unit): Style

Registers a callback to be called when a Component becomes visible on screen, with a tag for identification.

Link copied to clipboard

Defines the visibility of the Component. The value can be Visibility.Visible or Visibility.Invisible; the default is Visibility.Visible.