Package-level declarations

Types

Link copied to clipboard
data class CollectionChild(    val id: Any,     val component: Component? = null,     val componentFunction: () -> Component?? = null,     val isSticky: Boolean = false,     val isFullSpan: Boolean = false,     val spanSize: Int? = null,     val parentWidthPercent: Float = -1f,     val parentHeightPercent: Float = -1f,     val deps: Array<Any?>? = null,     val customAttributes: Map<String, Any?>? = null,     val onNearViewport: OnNearCallback? = null)
Link copied to clipboard
Link copied to clipboard
abstract class CollectionLayout(    componentContext: ComponentContext,     orientation: Int,     reverse: Boolean,     rangeRatio: Float? = null,     useBackgroundChangeSets: Boolean = false,     isIncrementalMountEnabled: Boolean = componentContext.lithoConfiguration.componentsConfig.incrementalMountEnabled,     mainAxisWrapContent: Boolean = false,     crossAxisWrapMode: CrossAxisWrapMode = CrossAxisWrapMode.NoWrap,     preAllocationHandler: PreAllocationHandler?,     isCircular: Boolean,     enableStableIds: Boolean)

Provide layout configuration options to a Collection

Link copied to clipboard
Link copied to clipboard

A receiver for lambdas that create a component within a ContainerDsl. Prevents accidental calls to child()

Link copied to clipboard
class LazyCollection(    layout: CollectionLayout,     itemAnimator: RecyclerView.ItemAnimator?,     itemDecoration: RecyclerView.ItemDecoration? = null,     clipToPadding: Boolean? = null,     clipChildren: Boolean? = null,     startPadding: Dimen? = null,     endPadding: Dimen? = null,     topPadding: Dimen? = null,     bottomPadding: Dimen? = null,     nestedScrollingEnabled: Boolean? = null,     scrollBarStyle: Int? = null,     recyclerViewId: Int? = null,     overScrollMode: Int? = null,     refreshProgressBarColor: Int? = null,     touchInterceptor: LithoRecyclerView.TouchInterceptor? = null,     itemTouchListener: RecyclerView.OnItemTouchListener? = null,     sectionTreeTag: String? = null,     startupLogger: LithoStartupLogger? = null,     style: Style? = null,     onViewportChanged: OnViewportChanged? = null,     onDataBound: () -> Unit? = null,     handle: Handle? = null,     onPullToRefresh: () -> Unit? = null,     onNearEnd: OnNearCallback? = null,     onScrollListener: RecyclerView.OnScrollListener? = null,     onScrollListeners: List<RecyclerView.OnScrollListener?>? = null,     lazyCollectionController: LazyCollectionController? = null,     onDataRendered: OnDataRendered? = null,     childEquivalenceIncludesCommonProps: Boolean = true,     alwaysDetectDuplicates: Boolean = false,     isLeftFadingEnabled: Boolean = true,     isRightFadingEnabled: Boolean = true,     isTopFadingEnabled: Boolean = true,     isBottomFadingEnabled: Boolean = true,     fadingEdgeLength: Dimen? = null,     shouldExcludeFromIncrementalMount: Boolean = false,     onBeforeLayout: LithoRecyclerView.OnBeforeLayoutListener? = null,     onAfterLayout: LithoRecyclerView.OnAfterLayoutListener? = null,     lazyCollectionChildren: LazyCollectionChildren) : KComponent
Link copied to clipboard

A container for the children of a Lazy Collection. Manages the creation of ids, and callback registration.

Link copied to clipboard

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.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class LinearSpacingItemDecoration(    @Px val all: Int? = null,     @Px val between: Int? = null,     @Px val start: Int? = null,     @Px val end: Int? = null) : RecyclerView.ItemDecoration
Link copied to clipboard
typealias OnDataRendered = (isDataChanged: Boolean, isMounted: Boolean, monoTimestampMs: Long, firstVisibleIndex: Int, lastVisibleIndex: Int, changesInfo: ChangesInfo, globalOffset: Int) -> Unit
Link copied to clipboard
class OnNearCallback(val offset: Int = 0, val callback: () -> Unit)

A callback triggered when a LazyCollection is scrolled "near" to a specific position, as defined by being within offset items away.

Link copied to clipboard
typealias OnViewportChanged = (firstVisibleIndex: Int, lastVisibleIndex: Int, totalCount: Int, firstFullyVisibleIndex: Int, lastFullyVisibleIndex: Int) -> Unit

Functions

