Class

SubspaceModifierNodeElement

Modifier elements manage an instance of a particular SubspaceModifier.Node implementation.

Source set: Android
public abstract class SubspaceModifierNodeElement<N : SubspaceModifier.Node> : SubspaceModifier

Modifier elements manage an instance of a particular SubspaceModifier.Node implementation. A given SubspaceModifier.Node implementation can only be used when a SubspaceModifierNodeElement, which creates and updates that implementation, is applied to a layout.

A SubspaceModifierNodeElement should be very lightweight, and do little more than hold the information necessary to create and maintain an instance of the associated SubspaceModifier.Node type.

Parameters

N The type of node that this element creates and updates.

Functions

create

Source set: Android
public abstract fun create(): N

This will be called the first time the modifier is applied to the layout and it should construct and return the corresponding SubspaceModifier.Node instance.

update

Source set: Android
public abstract fun update(node: N)

Called when a modifier is applied to a layout whose inputs have changed from the previous application. This function will have the current node instance passed in as a parameter, and it is expected that the node will be brought up to date.

Parameters

node The node instance to be updated.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: