public class TestViewComponent extends TestComponent
| Modifier and Type | Class and Description |
|---|---|
static class |
TestViewComponent.Builder |
Component.ContainerBuilder<T extends Component.ContainerBuilder<T>>ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.TransitionContainermIsUnique| Modifier and Type | Method and Description |
|---|---|
protected boolean |
callsShouldUpdateOnMount() |
protected boolean |
canMeasure()
Whether this
ComponentLifecycle is able to measure itself according to specific size
constraints. |
static TestViewComponent.Builder |
create(ComponentContext context) |
static TestViewComponent.Builder |
create(ComponentContext context,
boolean callsShouldUpdateOnMount,
boolean isPureRender,
boolean canMeasure,
boolean canMountIncrementally) |
static TestViewComponent.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes) |
static TestViewComponent.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes,
boolean callsShouldUpdateOnMount,
boolean isPureRender,
boolean canMeasure,
boolean canMountIncrementally) |
boolean |
equals(Object o) |
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 boolean |
hasChildLithoViews()
Whether this
ComponentLifecycle mounts views that contain component-based content that
can be incrementally mounted e.g. |
int |
hashCode() |
protected boolean |
isPureRender() |
protected void |
onBind(ComponentContext c,
Object mountedContent) |
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 |
onMeasure(ComponentContext c,
ComponentLayout layout,
int widthSpec,
int heightSpec,
Size size) |
protected void |
onMount(ComponentContext c,
Object convertView)
Deploy all UI elements representing the final bounds defined in the given
ComponentLayout. |
protected void |
onUnbind(ComponentContext c,
Object mountedContent) |
protected void |
onUnmount(ComponentContext c,
Object mountedContent)
Unload UI elements associated with this component.
|
boolean |
shouldUpdate(Component previous,
Component next)
Whether the component needs updating.
|
dispatchOnEvent, getDispatchedEventHandlers, getEventState, isBound, isEquivalentTo, isEquivalentToCalled, isMounted, resetInteractions, wasMeasureCalled, wasOnAttachedCalled, wasOnBindCalled, wasOnBoundsDefinedCalled, wasOnDetachedCalled, wasOnMountCalled, wasOnUnbindCalled, wasOnUnmountCalledbindDynamicProp, canResolve, clearCachedLayout, copyInterStageImpl, getCommonProps, getDynamicProps, getEventDispatcher, getHandle, getId, getKey, getScopedContext, getSimpleName, getSimpleNameDelegate, getStateContainer, hasBackgroundSet, hasClickHandlerSet, makeShallowCopy, measure, measureMightNotCacheInternalNode, recordEventTrigger, registerWorkingRange, retrieveValue, setScopedContext, updateInternalChildState, willRenderacceptTriggerEvent, applyPreviousRenderData, canPreallocate, createInitialState, createMountContent, dispatchErrorEvent, dispatchErrorEvent, dispatchOnEnteredRange, dispatchOnExitedRange, getEventTrigger, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getTreePropsForChildren, hasAttachDetachCallback, hasState, implementsAccessibility, implementsExtraAccessibilityNodes, isLayoutSpecWithSizeSpecCheck, isMountSizeDependent, needsPreviousRenderData, newEventHandler, newEventTrigger, onAttached, onCreateLayout, onCreateLayoutWithSizeSpec, onCreateMountContentPool, onCreateTransition, onDetached, onError, onLoadStyle, onMeasureBaseline, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, onPrepare, onShouldCreateLayoutWithNewSizeSpec, poolSize, populateTreeProps, recordRenderData, resolve, shouldAlwaysRemeasure, shouldUseGlobalPool, transferStatepublic boolean shouldUpdate(Component previous, Component next)
ComponentLifecycleFor layout components, the framework will verify that none of the children of the component need updating, and that both components have the same number of children. Therefore this method just needs to determine any changes to the top-level component that would cause it to need to be updated (for example, a click handler was added).
For mount specs, the framework does nothing extra and this method alone determines whether the component is updated or not.
shouldUpdate in class ComponentLifecycleprevious - the previous component to compare against.next - the component that is now in use.protected boolean callsShouldUpdateOnMount()
callsShouldUpdateOnMount in class ComponentLifecycleprotected boolean isPureRender()
isPureRender in class ComponentLifecycleprotected 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 Object onCreateMountContent(Context c)
ComponentLifecycleLithoView.onCreateMountContent in class ComponentLifecyclec - The Context to be used to create the content.protected void onMount(ComponentContext c, Object convertView)
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 mountedContent)
ComponentLifecycleonUnmount in class ComponentLifecyclec - The Context for this mount operation.mountedContent - The Drawable or View mounted by this component.protected boolean canMeasure()
ComponentLifecycleComponentLifecycle is able to measure itself according to specific size
constraints.canMeasure in class ComponentLifecycleprotected void onMeasure(ComponentContext c, ComponentLayout layout, int widthSpec, int heightSpec, Size size)
onMeasure 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 onBind(ComponentContext c, Object mountedContent)
onBind in class ComponentLifecycleprotected void onUnbind(ComponentContext c, Object mountedContent)
onUnbind in class ComponentLifecyclepublic ComponentLifecycle.MountType getMountType()
ComponentLifecycleObject that will be returned by ComponentLifecycle.mount(com.facebook.litho.ComponentContext, java.lang.Object).getMountType in class ComponentLifecycleComponentLifecycle.MountTypepublic static TestViewComponent.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)
public static TestViewComponent.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes, boolean callsShouldUpdateOnMount, boolean isPureRender, boolean canMeasure, boolean canMountIncrementally)
public static TestViewComponent.Builder create(ComponentContext context)
public static TestViewComponent.Builder create(ComponentContext context, boolean callsShouldUpdateOnMount, boolean isPureRender, boolean canMeasure, boolean canMountIncrementally)
public int hashCode()
hashCode in class TestComponentpublic boolean equals(Object o)
equals in class TestComponent