public final class Text extends ComponentLifecycle
com.facebook.litho.widget.TextSpec
Modifier and Type | Class and Description |
---|---|
static class |
Text.Builder |
ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.StateContainer, ComponentLifecycle.StateUpdate
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 Text.Builder |
create(ComponentContext context) |
static Text.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes) |
protected int |
getExtraAccessibilityNodeAt(int x,
int y,
Component _abstractImpl)
Get extra accessibility node id at a given point within the component.
|
protected int |
getExtraAccessibilityNodesCount(Component _abstractImpl)
The number of extra accessibility nodes that this component wishes to provides to the
accessibility system.
|
ComponentLifecycle.MountType |
getMountType()
This indicates the type of the
Object that will be returned by
ComponentLifecycle.mount(com.facebook.litho.ComponentContext, java.lang.Object, com.facebook.litho.Component<?>) . |
static EventHandler |
getTextOffsetOnTouchEventHandler(ComponentContext context) |
boolean |
implementsAccessibility()
Whether this component will populate any accessibility nodes or events that are passed to it.
|
boolean |
implementsExtraAccessibilityNodes()
Whether this component will expose any virtual views to the accessibility framework
|
protected boolean |
isMountSizeDependent() |
boolean |
isPureRender() |
protected void |
onBoundsDefined(ComponentContext c,
ComponentLayout layout,
Component _abstractImpl)
Called after the layout calculation is finished and the given
ComponentLayout
has its bounds defined. |
protected Object |
onCreateMountContent(ComponentContext c)
Create the object that will be mounted in the
LithoView . |
protected void |
onLoadStyle(ComponentContext c,
Component _abstractImpl) |
protected void |
onMeasure(ComponentContext context,
ComponentLayout layout,
int widthSpec,
int heightSpec,
Size size,
Component _abstractImpl) |
protected void |
onMount(ComponentContext c,
Object textDrawable,
Component _abstractImpl)
Deploy all UI elements representing the final bounds defined in the given
ComponentLayout . |
protected void |
onPopulateAccessibilityNode(AccessibilityNodeInfoCompat node,
Component _abstractImpl)
Populate an accessibility node with information about the component.
|
protected void |
onPopulateExtraAccessibilityNode(AccessibilityNodeInfoCompat node,
int extraNodeIndex,
int componentBoundsLeft,
int componentBoundsTop,
Component _abstractImpl)
Populate an extra accessibility node.
|
protected void |
onUnmount(ComponentContext c,
Object textDrawable,
Component _abstractImpl)
Unload UI elements associated with this component.
|
protected int |
poolSize() |
boolean |
shouldUseDisplayList()
Whether this drawable mount spec should cache its drawing in a display list.
|
acceptTriggerEvent, acquireDiff, acquireOutput, applyPreviousRenderData, callsShouldUpdateOnMount, canAcceptTrigger, canMountIncrementally, createInitialState, dispatchOnEvent, getEventTrigger, getTreePropsForChildren, hasState, needsPreviousRenderData, newEventHandler, newEventHandler, newEventTrigger, onBind, onCreateLayout, onCreateLayoutWithSizeSpec, onCreateTransition, onMeasureBaseline, onPrepare, onUnbind, populateTreeProps, recordRenderData, releaseDiff, releaseOutput, shouldUpdate, transferState
protected void onLoadStyle(ComponentContext c, Component _abstractImpl)
onLoadStyle
in class ComponentLifecycle
protected void onMeasure(ComponentContext context, ComponentLayout layout, int widthSpec, int heightSpec, Size size, Component _abstractImpl)
onMeasure
in class ComponentLifecycle
protected boolean canMeasure()
ComponentLifecycle
ComponentLifecycle
is able to measure itself according
to specific size constraints.canMeasure
in class ComponentLifecycle
protected void onBoundsDefined(ComponentContext c, ComponentLayout layout, Component _abstractImpl)
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._abstractImpl
- The Component
for this component.protected Object onCreateMountContent(ComponentContext c)
ComponentLifecycle
LithoView
.onCreateMountContent
in class ComponentLifecycle
c
- The ComponentContext
to be used to create the content.protected void onMount(ComponentContext c, Object textDrawable, Component _abstractImpl)
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._abstractImpl
- The Component
for this component.protected void onUnmount(ComponentContext c, Object textDrawable, Component _abstractImpl)
ComponentLifecycle
onUnmount
in class ComponentLifecycle
c
- The Context
for this mount operation.textDrawable
- The Drawable
or View
mounted by this component._abstractImpl
- The Component
for this component.protected void onPopulateAccessibilityNode(AccessibilityNodeInfoCompat node, Component _abstractImpl)
ComponentLifecycle
onPopulateAccessibilityNode
in class ComponentLifecycle
node
- node to populate_abstractImpl
- The Component
for this component.public boolean implementsAccessibility()
ComponentLifecycle
implementsAccessibility
in class ComponentLifecycle
protected int getExtraAccessibilityNodesCount(Component _abstractImpl)
ComponentLifecycle
getExtraAccessibilityNodesCount
in class ComponentLifecycle
_abstractImpl
- the Component
for this componentprotected void onPopulateExtraAccessibilityNode(AccessibilityNodeInfoCompat node, int extraNodeIndex, int componentBoundsLeft, int componentBoundsTop, Component _abstractImpl)
ComponentLifecycle
onPopulateExtraAccessibilityNode
in class ComponentLifecycle
node
- node to populateextraNodeIndex
- index of extra nodecomponentBoundsLeft
- left bound of the mounted componentcomponentBoundsTop
- top bound of the mounted component_abstractImpl
- The Component
for this component.public boolean implementsExtraAccessibilityNodes()
ComponentLifecycle
implementsExtraAccessibilityNodes
in class ComponentLifecycle
protected int getExtraAccessibilityNodeAt(int x, int y, Component _abstractImpl)
ComponentLifecycle
getExtraAccessibilityNodeAt
in class ComponentLifecycle
x
- x co-ordinate within the mounted componenty
- y co-ordinate within the mounted component_abstractImpl
- the Component
for this componentExploreByTouchHelper#INVALID_ID
public ComponentLifecycle.MountType getMountType()
ComponentLifecycle
Object
that will be returned by
ComponentLifecycle.mount(com.facebook.litho.ComponentContext, java.lang.Object, com.facebook.litho.Component<?>)
.getMountType
in class ComponentLifecycle
ComponentLifecycle.MountType
protected int poolSize()
poolSize
in class ComponentLifecycle
protected boolean canPreallocate()
canPreallocate
in class ComponentLifecycle
public boolean shouldUseDisplayList()
ComponentLifecycle
shouldUseDisplayList
in class ComponentLifecycle
protected boolean isMountSizeDependent()
isMountSizeDependent
in class ComponentLifecycle
public boolean isPureRender()
isPureRender
in class ComponentLifecycle
public static EventHandler getTextOffsetOnTouchEventHandler(ComponentContext context)
public static Text.Builder create(ComponentContext context)
public static Text.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)