Builder

class Builder

A builder class that can be used to create a ComponentTree.

Functions

Link copied to clipboard

Builds a ComponentTree using the parameters specified in this builder.

Link copied to clipboard

Configures the tree with the specified configuration.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun layoutThreadHandler(handler: RunnableHandler?): ComponentTree.Builder

Specify the looper to use for running layouts on. Note that in rare cases layout must run on the UI thread. For example, if you rotate the screen, we must measure on the UI thread. If you don't specify a Looper here, the Components default Looper will be used.

Link copied to clipboard

Specify the looper to use for running layouts on. Note that in rare cases layout must run on the UI thread. For example, if you rotate the screen, we must measure on the UI thread. If you don't specify a Looper here, the Components default Looper will be used.

Link copied to clipboard
Link copied to clipboard
fun overrideComponentTreeId(overrideComponentTreeId: Int): ComponentTree.Builder

Gives the ability to override the auto-generated ComponentTree id: this is generally not useful in the majority of circumstances, so don't use it unless you really know what you're doing.

Link copied to clipboard
fun overrideRenderUnitIdMap(renderUnitIdGenerator: RenderUnitIdGenerator?, overrideComponentTreeId: Int): ComponentTree.Builder

This should not be used in majority of cases.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Specify an initial tree state object that the ComponentTree can use to set the current values for states.

Link copied to clipboard

Supplies the saveable-state registry owned by the surrounding lifecycle or navigation scope. A root tree using useSaveableState must be created through a host that supplies this scope.

Link copied to clipboard

Supplies a retained ViewModel scope owned by surrounding framework infrastructure.

Link copied to clipboard

Supplies the stable identity used to save this nested tree inside its parent registry.

Link copied to clipboard

Specify root for the component tree

Link copied to clipboard

Names this root tree for useSaveableState under the SavedStateRegistryOwner passed to create. The key replaces the root component's class as the tree's identity, so a screen can save two trees with the same root, and the next tree with this key takes over its values even when it replaces this tree while the screen is still visible. Nested trees ignore it.

Link copied to clipboard