Package-level declarations
Types
Functional interface for observing data changes in the CollectionPrimitiveViewAdapter. Implementations of this interface can be registered with the adapter to receive notifications when the underlying data set changes.
A DiffUtil.Callback that compares two lists of items and returns whether two items are the same.
Abstract class representing an item in a collection that can be rendered as a child view of a collection. This class provides the foundation for managing collection items with their rendering lifecycle.
Abstract base class for holders that manage root host views in collection items. This class serves as a foundation for view holders that need to provide access to a root view and maintain associated data for collection items.
Provide layout configuration options to a Collection
A value class that wraps an integer representing the orientation of a collection. This provides type safety and convenience methods for working with RecyclerView orientations.
This class is responsible for preparing the items in the collection. It will prepare the items that are in the viewport and the items that are in the range of the viewport.
RecyclerView adapter that can be used to render a list of CollectionItems. The adapter will create a PrimitiveRecyclerViewHolder for each item and will call CollectionItem.onBindView and CollectionItem.onViewRecycled on the holder when the item is bound and recycle respectively.
A helper class to manage scrolling behavior in the com.facebook.litho.widget.LithoRecyclerView.
A component that renders a list of items using a RecyclerView.
This class aims to generate the changeset between two lists of data and create the corresponding RenderInfo for later use.
A receiver for lambdas that create a component within a ContainerDsl. Prevents accidental calls to child()
Maps collection item metadata to a Float. Unlike (T) -> Float, this compiles to a primitive float return and avoids boxing when invoked for every item.
Maps collection item metadata with index to a Float. Unlike (Int, T) -> Float, this compiles to a primitive float return and avoids boxing when invoked for every item.
Maps collection item metadata with index to an Int. Unlike (Int, T) -> Int, this compiles to a primitive int return and avoids boxing when invoked for every item.
Predicate for collection item metadata with index. Unlike (Int, T) -> Boolean, this compiles to a primitive boolean return and avoids boxing when invoked for every item.
Class that provides scope and context information for item size constraint calculations in collection layouts. This class encapsulates the essential parameters needed to determine how individual items should be sized within a collection.
A container for the children of a Lazy Collection. Manages the creation of ids, and callback registration.
A controller that can be set on a LazyCollection to trigger external events. Most calls should be made on the main thread e.g. within a Style.onClick { } callback.
A CollectionItem that renders a LithoRenderTreeView.
A controller that manages sticky headers in a RecyclerView by tracking scroll events and maintaining a floating header view that stays visible at the top when scrolling past sticky items.
A callback triggered when a LazyCollection is scrolled "near" to a specific position, as defined by being within offset items away.
A thread pool provider that manages a pool of background handler threads for executing tasks.
A ViewHolder implementation for RecyclerView that manages primitive views through delegation. This class wraps a CollectionItemRootHostHolder delegate to provide RecyclerView compatibility while maintaining access to the underlying view and associated data.
Functions
Checks if the provided size constraints are compatible with this CollectionItem's current size constraints and measured size.
Measures the size of the Collection.
Calculates the size constraints for child items within a RecyclerView-like collection.
A scrollable collection of components arranged in a grid
A compatibility wrapper for LazyGrid that accepts a ComponentContext parameter instead of being an extension function on ResourcesScope. This function is deprecated and should only be used during KComponent migration.
A scrollable collection of components arranged linearly
A compatibility wrapper for LazyList that accepts a ComponentContext parameter instead of being an extension function on ResourcesScope. This function is deprecated and should only be used during KComponent migration.
A scrollable collection of components arranged in a staggered grid.
A compatibility wrapper for LazyStaggeredGrid that accepts a ComponentContext parameter instead of being an extension function on ResourcesScope. This function is deprecated and should only be used during KComponent migration.
An ItemDecoration to add spacing around list items in a Collection. It is intended for use with linear collections (which is the default layout, see CollectionLayouts.Linear), and wont work with grids or staggered grids.
Kotlin wrapper for the Component generated by RecyclerCollectionComponentSpec.
Scroll the LazyCollection by a given number of pixels. The Scroll is instant. For an animated scroll use smoothScrollBy.
Scroll the LazyCollection so that the child with the given id is fully visible. For an animated scroll use smoothScrollToId.
Scroll the LazyCollection so that the child at the given index is fully visible. For an animated scroll use smoothScrollToIndex.
Perform and animated scroll on the LazyCollection by a given number of pixels. For an instantaneous scroll use scrollBy.
Perform an animated scroll on the LazyCollection so that the child with the given id is fully visible. For an animated scroll use smoothScrollToId.
Perform an animated scroll on the LazyCollection so that the child at the given index is fully visible. For an instantaneous scroll use scrollToIndex.
A hook to create a cached LazyCollectionController to use with a LazyCollection.