public interface DelegatableSubspaceNode
Represents a SubspaceModifier.Node which can be a delegate of another SubspaceModifier.Node. Since SubspaceModifier.Node implements this interface, in practice any SubspaceModifier.Node can be delegated.
This interface is conceptually similar to androidx.compose.ui.node.DelegatableNode from 2D Compose, but it intentionally exposes a minimal subset of functionality to meet current Jetpack XR Compose requirements. This approach aims to reduce complexity and avoid prematurely adopting concepts from 2D Compose that may not apply or may have different implications in a 3D context.
For example, callbacks like onDensityChange or onLayoutDirectionChange found in the 2D version are not currently included.
This design choice follows guidance to tailor the API to the specific needs of XR and avoid unnecessary inherited complexity (see b/483999028 for API review context).
If additional capabilities from 2D Compose are needed in the future, they can potentially be added to this interface. To maintain backward compatibility, such additions should provide default implementations, avoiding breaking changes for external implementations. In the meantime, users requiring more advanced node access can often utilize extension functions like requireCoordinator and requireOwner, or directly access properties on SubspaceModifier.Node.
Properties
node
public val node: SubspaceModifier.Node
A reference of the SubspaceModifier.Node that holds this node's position in the node hierarchy. If the node is a delegate of another node, this will point to the root delegating node that is actually part of the node tree. Otherwise, this will point to itself.