public final class TextInput extends Component
EditText. It is measured
 based on the input text String representation.
 Performance is critical for good user experience. Follow these tips for good performance:
OnTrigger to update text, request view
       focus or set selection. TextInput.setText(c, key, text).
   Because this component is backed by android EditText many native capabilities are
 applicable:
 
InputFilter to set a text length limit or modify text input.
   InputType
       constants.
 It is also treated by the system as an android EditText:
 
EditText receives focus, a system keyboard is shown.
   EditText is the first element in the
       View hierarchy, it gains focus.
 Example of multiline editable text with custom text color, text length limit, removed underline drawable, and sentence capitalisation:
 private static final InputFilter lenFilter = new InputFilter.LengthFilter(maxLength);
 TextInput.create(c)
   .initialText(text)
   .textColorStateList(ColorStateList.valueOf(color))
   .multiline(true)
   .inputFilter(lenFilter)
   .backgroundColor(Color.TRANSPARENT)
   .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES)
   .build();
 com.facebook.litho.widget.TextInputSpec| Modifier and Type | Class and Description | 
|---|---|
| static class  | TextInput.Builder | 
Component.ContainerBuilder<T extends Component.ContainerBuilder<T>>ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.TransitionContainerbindDynamicProp, canResolve, clearCachedLayout, copyInterStageImpl, getCommonProps, getDynamicProps, getEventDispatcher, getHandle, getId, getKey, getScopedContext, getSimpleName, getSimpleNameDelegate, hasBackgroundSet, hasClickHandlerSet, measure, measureMightNotCacheInternalNode, registerWorkingRange, retrieveValue, setScopedContext, updateInternalChildState, willRenderapplyPreviousRenderData, callsShouldUpdateOnMount, createMountContent, dispatchErrorEvent, dispatchErrorEvent, dispatchOnEnteredRange, dispatchOnEvent, dispatchOnExitedRange, getEventTrigger, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getTreePropsForChildren, hasAttachDetachCallback, hasChildLithoViews, implementsAccessibility, implementsExtraAccessibilityNodes, isLayoutSpecWithSizeSpecCheck, isMountSizeDependent, needsPreviousRenderData, newEventHandler, newEventTrigger, onAttached, onBoundsDefined, onCreateLayout, onCreateLayoutWithSizeSpec, onCreateMountContentPool, onCreateTransition, onDetached, onError, onMeasureBaseline, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, onPrepare, onShouldCreateLayoutWithNewSizeSpec, populateTreeProps, recordRenderData, resolve, shouldAlwaysRemeasure, 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 TextInput makeShallowCopy()
makeShallowCopy in class Componentprotected void createInitialState(ComponentContext c)
createInitialState in class ComponentLifecycleprotected void onLoadStyle(ComponentContext c)
onLoadStyle in class ComponentLifecycleprotected 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 boolean shouldUpdate(Component _prevAbstractImpl, Component _nextAbstractImpl)
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 ComponentLifecycle_prevAbstractImpl - the previous component to compare against._nextAbstractImpl - the component that is now in use.protected Object onCreateMountContent(Context c)
ComponentLifecycleLithoView.onCreateMountContent in class ComponentLifecyclec - The Context to be used to create the content.protected void onMount(ComponentContext c, Object editText)
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 onBind(ComponentContext c, Object editText)
onBind in class ComponentLifecycleprotected void onUnmount(ComponentContext c, Object editText)
ComponentLifecycleonUnmount in class ComponentLifecyclec - The Context for this mount operation.editText - The Drawable or View mounted by this component.protected void onUnbind(ComponentContext c, Object editText)
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.MountTypeprotected int poolSize()
poolSize in class ComponentLifecycleprotected boolean canPreallocate()
canPreallocate in class ComponentLifecyclepublic boolean isPureRender()
isPureRender in class ComponentLifecyclepublic static EventHandler getTextChangedEventHandler(ComponentContext context)
public static EventHandler getSelectionChangedEventHandler(ComponentContext context)
public static EventHandler getKeyUpEventHandler(ComponentContext context)
public static EventHandler getKeyPreImeEventHandler(ComponentContext context)
public static EventHandler getEditorActionEventHandler(ComponentContext context)
public static EventHandler getSetTextEventHandler(ComponentContext context)
public static EventHandler getInputConnectionEventHandler(ComponentContext context)
@Deprecated public static EventTrigger requestFocusTrigger(ComponentContext c, String key)
@Deprecated public static EventTrigger clearFocusTrigger(ComponentContext c, String key)
@Deprecated public static EventTrigger getTextTrigger(ComponentContext c, String key)
@Deprecated public static EventTrigger setTextTrigger(ComponentContext c, String key)
@Deprecated public static EventTrigger dispatchKeyTrigger(ComponentContext c, String key)
@Deprecated public static EventTrigger setSelectionTrigger(ComponentContext c, String key)
public static void requestFocus(ComponentContext c, Handle handle)
public static void requestFocus(ComponentContext c, String key)
public static void requestFocus(EventTrigger trigger)
public static void clearFocus(ComponentContext c, Handle handle)
public static void clearFocus(ComponentContext c, String key)
public static void clearFocus(EventTrigger trigger)
public static CharSequence getText(ComponentContext c, Handle handle)
public static CharSequence getText(ComponentContext c, String key)
public static CharSequence getText(EventTrigger trigger)
public static void setText(ComponentContext c, Handle handle, CharSequence text)
public static void setText(ComponentContext c, String key, CharSequence text)
public static void setText(EventTrigger trigger, CharSequence text)
public static void dispatchKey(ComponentContext c, Handle handle, KeyEvent keyEvent)
public static void dispatchKey(ComponentContext c, String key, KeyEvent keyEvent)
public static void dispatchKey(EventTrigger trigger, KeyEvent keyEvent)
public static void setSelection(ComponentContext c, Handle handle, int start, int end)
public static void setSelection(ComponentContext c, String key, int start, int end)
public static void setSelection(EventTrigger trigger, int start, int end)
public Object acceptTriggerEvent(EventTrigger eventTrigger, Object eventState, Object[] params)
acceptTriggerEvent in interface EventTriggerTargetacceptTriggerEvent in class ComponentLifecyclepublic void recordEventTrigger(EventTriggersContainer container)
recordEventTrigger in interface HasEventTriggerrecordEventTrigger in class Componentprotected boolean hasState()
hasState in class ComponentLifecycleprotected void transferState(StateContainer _prevStateContainer, StateContainer _nextStateContainer)
ComponentLifecycletransferState in class ComponentLifecycleprotected static void remeasureForUpdatedText(ComponentContext c)
protected static void remeasureForUpdatedTextAsync(ComponentContext c)
protected static void remeasureForUpdatedTextSync(ComponentContext c)
public static TextInput.Builder create(ComponentContext context)
public static TextInput.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)