public final class SelectorComponent extends Component
Component.willRender(ComponentContext, Component)
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 |
Component.ContainerBuilder<T extends Component.ContainerBuilder<T>>
ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.StateUpdate, ComponentLifecycle.TransitionContainer
mSplitChildrenLayoutInThreadPool, mThreadIdToLastMeasuredLayout
Modifier and Type | Method and Description |
---|---|
static SelectorComponent.Builder |
create(ComponentContext context) |
static SelectorComponent.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes) |
protected Component |
onCreateLayout(ComponentContext c)
Generate a tree of
ComponentLayout representing the layout structure of the Component and its sub-components. |
canResolve, clearCachedLayout, copyInterStageImpl, getCommonProps, getEventDispatcher, getId, getScopedContext, getSimpleName, getStateContainer, isEquivalentTo, makeShallowCopy, measure, recordEventTrigger, registerWorkingRange, releaseCachedLayout, setScopedContext, updateInternalChildState, updateInternalChildState, willRender
acceptTriggerEvent, acquireDiff, acquireOutput, applyPreviousRenderData, callsShouldUpdateOnMount, canMeasure, canPreallocate, createInitialState, createMountContent, dispatchErrorEvent, dispatchErrorEvent, dispatchOnEnteredRange, dispatchOnEvent, dispatchOnExitedRange, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getMountType, getTreePropsForChildren, hasChildLithoViews, hasState, implementsAccessibility, implementsExtraAccessibilityNodes, isLayoutSpecWithSizeSpecCheck, isMountSizeDependent, isPureRender, needsPreviousRenderData, newEventHandler, newEventHandler, newEventTrigger, onBind, onBoundsDefined, onCreateLayoutWithSizeSpec, onCreateMountContent, onCreateMountContentPool, onCreateTransition, onError, onLoadStyle, onMeasure, onMeasureBaseline, onMount, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, onPrepare, onShouldCreateLayoutWithNewSizeSpec, onUnbind, onUnmount, poolSize, populateTreeProps, recordRenderData, releaseDiff, releaseOutput, resolve, shouldAlwaysRemeasure, shouldUpdate, shouldUseDisplayList, transferState
protected Component onCreateLayout(ComponentContext c)
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.public static SelectorComponent.Builder create(ComponentContext context)
public static SelectorComponent.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)