Link copied to clipboard
inline fun ResourcesScope.LazyGrid(    orientation: Int = RecyclerView.VERTICAL,     snapMode: Int = SnapUtil.SNAP_NONE,     snapToStartOffset: Dimen = 0.dp,     reverse: Boolean = false,     columns: Int = 2,     itemAnimator: RecyclerView.ItemAnimator? = CollectionRecyclerSpec.itemAnimator,     itemDecoration: RecyclerView.ItemDecoration? = null,     clipToPadding: Boolean? = null,     clipChildren: Boolean? = null,     startPadding: Dimen? = null,     endPadding: Dimen? = null,     topPadding: Dimen? = null,     bottomPadding: Dimen? = null,     nestedScrollingEnabled: Boolean? = null,     scrollBarStyle: Int? = null,     recyclerViewId: Int? = null,     overScrollMode: Int? = null,     refreshProgressBarColor: Int? = null,     touchInterceptor: LithoRecyclerView.TouchInterceptor? = null,     itemTouchListener: RecyclerView.OnItemTouchListener? = null,     sectionTreeTag: String? = null,     startupLogger: LithoStartupLogger? = null,     style: Style? = null,     noinline onViewportChanged: OnViewportChanged? = null,     noinline onDataBound: () -> Unit? = null,     handle: Handle? = null,     noinline onPullToRefresh: () -> Unit? = null,     onNearEnd: OnNearCallback? = null,     onScrollListener: RecyclerView.OnScrollListener? = null,     onScrollListeners: List<RecyclerView.OnScrollListener?>? = null,     lazyCollectionController: LazyCollectionController? = null,     noinline onDataRendered: OnDataRendered? = null,     rangeRatio: Float? = null,     useBackgroundChangeSets: Boolean = false,     childEquivalenceIncludesCommonProps: Boolean = true,     alwaysDetectDuplicates: Boolean = false,     isLeftFadingEnabled: Boolean = true,     isRightFadingEnabled: Boolean = true,     isTopFadingEnabled: Boolean = true,     isBottomFadingEnabled: Boolean = true,     fadingEdgeLength: Dimen? = null,     mainAxisWrapContent: Boolean = false,     preAllocationHandler: PreAllocationHandler? = context.lithoConfiguration.componentsConfig.preAllocationHandler,     shouldExcludeFromIncrementalMount: Boolean = false,     enableStableIds: Boolean = context.lithoConfiguration.componentsConfig.useStableIdsInRecyclerBinder,     gridLayoutInfoFactory: GridLayoutInfoFactory? = null,     onBeforeLayout: LithoRecyclerView.OnBeforeLayoutListener? = null,     onAfterLayout: LithoRecyclerView.OnAfterLayoutListener? = null,     crossinline init: LazyGridScope.() -> Unit): Component

A scrollable collection of components arranged in a grid

Link copied to clipboard
inline fun ResourcesScope.LazyList(    orientation: Int = RecyclerView.VERTICAL,     snapMode: Int = SnapUtil.SNAP_NONE,     snapHelper: SnapHelper? = null,     snapToStartOffset: Dimen = 0.dp,     reverse: Boolean = false,     crossAxisWrapMode: CrossAxisWrapMode = CrossAxisWrapMode.NoWrap,     mainAxisWrapContent: Boolean = false,     itemAnimator: RecyclerView.ItemAnimator? = CollectionRecyclerSpec.itemAnimator,     itemDecoration: RecyclerView.ItemDecoration? = null,     clipToPadding: Boolean? = null,     clipChildren: Boolean? = null,     startPadding: Dimen? = null,     endPadding: Dimen? = null,     topPadding: Dimen? = null,     bottomPadding: Dimen? = null,     nestedScrollingEnabled: Boolean? = null,     scrollBarStyle: Int? = null,     recyclerViewId: Int? = null,     overScrollMode: Int? = null,     refreshProgressBarColor: Int? = null,     touchInterceptor: LithoRecyclerView.TouchInterceptor? = null,     itemTouchListener: RecyclerView.OnItemTouchListener? = null,     sectionTreeTag: String? = null,     startupLogger: LithoStartupLogger? = null,     style: Style? = null,     noinline onViewportChanged: OnViewportChanged? = null,     noinline onDataBound: () -> Unit? = null,     handle: Handle? = null,     noinline onPullToRefresh: () -> Unit? = null,     onNearEnd: OnNearCallback? = null,     onScrollListener: RecyclerView.OnScrollListener? = null,     onScrollListeners: List<RecyclerView.OnScrollListener?>? = null,     lazyCollectionController: LazyCollectionController? = null,     noinline onDataRendered: OnDataRendered? = null,     rangeRatio: Float? = null,     useBackgroundChangeSets: Boolean = false,     preAllocationHandler: PreAllocationHandler? = context.lithoConfiguration.componentsConfig.preAllocationHandler,     childEquivalenceIncludesCommonProps: Boolean = true,     alwaysDetectDuplicates: Boolean = false,     isLeftFadingEnabled: Boolean = true,     isRightFadingEnabled: Boolean = true,     isTopFadingEnabled: Boolean = true,     isBottomFadingEnabled: Boolean = true,     fadingEdgeLength: Dimen? = null,     shouldExcludeFromIncrementalMount: Boolean = false,     isCircular: Boolean = false,     enableStableIds: Boolean = context.lithoConfiguration.componentsConfig.useStableIdsInRecyclerBinder,     linearLayoutInfoFactory: LinearLayoutInfoFactory? = null,     onBeforeLayout: LithoRecyclerView.OnBeforeLayoutListener? = null,     onAfterLayout: LithoRecyclerView.OnAfterLayoutListener? = null,     crossinline init: LazyListScope.() -> Unit): Component

