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 |
enableStableIds(boolean enableStableIds)
If set, the RecyclerView adapter will have stableId support turned on.
|
RecyclerBinder.Builder |
fillListViewport(boolean fillListViewport)
Whether to fill list viewports in RecyclerBinder from measure().
|
RecyclerBinder.Builder |
fillListViewportHScrollOnly(boolean fillListViewportHScrollOnly)
Whether to fill list viewports in RecyclerBinder from measure(), but only for HScrolls.
|
RecyclerBinder.Builder |
hasDynamicItemHeight(boolean hasDynamicItemHeight)
Do not enable this.
|
RecyclerBinder.Builder |
invalidStateLogParamsList(List<ComponentLogParams> logParamsList)
Provide a list of
ComponentLogParams that will be used to log invalid states in the
LithoView, such as height being 0 while non-0 value was expected. |
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 |
splitLayoutTag(String splitLayoutTag) |
RecyclerBinder.Builder |
threadPoolForParallelFillViewportConfig(LayoutThreadPoolConfiguration threadPoolForParallelFillViewportConfig)
If set, list viewports in RecyclerBinder will be filled in measure() by calculating layouts
on multiple threads if fillListViewport or fillListViewportHScrollOnly are enabled.
|
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 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.Builder fillListViewport(boolean fillListViewport)
public RecyclerBinder.Builder fillListViewportHScrollOnly(boolean fillListViewportHScrollOnly)
public RecyclerBinder.Builder threadPoolForParallelFillViewportConfig(LayoutThreadPoolConfiguration threadPoolForParallelFillViewportConfig)
public RecyclerBinder.Builder enableStableIds(boolean enableStableIds)
public RecyclerBinder.Builder invalidStateLogParamsList(@Nullable List<ComponentLogParams> logParamsList)
ComponentLogParams
that will be used to log invalid states in the
LithoView, such as height being 0 while non-0 value was expected.public RecyclerBinder.Builder splitLayoutTag(String splitLayoutTag)
public RecyclerBinder build(ComponentContext c)
c
- The ComponentContext
the RecyclerBinder will use.