Start native apps faster with the Composables CLI ->
Interface

SubspaceModifier

An ordered, immutable collection of subspace modifier elements that decorate or add behavior to Subspace Compose elements.

Source set: Android
public interface SubspaceModifier

An ordered, immutable collection of subspace modifier elements that decorate or add behavior to Subspace Compose elements.

Based on androidx.compose.ui.Modifier

Functions

foldIn

Source set: Android
public fun <R> foldIn(initial: R, operation: (R, SubspaceModifierNodeElement<Node>) -> R): R

Accumulates a value starting with initial and applying operation to the current value and each SubspaceModifierNodeElement from outside in.

Parameters

initial initial value for the accumulation.
operation function to apply to the current accumulated value and the next element.

foldOut

Source set: Android
public fun <R> foldOut(initial: R, operation: (SubspaceModifierNodeElement<Node>, R) -> R): R

Accumulates a value starting with initial and applying operation to the current value and each SubspaceModifierNodeElement from inside out.

Parameters

initial initial value for the accumulation.
operation function to apply to the next element and the current accumulated value.

any

Source set: Android
public fun any(predicate: (SubspaceModifierNodeElement<Node>) -> Boolean): Boolean

Returns true if predicate returns true for any SubspaceModifierNodeElement in this SubspaceModifier.

Parameters

predicate condition to evaluate for each element.

all

Source set: Android
public fun all(predicate: (SubspaceModifierNodeElement<Node>) -> Boolean): Boolean

Returns true if predicate returns true for all SubspaceModifierNodeElements in this SubspaceModifier or if this SubspaceModifier contains no Elements.

Parameters

predicate condition to evaluate for each element.

then

Source set: Android
public infix fun then(other: SubspaceModifier): SubspaceModifier

Concatenates this modifier with another.

Returns a SubspaceModifier representing this modifier followed by other in sequence.

Parameters

other SubspaceModifier to concatenate to this one.

Members

Node

Source set: Android
public abstract class Node : DelegatableSubspaceNode

The longer-lived object that is created for each SubspaceModifierNodeElement applied to a SubspaceLayout

Properties

node

Source set: Android
override val node: Node = this

coroutineScope

Source set: Android
public val coroutineScope: CoroutineScope

A CoroutineScope that can be used to launch tasks that should run while the node is attached.

The scope is accessible between onAttach and onDetach calls, and will be cancelled after the node is detached (after onDetach returns).

isAttached

Source set: Android
public var isAttached: Boolean = false

Indicates that the node is attached to a SubspaceLayout which is part of the UI tree. This will get set to true right before onAttach is called, and set to false right after onDetach is called.

shouldAutoInvalidate

Source set: Android
public open val shouldAutoInvalidate: Boolean = true

If this property returns true, then nodes will be automatically invalidated after the modifier update completes.

This is enabled by default, and provides a convenient mechanism to schedule invalidation and apply changes made to the modifier. You may choose to set this to false if your modifier has auto-invalidatable properties that do not frequently require invalidation to improve performance by skipping unnecessary invalidation. If shouldAutoInvalidate is set to false, you must call the appropriate invalidate functions manually when the modifier is updated or else the updates may not be reflected in the UI appropriately.

Functions

onAttach

Source set: Android
public open fun onAttach()

Called when the node is attached to a SubspaceLayout which is part of the UI tree.

onDetach

Source set: Android
public open fun onDetach()

Called when the node is not attached to a SubspaceLayout anymore. Note that the node can be reattached again.

Companion

Source set: Android
public companion object : SubspaceModifier

The companion object SubspaceModifier is the empty, default, or starter SubspaceModifier that contains no SubspaceModifierNodeElements.

Functions

then

Source set: Android
public infix fun then(other: SubspaceModifierNodeElement<Node>): SubspaceModifier

toString

Source set: Android
override fun toString(): String