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 componentWarmer: ComponentWarmer? = null, val estimatedViewportCount: Int? = null, val layoutHandlerFactory: LayoutHandlerFactory? = null, val rangeRatio: Float = DEFAULT_RANGE_RATIO, val enableStableIds: Boolean? = null, val wrapContent: Boolean = false, val crossAxisWrapMode: CrossAxisWrapMode = CrossAxisWrapMode.NoWrap, val paginationStrategy: Int = RecyclerBinder.PaginationStrategy.DEFAULT)

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, componentWarmer: ComponentWarmer? = null, estimatedViewportCount: Int? = null, layoutHandlerFactory: LayoutHandlerFactory? = null, rangeRatio: Float = DEFAULT_RANGE_RATIO, enableStableIds: Boolean? = null, wrapContent: Boolean = false, crossAxisWrapMode: CrossAxisWrapMode = CrossAxisWrapMode.NoWrap, paginationStrategy: Int = RecyclerBinder.PaginationStrategy.DEFAULT)

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

Specifies how a Collection will wrap its contents across the cross axis.

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. If not set, it will follow the default value set for the ComponentsConfiguration

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

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

The strategy to make Recycler stick to the last unseen item while pagination, which is only supposed to be used in full screen size surfaces like Reels.

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

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.