Class

SubspaceModifierNodeElement

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

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
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

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

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.