A scrollable collection of components arranged linearly

Link copied to clipboard
inline fun ResourcesScope.LazyStaggeredGrid(    orientation: Int = RecyclerView.VERTICAL,     snapMode: Int = SnapUtil.SNAP_NONE,     reverse: Boolean = false,     spans: Int = 2,     gapStrategy: Int = StaggeredGridLayoutManager.GAP_HANDLING_NONE,     itemAnimator: RecyclerView.ItemAnimator? = CollectionRecyclerSpec.itemAnimator,     itemDecoration: RecyclerView.ItemDecoration? = null,     clipToPadding: Boolean? = null,     clipChildren: Boolean? = null,     startPadding: Dimen? = null,     endPadding: Dimen? = null,     topPadding: Dimen? = null,     bottomPadding: Dimen? = null,     nestedScrollingEnabled: Boolean? = null,     scrollBarStyle: Int? = null,     recyclerViewId: Int? = null,     overScrollMode: Int? = null,     refreshProgressBarColor: Int? = null,     touchInterceptor: LithoRecyclerView.TouchInterceptor? = null,     itemTouchListener: RecyclerView.OnItemTouchListener? = null,     sectionTreeTag: String? = null,     startupLogger: LithoStartupLogger? = null,     style: Style? = null,     noinline onViewportChanged: OnViewportChanged? = null,     noinline onDataBound: () -> Unit? = null,     handle: Handle? = null,     noinline onPullToRefresh: () -> Unit? = null,     onNearEnd: OnNearCallback? = null,     onScrollListener: RecyclerView.OnScrollListener? = null,     onScrollListeners: List<RecyclerView.OnScrollListener?>? = null,     lazyCollectionController: LazyCollectionController? = null,     noinline onDataRendered: OnDataRendered? = null,     rangeRatio: Float? = null,     useBackgroundChangeSets: Boolean = false,     isIncrementalMountEnabled: Boolean = true,     childEquivalenceIncludesCommonProps: Boolean = true,     alwaysDetectDuplicates: Boolean = false,     isLeftFadingEnabled: Boolean = true,     isRightFadingEnabled: Boolean = true,     isTopFadingEnabled: Boolean = true,     isBottomFadingEnabled: Boolean = true,     fadingEdgeLength: Dimen? = null,     preAllocationHandler: PreAllocationHandler? = context.lithoConfiguration.componentsConfig.preAllocationHandler,     shouldExcludeFromIncrementalMount: Boolean = false,     staggeredGridlayoutInfoFactory: StaggeredGridLayoutInfoFactory? = null,     enableStableIds: Boolean = context.lithoConfiguration.componentsConfig.useStableIdsInRecyclerBinder,     onBeforeLayout: LithoRecyclerView.OnBeforeLayoutListener? = null,     onAfterLayout: LithoRecyclerView.OnAfterLayoutListener? = null,     crossinline init: LazyGridScope.() -> Unit): Component

A scrollable collection of components arranged in a staggered grid

Link copied to clipboard
fun ResourcesScope.LinearSpacing(    all: Dimen? = null,     between: Dimen? = null,     start: Dimen? = null,     end: Dimen? = null): RecyclerView.ItemDecoration

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.

Link copied to clipboard
fun ResourcesScope.scrollBy(controller: LazyCollectionController, dx: Dimen, dy: Dimen)

Scroll the LazyCollection by a given number of pixels. The Scroll is instant. For an animated scroll use smoothScrollBy.

Link copied to clipboard
fun ResourcesScope.scrollToId(controller: LazyCollectionController, id: Any, offset: Dimen = 0.px)

Scroll the LazyCollection so that the child with the given id is fully visible. For an animated scroll use smoothScrollToId.

Link copied to clipboard
fun ResourcesScope.scrollToIndex(controller: LazyCollectionController, index: Int, offset: Dimen = 0.px)

Scroll the LazyCollection so that the child at the given index is fully visible. For an animated scroll use smoothScrollToIndex.

Link copied to clipboard
fun ResourcesScope.smoothScrollBy(controller: LazyCollectionController, dx: Dimen, dy: Dimen)

Perform and animated scroll on the LazyCollection by a given number of pixels. For an instantaneous scroll use scrollBy.

Link copied to clipboard
fun ResourcesScope.smoothScrollToId(    controller: LazyCollectionController,     id: Any,     offset: Dimen = 0.px,     smoothScrollAlignmentType: SmoothScrollAlignmentType? = SmoothScrollAlignmentType.DEFAULT)

Perform an animated scroll on the LazyCollection so that the child with the given id is fully visible. For an animated scroll use smoothScrollToId.

Link copied to clipboard
fun ResourcesScope.smoothScrollToIndex(    controller: LazyCollectionController,     index: Int,     offset: Dimen = 0.px,     smoothScrollAlignmentType: SmoothScrollAlignmentType? = SmoothScrollAlignmentType.DEFAULT)

Perform an animated scroll on the LazyCollection so that the child at the given index is fully visible. For an instantaneous scroll use scrollToIndex.