public static class ComponentTree.Builder extends Object
ComponentTree
.Modifier | Constructor and Description |
---|---|
protected |
Builder() |
protected |
Builder(ComponentContext context,
Component root) |
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 |
canCacheDrawingDisplayLists(boolean canCacheDrawingDisplayLists)
Specify whether the ComponentTree allows to cache display lists of the components after it
was first drawng.
|
ComponentTree.Builder |
canPrefetchDisplayLists(boolean canPrefetch)
Specify whether the ComponentTree allows to prefetch display lists of its components
on idle time of UI thread.
|
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)
Deprecated.
Please don't use this unless you really need to. It is intended that this option
be removed in the future.
|
protected void |
init(ComponentContext context,
Component root) |
ComponentTree.Builder |
layoutDiffing(boolean enabled)
Whether or not to enable layout tree diffing.
|
ComponentTree.Builder |
layoutLock(Object layoutLock)
Specify a lock to be acquired during layout.
|
ComponentTree.Builder |
layoutThreadHandler(LayoutHandler 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 |
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 |
persistInternalNodeTree(boolean persistInternalNodeTree)
Whether to persist the InternalNode tree after calculating layout.
|
ComponentTree.Builder |
preAllocateMountContentHandler(LayoutHandler 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(LayoutHandler) . |
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.
|
protected void |
release() |
ComponentTree.Builder |
shouldClipChildren(boolean shouldClipChildren)
Specify whether the ComponentHosts created by this tree will clip their children.
|
ComponentTree.Builder |
shouldPreallocateMountContentPerMountSpec(boolean preallocatePerMountSpec)
If true, this ComponentTree will only preallocate mount specs that are enabled for
preallocation with
MountSpec#canPreallocate() . |
ComponentTree.Builder |
splitLayoutTag(String splitTag)
Sets a tag on this ComponentTree that will be used to identify a configuration for splitting
layout on multiple threads.
|
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 |
useSharedLayoutStateFuture(boolean useSharedLayoutStateFuture)
Whether to share a shared LayoutStateFuture between threads when calculating LayoutState to
prevent duplicate calculations of the same LayoutState on different threads.
|
protected Builder()
protected Builder(ComponentContext context, Component root)
protected void init(ComponentContext context, Component root)
protected void release()
@Deprecated public ComponentTree.Builder incrementalMount(boolean isEnabled)
IMPORTANT: if you set this to false, visibility events will not fire.
public ComponentTree.Builder layoutDiffing(boolean enabled)
public ComponentTree.Builder layoutThreadLooper(Looper looper)
public ComponentTree.Builder preAllocateMountContentHandler(LayoutHandler handler)
public ComponentTree.Builder shouldPreallocateMountContentPerMountSpec(boolean preallocatePerMountSpec)
MountSpec#canPreallocate()
. If false, it preallocates all mount
content.public ComponentTree.Builder preallocateOnDefaultHandler(boolean preallocateOnDefaultHandler)
preAllocateMountContentHandler(LayoutHandler)
.public ComponentTree.Builder layoutThreadHandler(LayoutHandler handler)
public ComponentTree.Builder layoutLock(Object layoutLock)
public ComponentTree.Builder stateHandler(StateHandler stateHandler)
public ComponentTree.Builder previousRenderState(RenderState previousRenderState)
public ComponentTree.Builder asyncStateUpdates(boolean enabled)
public ComponentTree.Builder overrideComponentTreeId(int overrideComponentTreeId)
public ComponentTree.Builder canPrefetchDisplayLists(boolean canPrefetch)
DisplayListUtils.prefetchDisplayLists(View)
should be called on scrollable surfaces like RecyclerView
during scrolling.public ComponentTree.Builder canCacheDrawingDisplayLists(boolean canCacheDrawingDisplayLists)
canPrefetchDisplayLists(boolean)
should
be set to true.public ComponentTree.Builder shouldClipChildren(boolean shouldClipChildren)
public ComponentTree.Builder hasMounted(boolean hasMounted)
public ComponentTree.Builder measureListener(ComponentTree.MeasureListener measureListener)
public ComponentTree.Builder splitLayoutTag(String splitTag)
public ComponentTree.Builder persistInternalNodeTree(boolean persistInternalNodeTree)
public ComponentTree.Builder useSharedLayoutStateFuture(boolean useSharedLayoutStateFuture)
public ComponentTree build()
ComponentTree
using the parameters specified in this builder.