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
Modifier | Constructor and Description |
---|---|
protected |
Component() |
protected |
Component(Class classType)
This constructor should be called only if working with a manually crafted "special" Component.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearCachedLayout() |
protected void |
copyInterStageImpl(Component component) |
EventDispatcher |
getEventDispatcher()
Deprecated.
|
protected int |
getId() |
ComponentContext |
getScopedContext() |
abstract 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 void |
releaseCachedLayout() |
void |
setScopedContext(ComponentContext scopedContext) |
protected void |
updateInternalChildState(ComponentContext parentContext)
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, dispatchOnEvent, 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, shouldUpdate, shouldUseDisplayList, transferState
protected Component()
protected Component(Class classType)
Component()
instead.public abstract 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)
public void recordEventTrigger(EventTriggersContainer container)
recordEventTrigger
in interface HasEventTrigger
@Deprecated public EventDispatcher getEventDispatcher()
getEventDispatcher
in interface HasEventDispatcher