public class TestDrawableComponent extends TestComponent
Modifier and Type | Class and Description |
---|---|
static class |
TestDrawableComponent.BlockInPrepareComponentListener
Deprecated.
A listener that will block in prepare until allowPrepareToComplete is called from another
thread.
|
static class |
TestDrawableComponent.Builder
Deprecated.
|
static interface |
TestDrawableComponent.TestComponentListener
Deprecated.
|
Component.ContainerBuilder<T extends Component.ContainerBuilder<T>>
ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.TransitionContainer
mIsUnique
Modifier and Type | Method and Description |
---|---|
protected boolean |
callsShouldUpdateOnMount()
Deprecated.
|
protected boolean |
canMeasure()
Deprecated.
Whether this
ComponentLifecycle is able to measure itself according to specific size
constraints. |
static TestDrawableComponent.Builder |
create(ComponentContext context)
Deprecated.
|
static TestDrawableComponent.Builder |
create(ComponentContext context,
boolean callsShouldUpdateOnMount,
boolean isPureRender,
boolean canMeasure,
boolean implementsAccessibility)
Deprecated.
|
static TestDrawableComponent.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes)
Deprecated.
|
static TestDrawableComponent.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes,
boolean callsShouldUpdateOnMount,
boolean isPureRender,
boolean canMeasure,
boolean implementsAccessibility)
Deprecated.
|
static TestDrawableComponent.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes,
boolean callsShouldUpdateOnMount,
boolean isPureRender,
boolean canMeasure,
boolean implementsAccessibility,
boolean isMountSizeDependent)
Deprecated.
|
boolean |
equals(Object o)
Deprecated.
|
ComponentLifecycle.MountType |
getMountType()
Deprecated.
This indicates the type of the
Object that will be returned by ComponentLifecycle.mount(com.facebook.litho.ComponentContext, java.lang.Object) . |
int |
hashCode()
Deprecated.
|
protected boolean |
implementsAccessibility()
Deprecated.
Whether this component will populate any accessibility nodes or events that are passed to it.
|
boolean |
isMountSizeDependent()
Deprecated.
|
protected boolean |
isPureRender()
Deprecated.
|
Component |
makeShallowCopy()
Deprecated.
|
protected void |
onBind(ComponentContext c,
Object mountedContent)
Deprecated.
|
protected void |
onBoundsDefined(ComponentContext c,
ComponentLayout layout)
Deprecated.
Called after the layout calculation is finished and the given
ComponentLayout has its
bounds defined. |
protected Object |
onCreateMountContent(Context c)
Deprecated.
Create the object that will be mounted in the
LithoView . |
protected void |
onMeasure(ComponentContext c,
ComponentLayout layout,
int widthSpec,
int heightSpec,
Size size)
Deprecated.
|
protected void |
onMount(ComponentContext c,
Object convertDrawable)
Deprecated.
Deploy all UI elements representing the final bounds defined in the given
ComponentLayout . |
protected void |
onPrepare(ComponentContext c)
Deprecated.
|
protected void |
onUnbind(ComponentContext c,
Object mountedContent)
Deprecated.
|
protected void |
onUnmount(ComponentContext c,
Object mountedContent)
Deprecated.
Unload UI elements associated with this component.
|
void |
setTestComponentListener(TestDrawableComponent.TestComponentListener listener)
Deprecated.
|
boolean |
shouldUpdate(Component previous,
Component next)
Deprecated.
Whether the component needs updating.
|
dispatchOnEvent, getDispatchedEventHandlers, getEventState, isBound, isEquivalentTo, isEquivalentToCalled, isMounted, resetInteractions, wasMeasureCalled, wasOnAttachedCalled, wasOnBindCalled, wasOnBoundsDefinedCalled, wasOnDetachedCalled, wasOnMountCalled, wasOnUnbindCalled, wasOnUnmountCalled
bindDynamicProp, canResolve, clearCachedLayout, copyInterStageImpl, getCommonProps, getDynamicProps, getEventDispatcher, getHandle, getId, getKey, getScopedContext, getSimpleName, getSimpleNameDelegate, getStateContainer, hasBackgroundSet, hasClickHandlerSet, measure, measureMightNotCacheInternalNode, recordEventTrigger, registerWorkingRange, retrieveValue, setScopedContext, updateInternalChildState, willRender
acceptTriggerEvent, applyPreviousRenderData, canPreallocate, createInitialState, createMountContent, dispatchErrorEvent, dispatchErrorEvent, dispatchOnEnteredRange, dispatchOnExitedRange, getEventTrigger, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getTreePropsForChildren, hasAttachDetachCallback, hasChildLithoViews, hasState, implementsExtraAccessibilityNodes, isLayoutSpecWithSizeSpecCheck, needsPreviousRenderData, newEventHandler, newEventTrigger, onAttached, onCreateLayout, onCreateLayoutWithSizeSpec, onCreateMountContentPool, onCreateTransition, onDetached, onError, onLoadStyle, onMeasureBaseline, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, onShouldCreateLayoutWithNewSizeSpec, poolSize, populateTreeProps, recordRenderData, resolve, shouldAlwaysRemeasure, shouldUseGlobalPool, transferState
public boolean shouldUpdate(Component previous, Component next)
ComponentLifecycle
For 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 ComponentLifecycle
previous
- the previous component to compare against.next
- the component that is now in use.protected boolean callsShouldUpdateOnMount()
callsShouldUpdateOnMount
in class ComponentLifecycle
protected boolean isPureRender()
isPureRender
in class ComponentLifecycle
protected boolean implementsAccessibility()
ComponentLifecycle
implementsAccessibility
in class ComponentLifecycle
public boolean isMountSizeDependent()
isMountSizeDependent
in class ComponentLifecycle
protected Object onCreateMountContent(Context c)
ComponentLifecycle
LithoView
.onCreateMountContent
in class ComponentLifecycle
c
- The Context
to be used to create the content.protected void onMount(ComponentContext c, Object convertDrawable)
ComponentLifecycle
ComponentLayout
. Return either a Drawable
or a View
or null
to be
mounted.onMount
in class ComponentLifecycle
c
- The ComponentContext
to mount the component into.protected void onUnmount(ComponentContext c, Object mountedContent)
ComponentLifecycle
onUnmount
in class ComponentLifecycle
c
- The Context
for this mount operation.mountedContent
- The Drawable
or View
mounted by this component.protected boolean canMeasure()
ComponentLifecycle
ComponentLifecycle
is able to measure itself according to specific size
constraints.canMeasure
in class ComponentLifecycle
protected void onMeasure(ComponentContext c, ComponentLayout layout, int widthSpec, int heightSpec, Size size)
onMeasure
in class ComponentLifecycle
protected void onBoundsDefined(ComponentContext c, ComponentLayout layout)
ComponentLifecycle
ComponentLayout
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 ComponentLifecycle
c
- The Context
used by this component.layout
- The ComponentLayout
with defined position and size.protected void onBind(ComponentContext c, Object mountedContent)
onBind
in class ComponentLifecycle
protected void onUnbind(ComponentContext c, Object mountedContent)
onUnbind
in class ComponentLifecycle
public ComponentLifecycle.MountType getMountType()
ComponentLifecycle
Object
that will be returned by ComponentLifecycle.mount(com.facebook.litho.ComponentContext, java.lang.Object)
.getMountType
in class ComponentLifecycle
ComponentLifecycle.MountType
public Component makeShallowCopy()
makeShallowCopy
in class Component
protected void onPrepare(ComponentContext c)
onPrepare
in class ComponentLifecycle
public void setTestComponentListener(TestDrawableComponent.TestComponentListener listener)
public static TestDrawableComponent.Builder create(ComponentContext context)
public static TestDrawableComponent.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)
public static TestDrawableComponent.Builder create(ComponentContext context, boolean callsShouldUpdateOnMount, boolean isPureRender, boolean canMeasure, boolean implementsAccessibility)
public static TestDrawableComponent.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes, boolean callsShouldUpdateOnMount, boolean isPureRender, boolean canMeasure, boolean implementsAccessibility)
public static TestDrawableComponent.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes, boolean callsShouldUpdateOnMount, boolean isPureRender, boolean canMeasure, boolean implementsAccessibility, boolean isMountSizeDependent)
public boolean equals(Object o)
equals
in class TestComponent
public int hashCode()
hashCode
in class TestComponent