public abstract class Component extends ComponentLifecycle implements Cloneable, HasEventDispatcher, HasEventTrigger
Modifier and Type | Class and Description |
---|---|
static class |
Component.Builder<T extends Component.Builder<T>> |
static class |
Component.ContainerBuilder<T extends Component.ContainerBuilder<T>> |
ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.StateContainer, ComponentLifecycle.StateUpdate, ComponentLifecycle.TransitionContainer
Modifier and Type | Field and Description |
---|---|
protected boolean |
mSplitChildrenLayoutInThreadPool
Whether this Component should split the layout calculation of its direct children on multiple
background threads.
|
Modifier | Constructor and Description |
---|---|
protected |
Component(String simpleName) |
protected |
Component(String simpleName,
Object type)
This constructor should be called only if working with a manually crafted "special" Component.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canResolve()
Indicate that this component implements its own
ComponentLifecycle.resolve(ComponentContext) logic
instead of going through ComponentLifecycle.createComponentLayout(ComponentContext) . |
protected void |
clearCachedLayout() |
protected void |
copyInterStageImpl(Component component) |
EventDispatcher |
getEventDispatcher()
Deprecated.
|
protected int |
getId() |
protected CommonProps |
getOrCreateCommonProps() |
ComponentContext |
getScopedContext() |
String |
getSimpleName()
Mostly used by logging to provide more readable messages.
|
protected ComponentLifecycle.StateContainer |
getStateContainer() |
boolean |
isEquivalentTo(Component other)
Compares this component to a different one to check if they are the same
This is used to be able to skip rendering a component again.
|
Component |
makeShallowCopy() |
void |
measure(ComponentContext c,
int widthSpec,
int heightSpec,
Size outputSize)
Measure a component with the given
SizeSpec constrain. |
void |
recordEventTrigger(EventTriggersContainer container) |
protected static void |
registerWorkingRange(String name,
WorkingRange workingRange,
Component component)
Store a working range information into a list for later use by
LayoutState . |
protected void |
releaseCachedLayout() |
void |
setScopedContext(ComponentContext scopedContext) |
protected void |
updateInternalChildState(ComponentContext parentContext)
Called to install internal state based on a component's parent context.
|
protected void |
updateInternalChildState(ComponentContext parentContext,
boolean shouldForwardSplitLayoutStatus)
Called to install internal state based on a component's parent context.
|
static boolean |
willRender(ComponentContext c,
Component component) |
acceptTriggerEvent, acquireDiff, acquireOutput, applyPreviousRenderData, callsShouldUpdateOnMount, canMeasure, canMountIncrementally, canPreallocate, createInitialState, createMountContent, dispatchErrorEvent, dispatchErrorEvent, dispatchOnEnteredRange, dispatchOnEvent, dispatchOnExitedRange, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getMountType, getTreePropsForChildren, hasState, implementsAccessibility, implementsExtraAccessibilityNodes, isMountSizeDependent, isPureRender, needsPreviousRenderData, newEventHandler, newEventHandler, newEventTrigger, onBind, onBoundsDefined, onCreateLayout, onCreateLayoutWithSizeSpec, onCreateMountContent, onCreateMountContentPool, onCreateTransition, onError, onLoadStyle, onMeasure, onMeasureBaseline, onMount, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, onPrepare, onUnbind, onUnmount, poolSize, populateTreeProps, recordRenderData, releaseDiff, releaseOutput, resolve, shouldAlwaysRemeasure, shouldUpdate, shouldUseDisplayList, transferState
protected boolean mSplitChildrenLayoutInThreadPool
protected Component(String simpleName)
protected Component(String simpleName, Object type)
Component(String)
instead.public final String getSimpleName()
public boolean isEquivalentTo(Component other)
Object.equals(Object)
so we can optimize the code better over time since we don't have
to adhere to the contract required for a equals method.other
- the component to compare toprotected ComponentLifecycle.StateContainer getStateContainer()
public ComponentContext getScopedContext()
public void setScopedContext(ComponentContext scopedContext)
protected int getId()
public Component makeShallowCopy()
protected void releaseCachedLayout()
protected void clearCachedLayout()
public void measure(ComponentContext c, int widthSpec, int heightSpec, Size outputSize)
SizeSpec
constrain.c
- ComponentContext
.widthSpec
- Width SizeSpec
constrain.heightSpec
- Height SizeSpec
constrain.outputSize
- Size object that will be set with the measured dimensions.protected void copyInterStageImpl(Component component)
public static boolean willRender(ComponentContext c, Component component)
protected void updateInternalChildState(ComponentContext parentContext)
protected void updateInternalChildState(ComponentContext parentContext, boolean shouldForwardSplitLayoutStatus)
public void recordEventTrigger(EventTriggersContainer container)
recordEventTrigger
in interface HasEventTrigger
protected boolean canResolve()
ComponentLifecycle.resolve(ComponentContext)
logic
instead of going through ComponentLifecycle.createComponentLayout(ComponentContext)
.protected CommonProps getOrCreateCommonProps()
@Deprecated public EventDispatcher getEventDispatcher()
getEventDispatcher
in interface HasEventDispatcher
protected static void registerWorkingRange(String name, WorkingRange workingRange, Component component)
LayoutState
.