public abstract class SpecGeneratedComponent extends Component implements ContentAllocator, EventTriggerTarget, HasEventTrigger
| Modifier and Type | Class and Description |
|---|---|
static interface |
SpecGeneratedComponent.TransitionContainer
Generated component's state container could implement this interface along with
StateContainer when componentspec specifies state update method with OnUpdateStateWithTransition annotation. |
Component.Builder<T extends Component.Builder<T>>, Component.ContainerBuilder<T extends Component.ContainerBuilder<T>>, Component.MountType, Component.RenderData| Modifier | Constructor and Description |
|---|---|
protected |
SpecGeneratedComponent(int identityHashCode,
java.lang.String simpleName) |
protected |
SpecGeneratedComponent(java.lang.String simpleName) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
acceptTriggerEvent(EventTrigger eventTrigger,
java.lang.Object eventState,
java.lang.Object[] params) |
protected java.lang.Object |
acceptTriggerEventImpl(EventTrigger eventTrigger,
java.lang.Object eventState,
java.lang.Object[] params) |
protected void |
applyPreviousRenderData(Component.RenderData previousRenderData) |
protected void |
bindDynamicProp(int dynamicPropIndex,
java.lang.Object value,
java.lang.Object content) |
boolean |
canPreallocate()
This API informs the framework to fill the content pool for this Mountable ahead of time.
|
protected void |
copyInterStageImpl(InterStagePropsContainer copyIntoInterStagePropsContainer,
InterStagePropsContainer copyFromInterStagePropsContainer) |
protected void |
copyPrepareInterStageImpl(PrepareInterStagePropsContainer copyIntoInterStagePropsContainer,
PrepareInterStagePropsContainer copyFromInterStagePropsContainer) |
java.lang.Object |
createContent(Context context)
Allocates the mountable content (View or Drawable).
|
protected void |
createInitialState(ComponentContext c) |
protected InterStagePropsContainer |
createInterStagePropsContainer() |
java.lang.Object |
createPoolableContent(Context context)
Creates a mount-content that can be pooled.
|
protected PrepareInterStagePropsContainer |
createPrepareInterStagePropsContainer() |
MountItemsPool.ItemPool |
createRecyclingPool()
Creates an ItemPool for this mountable content.
|
protected StateContainer |
createStateContainer() |
protected void |
dispatchOnEnteredRange(ComponentContext c,
java.lang.String name) |
protected void |
dispatchOnExitedRange(ComponentContext c,
java.lang.String name) |
protected int |
getExtraAccessibilityNodeAt(ComponentContext c,
int x,
int y,
InterStagePropsContainer InterStagePropsContainer)
Get extra accessibility node id at a given point within the component.
|
protected int |
getExtraAccessibilityNodesCount(ComponentContext c,
InterStagePropsContainer interStagePropsContainer)
The number of extra accessibility nodes that this component wishes to provides to the
accessibility system.
|
protected InterStagePropsContainer |
getInterStagePropsContainer(ComponentContext scopedContext,
InterStagePropsContainer interStagePropsContainer) |
java.lang.Object |
getPoolableContentType()
Returns an object defining the type of the mount-content.
|
protected PrepareInterStagePropsContainer |
getPrepareInterStagePropsContainer(ComponentContext scopedContext) |
java.lang.String |
getSimpleName()
Should only be used by logging to provide more readable messages.
|
protected Component |
getSimpleNameDelegate() |
protected TreeProps |
getTreePropsForChildren(ComponentContext c,
TreeProps treeProps)
Updates the TreeProps map with outputs from all
OnCreateTreeProp methods. |
protected boolean |
hasAttachDetachCallback() |
protected boolean |
hasOwnErrorHandler()
This method is overridden in the generated component to return true if and only if the
Component Spec has an OnError lifecycle callback.
|
protected boolean |
hasState() |
protected boolean |
implementsAccessibility()
Whether this component will populate any accessibility nodes or events that are passed to it.
|
protected boolean |
implementsExtraAccessibilityNodes()
Whether this component will expose any virtual views to the accessibility framework
|
protected boolean |
isMountSizeDependent() |
boolean |
isRecyclingDisabled()
Return true if pooling should be disabled for this mount content.
|
protected boolean |
needsPreviousRenderData() |
protected void |
onAttached(ComponentContext c)
Called when the component is attached to the
ComponentTree. |
protected void |
onBind(ComponentContext c,
java.lang.Object mountedContent,
InterStagePropsContainer interStagePropsContainer) |
protected void |
onBoundsDefined(ComponentContext c,
ComponentLayout layout,
InterStagePropsContainer interStagePropsContainer)
Called after the layout calculation is finished and the given
ComponentLayout has its
bounds defined. |
protected Component |
onCreateLayout(ComponentContext c)
Generate a tree of
ComponentLayout representing the layout structure of the Component and its sub-components. |
protected Component |
onCreateLayoutWithSizeSpec(ComponentContext c,
int widthSpec,
int heightSpec) |
MountContentPool |
onCreateMountContentPool()
Creates the content pool the framework should use for this Mountable.
|
protected void |
onDetached(ComponentContext c)
Called when the component is detached from the
ComponentTree. |
protected void |
onError(ComponentContext c,
java.lang.Exception e)
Called to provide a fallback if a supported lifecycle method throws an exception.
|
protected void |
onMeasure(ComponentContext c,
ComponentLayout layout,
int widthSpec,
int heightSpec,
Size size,
InterStagePropsContainer interStagePropsContainer) |
protected int |
onMeasureBaseline(ComponentContext c,
int width,
int height,
InterStagePropsContainer interStagePropsContainer)
Called during layout calculation to determine the baseline of a component.
|
protected void |
onMount(ComponentContext c,
java.lang.Object convertContent,
InterStagePropsContainer interStagePropsContainer)
Deploy all UI elements representing the final bounds defined in the given
ComponentLayout. |
protected void |
onPrepare(ComponentContext c) |
protected void |
onUnbind(ComponentContext c,
java.lang.Object mountedContent,
InterStagePropsContainer interStagePropsContainer) |
protected void |
onUnmount(ComponentContext c,
java.lang.Object mountedContent,
InterStagePropsContainer interStagePropsContainer)
Unload UI elements associated with this component.
|
int |
poolSize()
This API informs the framework about the size of the content pool.
|
protected void |
populateTreeProps(TreeProps parentTreeProps)
Retrieves all of the tree props used by this Component from the TreeProps map and sets the tree
props as fields on the ComponentImpl.
|
protected PrepareResult |
prepare(RenderStateContext renderStateContext,
ComponentContext c) |
void |
recordEventTrigger(ComponentContext c,
EventTriggersContainer container) |
protected Component.RenderData |
recordRenderData(ComponentContext c,
Component.RenderData toRecycle) |
protected RenderResult |
render(RenderStateContext renderStateContext,
ComponentContext c,
int widthSpec,
int heightSpec)
Invokes the Component-specific render implementation, returning a RenderResult.
|
protected boolean |
shouldAlwaysRemeasure() |
protected boolean |
usesLocalStateContainer() |
canMeasure, clone, createMountContent, dispatchErrorEvent, dispatchOnEvent, dispatchOnEventImpl, equals, excludeFromIncrementalMount, getCommonProps, getDynamicProps, getErrorHandler, getEventDispatcher, getEventTrigger, getEventTrigger, getHandle, getMountType, getTreePropFromParent, getTypeId, hasChildLithoViews, hasClickHandlerSet, hashCode, implementsShouldUpdate, isEqualivalentTreeProps, isEquivalentCommonProps, isEquivalentProps, isEquivalentTo, isEquivalentTo, isLayoutSpecWithSizeSpec, isPureRender, isPureRender, makeShallowCopy, measure, measure, measureMightNotCacheInternalNode, newEventHandler, newEventTrigger, newEventTrigger, onCreateMountContent, onCreateTransition, onLoadStyle, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, registerWorkingRange, resolve, retrieveValue, shouldUpdate, toString, transferState, willRenderprotected SpecGeneratedComponent(java.lang.String simpleName)
protected SpecGeneratedComponent(int identityHashCode,
java.lang.String simpleName)
public final java.lang.String getSimpleName()
getSimpleName in class Componentprotected StateContainer createStateContainer()
protected Component getSimpleNameDelegate()
LayoutSpec#simpleNameDelegate()protected RenderResult render(RenderStateContext renderStateContext, ComponentContext c, int widthSpec, int heightSpec)
Component#resolve(LayoutStateContext, ComponentContext)'ed), as well as other
metadata from that render call such as transitions that should be applied.protected final PrepareResult prepare(RenderStateContext renderStateContext, ComponentContext c)
public void recordEventTrigger(ComponentContext c, EventTriggersContainer container)
recordEventTrigger in interface HasEventTriggerprotected Component onCreateLayout(ComponentContext c)
ComponentLayout representing the layout structure of the Component and its sub-components.c - The ComponentContext to build a ComponentLayout tree.protected Component onCreateLayoutWithSizeSpec(ComponentContext c, int widthSpec, int heightSpec)
protected void onPrepare(ComponentContext c)
protected boolean usesLocalStateContainer()
usesLocalStateContainer in class Componentpublic final java.lang.Object acceptTriggerEvent(EventTrigger eventTrigger, java.lang.Object eventState, java.lang.Object[] params)
acceptTriggerEvent in interface EventTriggerTargetprotected java.lang.Object acceptTriggerEventImpl(EventTrigger eventTrigger, java.lang.Object eventState, java.lang.Object[] params)
protected void applyPreviousRenderData(Component.RenderData previousRenderData)
protected void bindDynamicProp(int dynamicPropIndex,
java.lang.Object value,
java.lang.Object content)
protected void copyInterStageImpl(InterStagePropsContainer copyIntoInterStagePropsContainer, InterStagePropsContainer copyFromInterStagePropsContainer)
protected void copyPrepareInterStageImpl(PrepareInterStagePropsContainer copyIntoInterStagePropsContainer, PrepareInterStagePropsContainer copyFromInterStagePropsContainer)
protected void createInitialState(ComponentContext c)
protected InterStagePropsContainer createInterStagePropsContainer()
protected PrepareInterStagePropsContainer createPrepareInterStagePropsContainer()
protected void dispatchOnEnteredRange(ComponentContext c, java.lang.String name)
protected void dispatchOnExitedRange(ComponentContext c, java.lang.String name)
protected int getExtraAccessibilityNodeAt(ComponentContext c, int x, int y, InterStagePropsContainer InterStagePropsContainer)
x - x co-ordinate within the mounted componenty - y co-ordinate within the mounted componentExploreByTouchHelper#INVALID_IDprotected int getExtraAccessibilityNodesCount(ComponentContext c, InterStagePropsContainer interStagePropsContainer)
protected final InterStagePropsContainer getInterStagePropsContainer(ComponentContext scopedContext, InterStagePropsContainer interStagePropsContainer)
protected final PrepareInterStagePropsContainer getPrepareInterStagePropsContainer(ComponentContext scopedContext)
protected TreeProps getTreePropsForChildren(ComponentContext c, TreeProps treeProps)
OnCreateTreeProp methods.protected boolean hasAttachDetachCallback()
OnAttached or OnDetached delegate
methods.protected boolean hasOwnErrorHandler()
protected boolean hasState()
protected boolean implementsAccessibility()
protected boolean implementsExtraAccessibilityNodes()
protected boolean isMountSizeDependent()
protected boolean needsPreviousRenderData()
protected void onAttached(ComponentContext c)
ComponentTree.c - The ComponentContext the Component was constructed with.protected void onBind(ComponentContext c, java.lang.Object mountedContent, InterStagePropsContainer interStagePropsContainer)
protected void onBoundsDefined(ComponentContext c, ComponentLayout layout, InterStagePropsContainer interStagePropsContainer)
ComponentLayout 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.c - The Context used by this component.layout - The ComponentLayout with defined position and size.protected void onDetached(ComponentContext c)
ComponentTree.c - The ComponentContext the Component was constructed with.protected void onError(ComponentContext c, java.lang.Exception e)
c - The ComponentContext the Component was constructed with.e - The exception caught.OnErrorprotected void onMeasure(ComponentContext c, ComponentLayout layout, int widthSpec, int heightSpec, Size size, InterStagePropsContainer interStagePropsContainer)
protected int onMeasureBaseline(ComponentContext c, int width, int height, InterStagePropsContainer interStagePropsContainer)
c - The Context used by this component.width - The width of this component.height - The height of this component.interStagePropsContainer - protected void onMount(ComponentContext c, java.lang.Object convertContent, InterStagePropsContainer interStagePropsContainer)
ComponentLayout. Return either a Drawable or a View or null to be
mounted.c - The ComponentContext to mount the component into.protected void onUnbind(ComponentContext c, java.lang.Object mountedContent, InterStagePropsContainer interStagePropsContainer)
protected void onUnmount(ComponentContext c, java.lang.Object mountedContent, InterStagePropsContainer interStagePropsContainer)
c - The Context for this mount operation.mountedContent - The Drawable or View mounted by this component.interStagePropsContainer - protected void populateTreeProps(TreeProps parentTreeProps)
protected Component.RenderData recordRenderData(ComponentContext c, Component.RenderData toRecycle)
protected boolean shouldAlwaysRemeasure()
public java.lang.Object createContent(Context context)
ContentAllocatorcreateContent in interface ContentAllocatorpublic java.lang.Object createPoolableContent(Context context)
ContentAllocatorcreatePoolableContent in interface ContentAllocatorpublic java.lang.Object getPoolableContentType()
ContentAllocatorgetPoolableContentType in interface ContentAllocatorpublic boolean isRecyclingDisabled()
ContentAllocatorisRecyclingDisabled in interface ContentAllocatorpublic MountItemsPool.ItemPool createRecyclingPool()
ContentAllocatorcreateRecyclingPool in interface ContentAllocatorpublic 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 ContentAllocatorpublic MountContentPool onCreateMountContentPool()
ContentAllocatorExperimental. Currently for Litho team internal use only.
onCreateMountContentPool in interface ContentAllocatorpublic int poolSize()
ContentAllocatorExperimental. Currently for Litho team internal use only.
poolSize in interface ContentAllocator