public final class RecyclerCollectionComponent extends ComponentLifecycle
Component
that renders a Recycler
backed by a Section
tree.
This Component
handles the loading events from the Section
hierarchy and shows
the appropriate error,loading or empty Component
passed in as props.
If either the empty or the error components are not passed in and the
RecyclerCollectionComponent
is in one of these states it will simply not render
anything.
The RecyclerCollectionComponent
also exposes a LoadEventsHandler
and a
OnScrollListener
as Prop
s so its users can receive events about the state
of the loading and about the state of the Recycler
scrolling.
clipToPadding, clipChildren, itemDecoration, scrollBarStyle, horizontalPadding, verticalPadding
and recyclerViewId Prop
s will be directly applied to the Recycler
component.
The RecyclerCollectionEventsController
Prop
is a way to sent commands to the
RecyclerCollectionComponentSpec
, such as scrollTo(position) and refresh().
com.facebook.litho.sections.widget.RecyclerCollectionComponentSpec
Modifier and Type | Class and Description |
---|---|
static class |
RecyclerCollectionComponent.Builder |
ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.StateContainer, ComponentLifecycle.StateUpdate
acceptTriggerEvent, acquireDiff, acquireOutput, applyPreviousRenderData, callsShouldUpdateOnMount, canAcceptTrigger, canMeasure, canMountIncrementally, canPreallocate, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getMountType, getTreePropsForChildren, implementsAccessibility, implementsExtraAccessibilityNodes, isMountSizeDependent, isPureRender, needsPreviousRenderData, newEventHandler, newEventHandler, newEventTrigger, onBind, onBoundsDefined, onCreateLayoutWithSizeSpec, onCreateMountContent, onCreateTransition, onLoadStyle, onMeasure, onMeasureBaseline, onMount, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, onPrepare, onUnbind, onUnmount, poolSize, populateTreeProps, recordRenderData, releaseDiff, releaseOutput, shouldUpdate, shouldUseDisplayList
protected ComponentLayout onCreateLayout(ComponentContext c, Component _abstractImpl)
ComponentLifecycle
ComponentLayout
representing the layout structure of
the Component
and its sub-components. You should use
ComponentContext.newLayoutBuilder(int, int)
to build the layout tree.onCreateLayout
in class ComponentLifecycle
c
- The ComponentContext
to build a ComponentLayout
tree._abstractImpl
- The component to create the ComponentLayout
tree from.protected void createInitialState(ComponentContext c, Component _abstractImpl)
createInitialState
in class ComponentLifecycle
public static EventHandler<PTRRefreshEvent> onRefresh(ComponentContext c, SectionTree sectionTree)
public Object dispatchOnEvent(EventHandler eventHandler, Object eventState)
dispatchOnEvent
in interface EventDispatcher
dispatchOnEvent
in class ComponentLifecycle
protected boolean hasState()
hasState
in class ComponentLifecycle
protected void transferState(ComponentContext context, ComponentLifecycle.StateContainer prevStateContainer, Component component)
ComponentLifecycle
transferState
in class ComponentLifecycle
protected static void updateLoadingStateAsync(ComponentContext c, LoadingEvent.LoadingState currentLoadingState)
protected static void updateLoadingState(ComponentContext c, LoadingEvent.LoadingState currentLoadingState)
protected static void updateLoadingAndEmptyAsync(ComponentContext c, LoadingEvent.LoadingState currentLoadingState, boolean empty)
protected static void updateLoadingAndEmpty(ComponentContext c, LoadingEvent.LoadingState currentLoadingState, boolean empty)
protected static void lazyUpdateHasSetSectionTreeRoot(ComponentContext c, boolean lazyUpdateValue)
protected static void lazyUpdateLoadingState(ComponentContext c, LoadingEvent.LoadingState lazyUpdateValue)
public static RecyclerCollectionComponent.Builder create(ComponentContext context)
public static RecyclerCollectionComponent.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)