RecyclerBinderConfig

data class RecyclerBinderConfig(val componentsConfiguration: ComponentsConfiguration? = null, val isCircular: Boolean = false, val lithoViewFactory: LithoViewFactory? = null, val hScrollAsyncMode: Boolean = false, val requestMountForPrefetchedItems: Boolean = false, val recyclerViewItemPrefetch: Boolean = false, val itemViewCacheSize: Int = 0, val postponeViewRecycle: Boolean = false, val postponeViewRecycleDelayMs: Int = 0, val componentWarmer: ComponentWarmer? = null, val estimatedViewportCount: Int? = null, val hasDynamicItemHeight: Boolean = false, val layoutHandlerFactory: LayoutHandlerFactory? = null, val threadPoolConfig: LayoutThreadPoolConfiguration? = null, val rangeRatio: Float = DEFAULT_RANGE_RATIO, val enableStableIds: Boolean = ComponentsConfiguration.defaultRecyclerBinderUseStableId, val wrapContent: Boolean = false)

This configuration is meant to be used in the context of RecyclerBinder. It allows you to define to define specific behavior changes to the default behaviour of the RecyclerBinder.

At this point, we are still in a transition phase where a lot of configs still live in the RecyclerBinder.Builder, but we aim to move all of them here.

Constructors

Link copied to clipboard
constructor(componentsConfiguration: ComponentsConfiguration? = null, isCircular: Boolean = false, lithoViewFactory: LithoViewFactory? = null, hScrollAsyncMode: Boolean = false, requestMountForPrefetchedItems: Boolean = false, recyclerViewItemPrefetch: Boolean = false, itemViewCacheSize: Int = 0, postponeViewRecycle: Boolean = false, postponeViewRecycleDelayMs: Int = 0, componentWarmer: ComponentWarmer? = null, estimatedViewportCount: Int? = null, hasDynamicItemHeight: Boolean = false, layoutHandlerFactory: LayoutHandlerFactory? = null, threadPoolConfig: LayoutThreadPoolConfiguration? = null, rangeRatio: Float = DEFAULT_RANGE_RATIO, enableStableIds: Boolean = ComponentsConfiguration.defaultRecyclerBinderUseStableId, wrapContent: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Set pool for pre-computing and storing ComponentTree, which can be used to pre-compute and store ComponentTrees before they are inserted in a RecyclerBinder.

Link copied to clipboard

If set, the RecyclerView adapter will have stableId support turned on. Please note that this configuration will be disregarded in case isCircular is set to true.

Link copied to clipboard

This is used in very specific cases on critical performance paths where measuring the first item cannot be relied on to estimate the viewport count. It should not be used in the common case, use with caution.

Link copied to clipboard

Do not enable this. This is an experimental feature and your Section surface will take a perf hit if you use it.

Link copied to clipboard

Experimental. Configuration to change the behavior of HScroll's when they are nested within a vertical scroll. With this mode, the hscroll will attempt to compute all layouts in the background before mounting so that no layouts are computed on the main thread. All subsequent insertions will be treated with LAYOUT_BEFORE_INSERT policy to ensure those layouts also do not happen on the main thread.

Link copied to clipboard

Whether the underlying RecyclerBinder will have a circular behaviour. Defaults to false.

Link copied to clipboard

Set the number of offscreen views to retain before adding them to the potentially shared recycled view pool.

Link copied to clipboard

The RecyclerBinder will use this LayoutHandlerFactory when creating com.facebook.litho.ComponentTree in order to specify on which thread layout calculation should happen. Setting it to null means that the computation will be done in the background thread.

Link copied to clipboard

The factory that will be used to create the nested com.facebook.litho.LithoView inside Section/LazyCollection.

Link copied to clipboard

Experimental. Postpones the view recycle logic (unmounts and unbinds) until the next frame following the scroll. This option is intended for scroll performance optimization of paged setups as it allows running the expensive logic after the final frame of scroll has been displayed to the user.

Link copied to clipboard

Experimental. Specifies the delay in milliseconds for the view recycle runnable if postponing of the view recycling is enabled.

Link copied to clipboard

Ratio to determine the number of components before and after the androidx.recyclerview.widget.RecyclerView's total number of currently visible items to have their com.facebook.litho.Component layout computed ahead of time.

Link copied to clipboard

Set whether item prefetch should be enabled on the underlying RecyclerView.LayoutManager. Defaults to false.

Link copied to clipboard

Enable pre-mounting for pre-fetched items, which requires to turn on RecyclerView's item prefetching first.

Link copied to clipboard

RecyclerBinder will use this LayoutThreadPoolConfiguration to create com.facebook.litho.ThreadPoolLayoutHandler this will create a new separate thread pool which might negatively affect the app's RecyclerBinder.Builder.layoutHandlerFactory is provided, the handler created by the factory will be used instead of the one that would have been created by this config.

Link copied to clipboard

If true, the 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.