public final class Recycler extends SpecGeneratedComponent
RecyclerView.com.facebook.litho.widget.RecyclerSpec| Modifier and Type | Class and Description |
|---|---|
static class |
Recycler.Builder |
SpecGeneratedComponent.TransitionContainerComponent.ContainerBuilder<T extends Component.ContainerBuilder<T>>, Component.MountType, Component.RenderData| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canMeasure()
Whether this
Component is able to measure itself according to
specific size constraints. |
boolean |
canPreallocate()
This API informs the framework to fill the content pool for this Mountable ahead of time.
|
static Recycler.Builder |
create(ComponentContext context) |
static Recycler.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes) |
protected void |
createInitialState(ComponentContext _0) |
protected com.facebook.litho.widget.Recycler.RecyclerStateContainer |
createStateContainer() |
protected java.lang.Object |
dispatchOnEventImpl(EventHandler eventHandler,
java.lang.Object eventState) |
Component.MountType |
getMountType()
This indicates the type of the
Object that will be returned by com.facebook.litho.Component#mount. |
static EventHandler<PTRRefreshEvent> |
getPTRRefreshEventHandler(ComponentContext context) |
boolean |
hasChildLithoViews()
Whether this
Component mounts views that contain component-based
content that can be incrementally mounted e.g. |
protected boolean |
hasState() |
boolean |
implementsShouldUpdate() |
boolean |
isEquivalentProps(Component other,
boolean shouldCompareCommonProps)
Determine if this component has equivalent props to a given component.
|
boolean |
isPureRender() |
Recycler |
makeShallowCopy() |
protected void |
onBind(ComponentContext context,
java.lang.Object sectionsRecycler,
InterStagePropsContainer _2) |
protected void |
onBoundsDefined(ComponentContext context,
ComponentLayout layout,
InterStagePropsContainer _2)
Called after the layout calculation is finished and the given
ComponentLayout has its
bounds defined. |
protected java.lang.Object |
onCreateMountContent(Context c)
Create the object that will be mounted in the
LithoView. |
protected void |
onMeasure(ComponentContext c,
ComponentLayout layout,
int widthSpec,
int heightSpec,
Size measureOutput,
InterStagePropsContainer _5) |
protected void |
onMount(ComponentContext c,
java.lang.Object sectionsRecycler,
InterStagePropsContainer _2)
Deploy all UI elements representing the final bounds defined in the given
ComponentLayout. |
static EventHandler<ReMeasureEvent> |
onRemeasure(ComponentContext c) |
protected void |
onUnbind(ComponentContext context,
java.lang.Object sectionsRecycler,
InterStagePropsContainer _2) |
protected void |
onUnmount(ComponentContext context,
java.lang.Object sectionsRecycler,
InterStagePropsContainer _2)
Unload UI elements associated with this component.
|
protected static void |
onUpdateMeasure(ComponentContext c,
int measureVer) |
protected static void |
onUpdateMeasureAsync(ComponentContext c,
int measureVer) |
protected static void |
onUpdateMeasureSync(ComponentContext c,
int measureVer) |
int |
poolSize()
This API informs the framework about the size of the content pool.
|
protected boolean |
shouldAlwaysRemeasure() |
protected boolean |
shouldUpdate(Component _prevAbstractImpl,
StateContainer _prevStateContainer,
Component _nextAbstractImpl,
StateContainer _nextStateContainer)
Whether the component needs updating.
|
protected void |
transferState(StateContainer _prevStateContainer,
StateContainer _nextStateContainer)
|
acceptTriggerEvent, acceptTriggerEventImpl, applyPreviousRenderData, bindDynamicProp, copyInterStageImpl, copyPrepareInterStageImpl, createContent, createInterStagePropsContainer, createPoolableContent, createPrepareInterStagePropsContainer, createRecyclingPool, dispatchOnEnteredRange, dispatchOnExitedRange, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getInterStagePropsContainer, getPoolableContentType, getPrepareInterStagePropsContainer, getSimpleName, getSimpleNameDelegate, getTreePropsForChildren, hasAttachDetachCallback, hasOwnErrorHandler, implementsAccessibility, implementsExtraAccessibilityNodes, isMountSizeDependent, isRecyclingDisabled, needsPreviousRenderData, onAttached, onCreateLayout, onCreateLayoutWithSizeSpec, onCreateMountContentPool, onDetached, onError, onMeasureBaseline, onPrepare, populateTreeProps, prepare, recordEventTrigger, recordRenderData, render, usesLocalStateContainerclone, createMountContent, dispatchErrorEvent, dispatchOnEvent, equals, excludeFromIncrementalMount, getCommonProps, getDynamicProps, getErrorHandler, getEventDispatcher, getEventTrigger, getEventTrigger, getHandle, getTreePropFromParent, getTypeId, hasClickHandlerSet, hashCode, isEqualivalentTreeProps, isEquivalentCommonProps, isEquivalentTo, isEquivalentTo, isLayoutSpecWithSizeSpec, isPureRender, measure, measure, measureMightNotCacheInternalNode, newEventHandler, newEventTrigger, newEventTrigger, onCreateTransition, onLoadStyle, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, registerWorkingRange, resolve, retrieveValue, toString, willRenderprotected com.facebook.litho.widget.Recycler.RecyclerStateContainer createStateContainer()
createStateContainer in class SpecGeneratedComponentpublic boolean isEquivalentProps(Component other, boolean shouldCompareCommonProps)
ComponentisEquivalentProps in class Componentother - the component to compare topublic Recycler makeShallowCopy()
makeShallowCopy in class Componentprotected void onMeasure(ComponentContext c, ComponentLayout layout, int widthSpec, int heightSpec, Size measureOutput, InterStagePropsContainer _5)
onMeasure in class SpecGeneratedComponentprotected boolean canMeasure()
ComponentComponent is able to measure itself according to
specific size constraints.canMeasure in class Componentprotected void onBoundsDefined(ComponentContext context, ComponentLayout layout, InterStagePropsContainer _2)
SpecGeneratedComponentComponentLayout has its
bounds defined. You can use ComponentLayout.getX(), ComponentLayout.getY(),
ComponentLayout.getWidth(), and ComponentLayout.getHeight() to get the size and
position of the component in the layout tree.onBoundsDefined in class SpecGeneratedComponentcontext - The Context used by this component.layout - The ComponentLayout with defined position and size.protected java.lang.Object onCreateMountContent(Context c)
ComponentLithoView.onCreateMountContent in class Componentc - The Context to be used to create the content.protected void onMount(ComponentContext c, java.lang.Object sectionsRecycler, InterStagePropsContainer _2)
SpecGeneratedComponentComponentLayout. Return either a Drawable or a View or null to be
mounted.onMount in class SpecGeneratedComponentc - The ComponentContext to mount the component into.protected void onBind(ComponentContext context, java.lang.Object sectionsRecycler, InterStagePropsContainer _2)
onBind in class SpecGeneratedComponentprotected void onUnbind(ComponentContext context, java.lang.Object sectionsRecycler, InterStagePropsContainer _2)
onUnbind in class SpecGeneratedComponentprotected void onUnmount(ComponentContext context, java.lang.Object sectionsRecycler, InterStagePropsContainer _2)
SpecGeneratedComponentonUnmount in class SpecGeneratedComponentcontext - The Context for this mount operation.sectionsRecycler - The Drawable or View mounted by this component.protected boolean shouldUpdate(Component _prevAbstractImpl, StateContainer _prevStateContainer, Component _nextAbstractImpl, StateContainer _nextStateContainer)
ComponentFor layout components, the framework will verify that none of the children of the component need updating, and that both components have the same number of children. Therefore this method just needs to determine any changes to the top-level component that would cause it to need to be updated (for example, a click handler was added).
For mount specs, the framework does nothing extra and this method alone determines whether the component is updated or not.
shouldUpdate in class Component_prevAbstractImpl - the previous component to compare against._nextAbstractImpl - the component that is now in use.public boolean implementsShouldUpdate()
implementsShouldUpdate in class Componentprotected void createInitialState(ComponentContext _0)
createInitialState in class SpecGeneratedComponentprotected boolean shouldAlwaysRemeasure()
shouldAlwaysRemeasure in class SpecGeneratedComponentpublic Component.MountType getMountType()
ComponentObject that will be returned by com.facebook.litho.Component#mount.getMountType in class ComponentComponent.MountTypepublic int poolSize()
ContentAllocatorExperimental. Currently for Litho team internal use only.
poolSize in interface ContentAllocatorpoolSize in class SpecGeneratedComponentpublic boolean canPreallocate()
ContentAllocatorfalse, i.e. content is not pre-allocated. Pre-allocation of the
content can improve performance in some circumstances where creating the content is expensive.canPreallocate in interface ContentAllocatorcanPreallocate in class SpecGeneratedComponentpublic boolean hasChildLithoViews()
ComponentComponent mounts views that contain component-based
content that can be incrementally mounted e.g. if the mounted view has a LithoView with
incremental mount enabled.hasChildLithoViews in class Componentpublic boolean isPureRender()
isPureRender in class Componentpublic static EventHandler<PTRRefreshEvent> getPTRRefreshEventHandler(ComponentContext context)
public static EventHandler<ReMeasureEvent> onRemeasure(ComponentContext c)
protected java.lang.Object dispatchOnEventImpl(EventHandler eventHandler, java.lang.Object eventState)
dispatchOnEventImpl in class Componentprotected boolean hasState()
hasState in class SpecGeneratedComponentprotected void transferState(StateContainer _prevStateContainer, StateContainer _nextStateContainer)
ComponenttransferState in class Componentprotected static void onUpdateMeasure(ComponentContext c, int measureVer)
protected static void onUpdateMeasureAsync(ComponentContext c, int measureVer)
protected static void onUpdateMeasureSync(ComponentContext c, int measureVer)
public static Recycler.Builder create(ComponentContext context)
public static Recycler.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)