RecyclerBinderConfig
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
Properties
Defines if an overriding com.facebook.litho.config.ComponentsConfiguration should be used in the com.facebook.litho.ComponentTree used in the RecyclerBinder hierarchy.
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.
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
.
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.
Do not enable this. This is an experimental feature and your Section surface will take a perf hit if you use it.
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.
Whether the underlying RecyclerBinder will have a circular behaviour. Defaults to false.
Set the number of offscreen views to retain before adding them to the potentially shared recycled view pool.
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.
The factory that will be used to create the nested com.facebook.litho.LithoView inside Section/LazyCollection.
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.
Experimental. Specifies the delay in milliseconds for the view recycle runnable if postponing of the view recycling is enabled.
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.
Set whether item prefetch should be enabled on the underlying RecyclerView.LayoutManager. Defaults to false.
Enable pre-mounting for pre-fetched items, which requires to turn on RecyclerView's item prefetching first.
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.
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.