-
- 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 String
TAG
public final static String
REACT_CLASS
-
Method Summary
Modifier and Type Method Description String
getName()
ReactEditText
createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type. ReactBaseTextShadowNode
createShadowNodeInstance()
This method should return a subclass of ReactShadowNode which will be then used formeasuring position and size of the view. ReactBaseTextShadowNode
createShadowNodeInstance(@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. void
receiveCommand(ReactEditText reactEditText, int commandId, @Nullable() ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the . void
receiveCommand(ReactEditText reactEditText, String commandId, @Nullable() ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the . void
updateExtraData(ReactEditText view, Object extraData)
Subclasses can implement this method to receive an optional extra data enqueued from thecorresponding instance of ReactShadowNode in . void
setFontSize(ReactEditText view, float fontSize)
void
setFontFamily(ReactEditText view, String fontFamily)
void
setMaxFontSizeMultiplier(ReactEditText view, float maxFontSizeMultiplier)
void
setFontWeight(ReactEditText view, @Nullable() String fontWeight)
void
setFontStyle(ReactEditText view, @Nullable() String fontStyle)
void
setIncludeFontPadding(ReactEditText view, boolean includepad)
void
setImportantForAutofill(ReactEditText view, @Nullable() String value)
void
setOnSelectionChange(ReactEditText view, boolean onSelectionChange)
void
setBlurOnSubmit(ReactEditText view, @Nullable() Boolean blurOnSubmit)
void
setOnContentSizeChange(ReactEditText view, boolean onContentSizeChange)
void
setOnScroll(ReactEditText view, boolean onScroll)
void
setOnKeyPress(ReactEditText view, boolean onKeyPress)
void
setLetterSpacing(ReactEditText view, float letterSpacing)
void
setAllowFontScaling(ReactEditText view, boolean allowFontScaling)
void
setPlaceholder(ReactEditText view, String placeholder)
void
setPlaceholderTextColor(ReactEditText view, @Nullable() Integer color)
void
setSelectionColor(ReactEditText view, @Nullable() Integer color)
void
setCursorColor(ReactEditText view, @Nullable() Integer color)
void
setCaretHidden(ReactEditText view, boolean caretHidden)
void
setContextMenuHidden(ReactEditText view, boolean contextMenuHidden)
void
setSelectTextOnFocus(ReactEditText view, boolean selectTextOnFocus)
void
setColor(ReactEditText view, @Nullable() Integer color)
void
setUnderlineColor(ReactEditText view, @Nullable() Integer underlineColor)
void
setTextAlign(ReactEditText view, @Nullable() String textAlign)
void
setTextAlignVertical(ReactEditText view, @Nullable() String textAlignVertical)
void
setInlineImageLeft(ReactEditText view, @Nullable() String resource)
void
setInlineImagePadding(ReactEditText view, int padding)
void
setEditable(ReactEditText view, boolean editable)
void
setNumLines(ReactEditText view, int numLines)
void
setMaxLength(ReactEditText view, @Nullable() Integer maxLength)
void
setTextContentType(ReactEditText view, @Nullable() String autoComplete)
void
setAutoCorrect(ReactEditText view, @Nullable() Boolean autoCorrect)
void
setMultiline(ReactEditText view, boolean multiline)
void
setSecureTextEntry(ReactEditText view, boolean password)
void
setAutoCapitalize(ReactEditText view, Dynamic autoCapitalize)
void
setKeyboardType(ReactEditText view, @Nullable() String keyboardType)
void
setReturnKeyType(ReactEditText view, String returnKeyType)
void
setDisableFullscreenUI(ReactEditText view, boolean disableFullscreenUI)
void
setReturnKeyLabel(ReactEditText view, String returnKeyLabel)
void
setBorderRadius(ReactEditText view, int index, float borderRadius)
void
setBorderStyle(ReactEditText view, @Nullable() String borderStyle)
void
showKeyboardOnFocus(ReactEditText view, boolean showKeyboardOnFocus)
void
setAutoFocus(ReactEditText view, boolean autoFocus)
void
setBorderWidth(ReactEditText view, int index, float width)
void
setBorderColor(ReactEditText view, int index, Integer color)
Map
getExportedViewConstants()
Returns a map of view-specific constants that are injected to JavaScript. 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. 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. -
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.
-
-
-
-