-
- All Implemented Interfaces:
-
com.facebook.react.bridge.NativeModule,com.facebook.react.uimanager.BaseViewManagerInterface
public class ReactTextInputManager extends BaseViewManager<ReactEditText, LayoutShadowNode>
Manages instances of TextInput.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringTAGpublic final static StringREACT_CLASS
-
Method Summary
Modifier and Type Method Description StringgetName()ReactEditTextcreateViewInstance(ThemedReactContext context)Subclasses should return a new View instance of the proper type. ReactBaseTextShadowNodecreateShadowNodeInstance()This method should return a subclass of ReactShadowNode which will be then used formeasuring position and size of the view. ReactBaseTextShadowNodecreateShadowNodeInstance(@Nullable() ReactTextViewManagerCallback reactTextViewManagerCallback)Class<out LayoutShadowNode>getShadowNodeClass()This method should return Class instance that represent type of shadow node that thismanager will return from createShadowNodeInstance. Map<String, Object>getExportedCustomBubblingEventTypeConstants()Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. Map<String, Object>getExportedCustomDirectEventTypeConstants()Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. Map<String, Integer>getCommandsMap()Subclasses of ViewManager that expect to receive commands through should override this method returning the mapbetween names of the commands and IDs that are then used in receiveCommand methodwhenever the command is dispatched for this particular ViewManager. voidreceiveCommand(ReactEditText reactEditText, int commandId, @Nullable() ReadableArray args)Subclasses may use this method to receive events/commands directly from JS through the . voidreceiveCommand(ReactEditText reactEditText, String commandId, @Nullable() ReadableArray args)Subclasses may use this method to receive events/commands directly from JS through the . voidupdateExtraData(ReactEditText view, Object extraData)Subclasses can implement this method to receive an optional extra data enqueued from thecorresponding instance of ReactShadowNode in . voidsetFontSize(ReactEditText view, float fontSize)voidsetFontFamily(ReactEditText view, String fontFamily)voidsetMaxFontSizeMultiplier(ReactEditText view, float maxFontSizeMultiplier)voidsetFontWeight(ReactEditText view, @Nullable() String fontWeight)voidsetFontStyle(ReactEditText view, @Nullable() String fontStyle)voidsetIncludeFontPadding(ReactEditText view, boolean includepad)voidsetImportantForAutofill(ReactEditText view, @Nullable() String value)voidsetOnSelectionChange(ReactEditText view, boolean onSelectionChange)voidsetBlurOnSubmit(ReactEditText view, @Nullable() Boolean blurOnSubmit)voidsetOnContentSizeChange(ReactEditText view, boolean onContentSizeChange)voidsetOnScroll(ReactEditText view, boolean onScroll)voidsetOnKeyPress(ReactEditText view, boolean onKeyPress)voidsetLetterSpacing(ReactEditText view, float letterSpacing)voidsetAllowFontScaling(ReactEditText view, boolean allowFontScaling)voidsetPlaceholder(ReactEditText view, String placeholder)voidsetPlaceholderTextColor(ReactEditText view, @Nullable() Integer color)voidsetSelectionColor(ReactEditText view, @Nullable() Integer color)voidsetCursorColor(ReactEditText view, @Nullable() Integer color)voidsetCaretHidden(ReactEditText view, boolean caretHidden)voidsetContextMenuHidden(ReactEditText view, boolean contextMenuHidden)voidsetSelectTextOnFocus(ReactEditText view, boolean selectTextOnFocus)voidsetColor(ReactEditText view, @Nullable() Integer color)voidsetUnderlineColor(ReactEditText view, @Nullable() Integer underlineColor)voidsetTextAlign(ReactEditText view, @Nullable() String textAlign)voidsetTextAlignVertical(ReactEditText view, @Nullable() String textAlignVertical)voidsetInlineImageLeft(ReactEditText view, @Nullable() String resource)voidsetInlineImagePadding(ReactEditText view, int padding)voidsetEditable(ReactEditText view, boolean editable)voidsetNumLines(ReactEditText view, int numLines)voidsetMaxLength(ReactEditText view, @Nullable() Integer maxLength)voidsetTextContentType(ReactEditText view, @Nullable() String autoComplete)voidsetAutoCorrect(ReactEditText view, @Nullable() Boolean autoCorrect)voidsetMultiline(ReactEditText view, boolean multiline)voidsetSecureTextEntry(ReactEditText view, boolean password)voidsetAutoCapitalize(ReactEditText view, Dynamic autoCapitalize)voidsetKeyboardType(ReactEditText view, @Nullable() String keyboardType)voidsetReturnKeyType(ReactEditText view, String returnKeyType)voidsetDisableFullscreenUI(ReactEditText view, boolean disableFullscreenUI)voidsetReturnKeyLabel(ReactEditText view, String returnKeyLabel)voidsetBorderRadius(ReactEditText view, int index, float borderRadius)voidsetBorderStyle(ReactEditText view, @Nullable() String borderStyle)voidshowKeyboardOnFocus(ReactEditText view, boolean showKeyboardOnFocus)voidsetAutoFocus(ReactEditText view, boolean autoFocus)voidsetBorderWidth(ReactEditText view, int index, float width)voidsetBorderColor(ReactEditText view, int index, Integer color)MapgetExportedViewConstants()Returns a map of view-specific constants that are injected to JavaScript. voidsetPadding(ReactEditText view, int left, int top, int right, int bottom)Subclasses can override this method to set padding for the given View in Fabric. ObjectupdateState(ReactEditText view, ReactStylesDiffMap props, @Nullable() StateWrapper stateWrapper)Subclasses can implement this method to receive state updates shared between all instances ofthis component type. -
Methods inherited from class com.facebook.react.uimanager.BaseViewManager
setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setAccessibilityValue, setBackgroundColor, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setElevation, setImportantForAccessibility, setMoveShouldSetResponder, setMoveShouldSetResponderCapture, setNativeId, setOpacity, setPointerEnter, setPointerLeave, setPointerMove, setRenderToHardwareTexture, setResponderEnd, setResponderGrant, setResponderMove, setResponderReject, setResponderRelease, setResponderStart, setResponderTerminate, setResponderTerminationRequest, setRotation, setScaleX, setScaleY, setShadowColor, setShouldBlockNativeResponder, setStartShouldSetResponder, setStartShouldSetResponderCapture, setTestId, setTouchCancel, setTouchEnd, setTouchMove, setTouchStart, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex -
Methods inherited from class com.facebook.react.uimanager.ViewManager
createShadowNodeInstance, createShadowNodeInstance, createView, getExportedViewConstants, getNativeProps, getShadowNodeClass, measure, measure, onDropViewInstance, receiveCommand, receiveCommand, setPadding, updateExtraData, updateProperties, updateState -
Methods inherited from class com.facebook.react.bridge.BaseJavaModule
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy -
Methods inherited from class com.facebook.react.uimanager.BaseViewManagerInterface
setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setBackgroundColor, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setShadowColor, setTestId, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
createViewInstance
ReactEditText createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type.
-
createShadowNodeInstance
ReactBaseTextShadowNode createShadowNodeInstance()
This method should return a subclass of ReactShadowNode which will be then used formeasuring position and size of the view. In most of the cases this should just return aninstance of ReactShadowNode
-
createShadowNodeInstance
ReactBaseTextShadowNode createShadowNodeInstance(@Nullable() ReactTextViewManagerCallback reactTextViewManagerCallback)
-
getShadowNodeClass
Class<out LayoutShadowNode> getShadowNodeClass()
This method should return Class instance that represent type of shadow node that thismanager will return from createShadowNodeInstance.
This method will be used in the bridge initialization phase to collect properties exposedusing ReactProp (or ReactPropGroup) annotation from the ReactShadowNode subclass specific for native view this manager provides.
-
getExportedCustomBubblingEventTypeConstants
@Nullable() Map<String, Object> getExportedCustomBubblingEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. This should return bubbling directly-dispatched event types and specify whatnames should be used to subscribe to either form (bubbling/capturing).
Returned map should be of the form:
{ "onTwirl": { "phasedRegistrationNames": { "bubbled": "onTwirl", "captured": "onTwirlCaptured" } } }
-
getExportedCustomDirectEventTypeConstants
@Nullable() Map<String, Object> getExportedCustomDirectEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. This should return non-bubbling directly-dispatched event types.
Returned map should be of the form:
{ "onTwirl": { "registrationName": "onTwirl" } }
-
getCommandsMap
@Nullable() Map<String, Integer> getCommandsMap()
Subclasses of ViewManager that expect to receive commands through should override this method returning the mapbetween names of the commands and IDs that are then used in receiveCommand methodwhenever the command is dispatched for this particular ViewManager.
-
receiveCommand
void receiveCommand(ReactEditText reactEditText, int commandId, @Nullable() ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the . Good example of such a command would be
{@code scrollTo}request with coordinatesfor a ScrollView instance.This method is deprecated use receiveCommand instead.
- Parameters:
commandId- code of the commandargs- optional arguments for the command
-
receiveCommand
void receiveCommand(ReactEditText reactEditText, String commandId, @Nullable() ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the . Good example of such a command would be
{@code scrollTo}request with coordinatesfor a ReactScrollView instance.- Parameters:
commandId- code of the commandargs- optional arguments for the command
-
updateExtraData
void updateExtraData(ReactEditText view, Object extraData)
Subclasses can implement this method to receive an optional extra data enqueued from thecorresponding instance of ReactShadowNode in .
Since css layout step and ui updates can be executed in separate thread apart of settingx/y/width/height this is the recommended and thread-safe way of passing extra data from cssnode to the native view counterpart.
TODO T7247021: Replace updateExtraData with generic update props mechanism after D2086999
-
setFontSize
void setFontSize(ReactEditText view, float fontSize)
-
setFontFamily
void setFontFamily(ReactEditText view, String fontFamily)
-
setMaxFontSizeMultiplier
void setMaxFontSizeMultiplier(ReactEditText view, float maxFontSizeMultiplier)
-
setFontWeight
void setFontWeight(ReactEditText view, @Nullable() String fontWeight)
-
setFontStyle
void setFontStyle(ReactEditText view, @Nullable() String fontStyle)
-
setIncludeFontPadding
void setIncludeFontPadding(ReactEditText view, boolean includepad)
-
setImportantForAutofill
void setImportantForAutofill(ReactEditText view, @Nullable() String value)
-
setOnSelectionChange
void setOnSelectionChange(ReactEditText view, boolean onSelectionChange)
-
setBlurOnSubmit
void setBlurOnSubmit(ReactEditText view, @Nullable() Boolean blurOnSubmit)
-
setOnContentSizeChange
void setOnContentSizeChange(ReactEditText view, boolean onContentSizeChange)
-
setOnScroll
void setOnScroll(ReactEditText view, boolean onScroll)
-
setOnKeyPress
void setOnKeyPress(ReactEditText view, boolean onKeyPress)
-
setLetterSpacing
void setLetterSpacing(ReactEditText view, float letterSpacing)
-
setAllowFontScaling
void setAllowFontScaling(ReactEditText view, boolean allowFontScaling)
-
setPlaceholder
void setPlaceholder(ReactEditText view, String placeholder)
-
setPlaceholderTextColor
void setPlaceholderTextColor(ReactEditText view, @Nullable() Integer color)
-
setSelectionColor
void setSelectionColor(ReactEditText view, @Nullable() Integer color)
-
setCursorColor
void setCursorColor(ReactEditText view, @Nullable() Integer color)
-
setCaretHidden
void setCaretHidden(ReactEditText view, boolean caretHidden)
-
setContextMenuHidden
void setContextMenuHidden(ReactEditText view, boolean contextMenuHidden)
-
setSelectTextOnFocus
void setSelectTextOnFocus(ReactEditText view, boolean selectTextOnFocus)
-
setColor
void setColor(ReactEditText view, @Nullable() Integer color)
-
setUnderlineColor
void setUnderlineColor(ReactEditText view, @Nullable() Integer underlineColor)
-
setTextAlign
void setTextAlign(ReactEditText view, @Nullable() String textAlign)
-
setTextAlignVertical
void setTextAlignVertical(ReactEditText view, @Nullable() String textAlignVertical)
-
setInlineImageLeft
void setInlineImageLeft(ReactEditText view, @Nullable() String resource)
-
setInlineImagePadding
void setInlineImagePadding(ReactEditText view, int padding)
-
setEditable
void setEditable(ReactEditText view, boolean editable)
-
setNumLines
void setNumLines(ReactEditText view, int numLines)
-
setMaxLength
void setMaxLength(ReactEditText view, @Nullable() Integer maxLength)
-
setTextContentType
void setTextContentType(ReactEditText view, @Nullable() String autoComplete)
-
setAutoCorrect
void setAutoCorrect(ReactEditText view, @Nullable() Boolean autoCorrect)
-
setMultiline
void setMultiline(ReactEditText view, boolean multiline)
-
setSecureTextEntry
void setSecureTextEntry(ReactEditText view, boolean password)
-
setAutoCapitalize
void setAutoCapitalize(ReactEditText view, Dynamic autoCapitalize)
-
setKeyboardType
void setKeyboardType(ReactEditText view, @Nullable() String keyboardType)
-
setReturnKeyType
void setReturnKeyType(ReactEditText view, String returnKeyType)
-
setDisableFullscreenUI
void setDisableFullscreenUI(ReactEditText view, boolean disableFullscreenUI)
-
setReturnKeyLabel
void setReturnKeyLabel(ReactEditText view, String returnKeyLabel)
-
setBorderRadius
void setBorderRadius(ReactEditText view, int index, float borderRadius)
-
setBorderStyle
void setBorderStyle(ReactEditText view, @Nullable() String borderStyle)
-
showKeyboardOnFocus
void showKeyboardOnFocus(ReactEditText view, boolean showKeyboardOnFocus)
-
setAutoFocus
void setAutoFocus(ReactEditText view, boolean autoFocus)
-
setBorderWidth
void setBorderWidth(ReactEditText view, int index, float width)
-
setBorderColor
void setBorderColor(ReactEditText view, int index, Integer color)
-
getExportedViewConstants
@Nullable() Map getExportedViewConstants()
Returns a map of view-specific constants that are injected to JavaScript. These constants aremade accessible via UIManager..Constants.
-
setPadding
void setPadding(ReactEditText view, int left, int top, int right, int bottom)
Subclasses can override this method to set padding for the given View in Fabric. Since not allcomponents support setting padding, the default implementation of this method does nothing.
-
updateState
Object updateState(ReactEditText view, ReactStylesDiffMap props, @Nullable() StateWrapper stateWrapper)
Subclasses can implement this method to receive state updates shared between all instances ofthis component type.
-
-
-
-