public static class ComponentTree.Builder extends 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 |
hasMounted(boolean hasMounted)
Sets whether the 'hasMounted' flag should be set on this ComponentTree (for use with appear
animations).
|
ComponentTree.Builder |
hooksHandler(HooksHandler hooksHandler) |
ComponentTree.Builder |
incrementalMount(boolean isEnabled)
Whether or not to enable the incremental mount optimization.
|
ComponentTree.Builder |
incrementalVisibility(boolean isEnabled) |
ComponentTree.Builder |
isFirstMount(boolean isFirstMount) |
ComponentTree.Builder |
isReconciliationEnabled(boolean isEnabled)
Sets if reconciliation is enabled
|
ComponentTree.Builder |
layoutDiffing(boolean enabled)
Deprecated.
|
ComponentTree.Builder |
layoutThreadHandler(LithoHandler 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,
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 |
preAllocateMountContentHandler(LithoHandler handler)
Specify the handler for to preAllocateMountContent
|
ComponentTree.Builder |
preallocateOnDefaultHandler(boolean preallocateOnDefaultHandler)
If true, mount content preallocation will use a default layout handler to preallocate mount
content on a background thread if no other layout handler is provided through
preAllocateMountContentHandler(LithoHandler) . |
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 |
recyclingMode(int recyclingMode)
Experimental, do not use!! If used recycling for components may not happen.
|
ComponentTree.Builder |
shouldPreallocateMountContentPerMountSpec(boolean preallocatePerMountSpec)
If true, this ComponentTree will only preallocate mount specs that are enabled for
preallocation with
MountSpec#canPreallocate() . |
ComponentTree.Builder |
stateHandler(StateHandler stateHandler)
Specify an initial state handler object that the ComponentTree can use to set the current
values for states.
|
ComponentTree.Builder |
useCancelableLayoutFutures(boolean isEnabled)
Experimental, do not use! If enabled, cancel a layout calculation before it finishes if
there's another layout pending with a newer state of the ComponentTree.
|
ComponentTree.Builder |
visibilityProcessing(boolean isEnabled) |
ComponentTree.Builder |
withRoot(Component root)
Specify root for the component tree
|
protected Builder(ComponentContext context)
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 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(LithoHandler handler)
public ComponentTree.Builder shouldPreallocateMountContentPerMountSpec(boolean preallocatePerMountSpec)
MountSpec#canPreallocate()
. If false, it preallocates all mount
content.public ComponentTree.Builder preallocateOnDefaultHandler(boolean preallocateOnDefaultHandler)
preAllocateMountContentHandler(LithoHandler)
.public ComponentTree.Builder layoutThreadHandler(LithoHandler handler)
public ComponentTree.Builder stateHandler(StateHandler stateHandler)
public ComponentTree.Builder hooksHandler(HooksHandler hooksHandler)
public ComponentTree.Builder previousRenderState(RenderState previousRenderState)
public ComponentTree.Builder asyncStateUpdates(boolean enabled)
public ComponentTree.Builder overrideComponentTreeId(int overrideComponentTreeId)
public 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 recyclingMode(int recyclingMode)
public ComponentTree.Builder useCancelableLayoutFutures(boolean isEnabled)
public ComponentTree.Builder incrementalVisibility(boolean isEnabled)
public ComponentTree.Builder canInterruptAndMoveLayoutsBetweenThreads(boolean isEnabled)
public ComponentTree.Builder logger(ComponentsLogger logger, String logTag)
public ComponentTree build()
ComponentTree
using the parameters specified in this builder.