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
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
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
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
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
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
public abstract class Node : DelegatableSubspaceNode
The longer-lived object that is created for each SubspaceModifierNodeElement applied to a SubspaceLayout
Properties
node
override val node: Node = this
coroutineScope
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
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
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
public open fun onAttach()
Called when the node is attached to a SubspaceLayout which is part of the UI tree.
onDetach
public open fun onDetach()
Called when the node is not attached to a SubspaceLayout anymore. Note that the node can be reattached again.
Companion
public companion object : SubspaceModifier
The companion object SubspaceModifier is the empty, default, or starter SubspaceModifier that contains no SubspaceModifierNodeElements.
Functions
then
public infix fun then(other: SubspaceModifierNodeElement<Node>): SubspaceModifier
toString
override fun toString(): String