public abstract class Node : DelegatableSubspaceNode
The longer-lived object that is created for each SubspaceModifierNodeElement applied to a SubspaceLayout
Properties
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
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
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.