public static class RecyclerBinder.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
RecyclerBinder |
build(ComponentContext c) |
RecyclerBinder.Builder |
canCacheDrawingDisplayLists(boolean canCacheDrawingDisplayLists) |
RecyclerBinder.Builder |
canPrefetchDisplayLists(boolean canPrefetchDisplayLists) |
RecyclerBinder.Builder |
componentTreeHolderFactory(com.facebook.litho.widget.RecyclerBinder.ComponentTreeHolderFactory componentTreeHolderFactory) |
RecyclerBinder.Builder |
enableCustomViewType(int componentViewType)
Enable setting custom viewTypes on
ViewRenderInfo s. |
RecyclerBinder.Builder |
hasDynamicItemHeight(boolean hasDynamicItemHeight)
Do not enable this.
|
RecyclerBinder.Builder |
insertPostAsyncLayoutEnabled(boolean insertPostAsyncLayoutEnabled)
TODO (T26795745): remove this once the experiment is finished.
|
RecyclerBinder.Builder |
isCircular(boolean isCircular)
Whether the underlying RecyclerBinder will have a circular behaviour.
|
RecyclerBinder.Builder |
layoutHandlerFactory(LayoutHandlerFactory layoutHandlerFactory) |
RecyclerBinder.Builder |
layoutInfo(LayoutInfo layoutInfo) |
RecyclerBinder.Builder |
lithoViewFactory(LithoViewFactory lithoViewFactory) |
RecyclerBinder.Builder |
rangeRatio(float rangeRatio) |
RecyclerBinder.Builder |
wrapContent(boolean wrapContent)
If true, the underlying RecyclerBinder will measure the parent height by the height of
children if the orientation is vertical, or measure the parent width by the width of children
if the orientation is horizontal.
|
public RecyclerBinder.Builder rangeRatio(float rangeRatio)
rangeRatio
- specifies how big a range this binder should try to compute. The range is
computed as number of items in the viewport (when the binder is measured) multiplied by the
range ratio. The ratio is to be intended in both directions. For example a ratio of 1 means
that if there are currently N components on screen, the binder should try to compute the
layout for the N components before the first component on screen and for the N components
after the last component on screen. If not set, defaults to 4f.public RecyclerBinder.Builder layoutInfo(LayoutInfo layoutInfo)
layoutInfo
- an implementation of LayoutInfo
that will expose information about
the LayoutManager
this RecyclerBinder will use. If not set, it will default to a
vertical list.public RecyclerBinder.Builder layoutHandlerFactory(LayoutHandlerFactory layoutHandlerFactory)
layoutHandlerFactory
- the RecyclerBinder will use this layoutHandlerFactory when
creating ComponentTree
s in order to specify on which thread layout calculation
should happen.public RecyclerBinder.Builder lithoViewFactory(LithoViewFactory lithoViewFactory)
public RecyclerBinder.Builder canPrefetchDisplayLists(boolean canPrefetchDisplayLists)
public RecyclerBinder.Builder canCacheDrawingDisplayLists(boolean canCacheDrawingDisplayLists)
public RecyclerBinder.Builder isCircular(boolean isCircular)
public RecyclerBinder.Builder wrapContent(boolean wrapContent)
public RecyclerBinder.Builder componentTreeHolderFactory(com.facebook.litho.widget.RecyclerBinder.ComponentTreeHolderFactory componentTreeHolderFactory)
componentTreeHolderFactory
- Factory to acquire a new ComponentTreeHolder. Defaults to
RecyclerBinder.DEFAULT_COMPONENT_TREE_HOLDER_FACTORY
.public RecyclerBinder.Builder hasDynamicItemHeight(boolean hasDynamicItemHeight)
Whether the items of this RecyclerBinder can change height after the initial measure. Only applicable to horizontally scrolling RecyclerBinders. If true, the children of this h-scroll are all measured with unspecified height. When the ComponentTree of a child is remeasured, this will cause the RecyclerBinder to remeasure in case the height of the child changed and the RecyclerView needs to have a different height to account for it. This only supports changing the height of the item that triggered the remeasuring, not the height of all items in the h-scroll.
public RecyclerBinder.Builder insertPostAsyncLayoutEnabled(boolean insertPostAsyncLayoutEnabled)
Do not enable this. This is an experimental feature and your Section surface will take a perf hit if you use it.
If true, insert operations won't start async layout calculations for the items in range, instead these layout calculations will be posted to the next frame.
public RecyclerBinder.Builder enableCustomViewType(int componentViewType)
ViewRenderInfo
s.
After this is set, all ViewRenderInfo
s must be built with a custom viewType
through ViewRenderInfo.Builder.customViewType(int)
, otherwise exception will be
thrown.
componentViewType
- the viewType to be used for Component types, provided through ComponentRenderInfo
. Set this to a value that won't conflict with your custom viewTypes.public RecyclerBinder build(ComponentContext c)
c
- The ComponentContext
the RecyclerBinder will use.