public static class ComponentTree.Builder
extends java.lang.Object
ComponentTree
.Modifier | Constructor and Description |
---|---|
protected |
Builder(ComponentContext context) |
Modifier and Type | Method and Description |
---|---|
ComponentTree.Builder |
asyncStateUpdates(boolean enabled)
Specify whether the ComponentTree allows async state updates.
|
ComponentTree |
build()
Builds a
ComponentTree using the parameters specified in this builder. |
ComponentTree.Builder |
canInterruptAndMoveLayoutsBetweenThreads(boolean isEnabled)
Experimental, do not use! If enabled, a layout computation can be interrupted on a bg thread
and resumed on the UI thread if it's needed immediately.
|
ComponentTree.Builder |
componentsConfiguration(ComponentsConfiguration componentsConfiguration) |
ComponentTree.Builder |
errorHandler(ErrorEventHandler errorEventHandler)
Sets the custom ErrorEventHandler.
|
ComponentTree.Builder |
hasMounted(boolean hasMounted)
Sets whether the 'hasMounted' flag should be set on this ComponentTree (for use with appear
animations).
|
ComponentTree.Builder |
incrementalMount(boolean isEnabled)
Whether or not to enable the incremental mount optimization.
|
ComponentTree.Builder |
isFirstMount(boolean isFirstMount) |
ComponentTree.Builder |
isReconciliationEnabled(boolean isEnabled)
Sets if reconciliation is enabled
|
ComponentTree.Builder |
layoutDiffing(boolean enabled)
Deprecated.
|
ComponentTree.Builder |
layoutThreadHandler(RunnableHandler handler)
Specify the looper to use for running layouts on.
|
ComponentTree.Builder |
layoutThreadLooper(Looper looper)
Specify the looper to use for running layouts on.
|
ComponentTree.Builder |
logger(ComponentsLogger logger,
java.lang.String logTag) |
ComponentTree.Builder |
measureListener(ComponentTree.MeasureListener measureListener) |
ComponentTree.Builder |
overrideComponentTreeId(int overrideComponentTreeId)
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.
|
ComponentTree.Builder |
overrideRenderUnitIdMap(ComponentTree prevComponentTree)
This should not be used in majority of cases and should only be used when overriding previous
component tree id
overrideComponentTreeId |
ComponentTree.Builder |
preAllocateMountContentHandler(RunnableHandler handler)
Specify the handler for to preAllocateMountContent
|
ComponentTree.Builder |
previousRenderState(RenderState previousRenderState)
Specify an existing previous render state that the ComponentTree can use to set the current
values for providing previous versions of @Prop/@State variables.
|
ComponentTree.Builder |
shouldPreallocateMountContentPerMountSpec(boolean preallocatePerMountSpec)
If true, this ComponentTree will only preallocate mount specs that are enabled for
preallocation with
MountSpec#canPreallocate() . |
ComponentTree.Builder |
treeState(TreeState treeState)
Specify an initial tree state object that the ComponentTree can use to set the current values
for states.
|
ComponentTree.Builder |
useDefaultHandlerForContentPreallocation()
Enable Mount Content preallocation using the same thread we use to compute layouts
|
ComponentTree.Builder |
visibilityProcessing(boolean isEnabled) |
ComponentTree.Builder |
withLithoLifecycleProvider(LithoLifecycleProvider lifecycleProvider) |
ComponentTree.Builder |
withRoot(Component root)
Specify root for the component tree
|
protected Builder(ComponentContext context)
public ComponentTree.Builder componentsConfiguration(ComponentsConfiguration componentsConfiguration)
public ComponentTree.Builder withRoot(Component root)
IMPORTANT: If you do not set this, a default root will be set and you can reset root after build and attach of the component tree
public ComponentTree.Builder withLithoLifecycleProvider(LithoLifecycleProvider lifecycleProvider)
public ComponentTree.Builder incrementalMount(boolean isEnabled)
IMPORTANT: if you set this to false, visibility events will NOT FIRE. Please don't use this unless you really need to.
public ComponentTree.Builder visibilityProcessing(boolean isEnabled)
@Deprecated public ComponentTree.Builder layoutDiffing(boolean enabled)
We will remove this option soon, please consider turning it on (which is on by default)
public ComponentTree.Builder layoutThreadLooper(Looper looper)
public ComponentTree.Builder preAllocateMountContentHandler(RunnableHandler handler)
public ComponentTree.Builder useDefaultHandlerForContentPreallocation()
public ComponentTree.Builder shouldPreallocateMountContentPerMountSpec(boolean preallocatePerMountSpec)
MountSpec#canPreallocate()
. If false, it preallocates all mount
content.public ComponentTree.Builder layoutThreadHandler(RunnableHandler handler)
public ComponentTree.Builder treeState(TreeState treeState)
public ComponentTree.Builder previousRenderState(RenderState previousRenderState)
public ComponentTree.Builder asyncStateUpdates(boolean enabled)
public ComponentTree.Builder overrideComponentTreeId(int overrideComponentTreeId)
public ComponentTree.Builder overrideRenderUnitIdMap(ComponentTree prevComponentTree)
overrideComponentTreeId
prevComponentTree
- Previous ComponentTree to override the render unit id mappublic ComponentTree.Builder hasMounted(boolean hasMounted)
public ComponentTree.Builder isFirstMount(boolean isFirstMount)
public ComponentTree.Builder measureListener(ComponentTree.MeasureListener measureListener)
public ComponentTree.Builder isReconciliationEnabled(boolean isEnabled)
public ComponentTree.Builder errorHandler(ErrorEventHandler errorEventHandler)
public ComponentTree.Builder canInterruptAndMoveLayoutsBetweenThreads(boolean isEnabled)
public ComponentTree.Builder logger(ComponentsLogger logger, java.lang.String logTag)
public ComponentTree build()
ComponentTree
using the parameters specified in this builder.