public final class SizeSpecMountWrapperComponent extends Component
MountSpec implementation to provide width and height information to the wrapped
component.
Usage: Create a SizeSpecMountWrapperComponentSpec with a Component added to
it, and it will provide the width and height information through a Size typed TreeProp.
com.facebook.litho.widget.SizeSpecMountWrapperComponentSpec| Modifier and Type | Class and Description |
|---|---|
static class |
SizeSpecMountWrapperComponent.Builder |
Component.ContainerBuilder<T extends Component.ContainerBuilder<T>>ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.TransitionContainer| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canMeasure()
Whether this
ComponentLifecycle is able to measure itself according to specific size
constraints. |
protected boolean |
canPreallocate() |
static SizeSpecMountWrapperComponent.Builder |
create(ComponentContext context) |
static SizeSpecMountWrapperComponent.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes) |
protected void |
createInitialState(ComponentContext c) |
ComponentLifecycle.MountType |
getMountType()
This indicates the type of the
Object that will be returned by ComponentLifecycle.mount(com.facebook.litho.ComponentContext, java.lang.Object). |
protected StateContainer |
getStateContainer() |
protected boolean |
hasAttachDetachCallback() |
boolean |
hasChildLithoViews()
Whether this
ComponentLifecycle mounts views that contain component-based content that
can be incrementally mounted e.g. |
protected boolean |
hasState() |
boolean |
isEquivalentTo(Component other)
Compares this component to a different one to check if they are the same
|
SizeSpecMountWrapperComponent |
makeShallowCopy() |
protected void |
onBind(ComponentContext c,
Object wrapperView) |
protected void |
onBoundsDefined(ComponentContext c,
ComponentLayout layout)
Called after the layout calculation is finished and the given
ComponentLayout has its
bounds defined. |
protected Object |
onCreateMountContent(Context c)
Create the object that will be mounted in the
LithoView. |
protected void |
onDetached(ComponentContext c)
Called when the component is detached from the
ComponentTree. |
protected void |
onMeasure(ComponentContext c,
ComponentLayout layout,
int widthSpec,
int heightSpec,
Size size) |
protected void |
onMount(ComponentContext c,
Object wrapperView)
Deploy all UI elements representing the final bounds defined in the given
ComponentLayout. |
protected void |
onUnbind(ComponentContext c,
Object wrapperView) |
protected void |
onUnmount(ComponentContext c,
Object wrapperView)
Unload UI elements associated with this component.
|
protected int |
poolSize() |
protected void |
transferState(StateContainer _prevStateContainer,
StateContainer _nextStateContainer)
|
bindDynamicProp, canResolve, clearCachedLayout, copyInterStageImpl, getCommonProps, getDynamicProps, getEventDispatcher, getHandle, getId, getKey, getScopedContext, getSimpleName, getSimpleNameDelegate, hasBackgroundSet, hasClickHandlerSet, measure, measureMightNotCacheInternalNode, recordEventTrigger, registerWorkingRange, retrieveValue, setScopedContext, updateInternalChildState, willRenderacceptTriggerEvent, applyPreviousRenderData, callsShouldUpdateOnMount, createMountContent, dispatchErrorEvent, dispatchErrorEvent, dispatchOnEnteredRange, dispatchOnEvent, dispatchOnExitedRange, getEventTrigger, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getTreePropsForChildren, implementsAccessibility, implementsExtraAccessibilityNodes, isLayoutSpecWithSizeSpecCheck, isMountSizeDependent, isPureRender, needsPreviousRenderData, newEventHandler, newEventTrigger, onAttached, onCreateLayout, onCreateLayoutWithSizeSpec, onCreateMountContentPool, onCreateTransition, onError, onLoadStyle, onMeasureBaseline, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, onPrepare, onShouldCreateLayoutWithNewSizeSpec, populateTreeProps, recordRenderData, resolve, shouldAlwaysRemeasure, shouldUpdate, shouldUseGlobalPoolprotected StateContainer getStateContainer()
getStateContainer in class Componentpublic boolean isEquivalentTo(Component other)
ComponentThis is used to be able to skip rendering a component again. We avoid using the 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.
isEquivalentTo in interface Equivalence<Component>isEquivalentTo in class Componentother - the component to compare topublic SizeSpecMountWrapperComponent makeShallowCopy()
makeShallowCopy in class Componentprotected void createInitialState(ComponentContext c)
createInitialState in class ComponentLifecycleprotected Object onCreateMountContent(Context c)
ComponentLifecycleLithoView.onCreateMountContent in class ComponentLifecyclec - The Context to be used to create the content.protected void onMount(ComponentContext c, Object wrapperView)
ComponentLifecycleComponentLayout. Return either a Drawable or a View or null to be
mounted.onMount in class ComponentLifecyclec - The ComponentContext to mount the component into.protected void onUnmount(ComponentContext c, Object wrapperView)
ComponentLifecycleonUnmount in class ComponentLifecyclec - The Context for this mount operation.wrapperView - The Drawable or View mounted by this component.protected void onMeasure(ComponentContext c, ComponentLayout layout, int widthSpec, int heightSpec, Size size)
onMeasure in class ComponentLifecycleprotected boolean canMeasure()
ComponentLifecycleComponentLifecycle is able to measure itself according to specific size
constraints.canMeasure in class ComponentLifecycleprotected void onBoundsDefined(ComponentContext c, ComponentLayout layout)
ComponentLifecycleComponentLayout 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.onBoundsDefined in class ComponentLifecyclec - The Context used by this component.layout - The ComponentLayout with defined position and size.protected void onDetached(ComponentContext c)
ComponentLifecycleComponentTree.onDetached in class ComponentLifecyclec - The ComponentContext the Component was constructed with.protected void onBind(ComponentContext c, Object wrapperView)
onBind in class ComponentLifecycleprotected void onUnbind(ComponentContext c, Object wrapperView)
onUnbind in class ComponentLifecycleprotected boolean hasAttachDetachCallback()
hasAttachDetachCallback in class ComponentLifecycleOnAttached or OnDetached delegate
methods.public ComponentLifecycle.MountType getMountType()
ComponentLifecycleObject that will be returned by ComponentLifecycle.mount(com.facebook.litho.ComponentContext, java.lang.Object).getMountType in class ComponentLifecycleComponentLifecycle.MountTypeprotected int poolSize()
poolSize in class ComponentLifecycleprotected boolean canPreallocate()
canPreallocate in class ComponentLifecyclepublic boolean hasChildLithoViews()
ComponentLifecycleComponentLifecycle mounts views that contain component-based content that
can be incrementally mounted e.g. if the mounted view has a LithoView with incremental mount
enabled.hasChildLithoViews in class ComponentLifecycleprotected boolean hasState()
hasState in class ComponentLifecycleprotected void transferState(StateContainer _prevStateContainer, StateContainer _nextStateContainer)
ComponentLifecycletransferState in class ComponentLifecyclepublic static SizeSpecMountWrapperComponent.Builder create(ComponentContext context)
public static SizeSpecMountWrapperComponent.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)