public final class SelectorComponent extends ComponentLifecycle
Component.willRender(ComponentLayout)
on the Components provided.
This is useful when a single Component is to be rendered amongst a large number of candidate Components or when multiple Components can potentially render some content using the same props and the first one capable of rendering the content needs to be used.
com.facebook.litho.widget.SelectorComponentSpec
Modifier and Type | Class and Description |
---|---|
static class |
SelectorComponent.Builder |
ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.StateContainer, ComponentLifecycle.StateUpdate
Modifier and Type | Method and Description |
---|---|
static SelectorComponent.Builder |
create(ComponentContext context) |
static SelectorComponent.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes) |
protected ComponentLayout |
onCreateLayout(ComponentContext c,
Component _abstractImpl)
Generate a tree of
ComponentLayout representing the layout structure of
the Component and its sub-components. |
acceptTriggerEvent, acquireDiff, acquireOutput, applyPreviousRenderData, callsShouldUpdateOnMount, canAcceptTrigger, canMeasure, canMountIncrementally, canPreallocate, createInitialState, dispatchOnEvent, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getMountType, getTreePropsForChildren, hasState, 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, transferState
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.public static SelectorComponent.Builder create(ComponentContext context)
public static SelectorComponent.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)