public class ReactTextInputManager extends BaseViewManager<ReactEditText,LayoutShadowNode>
NativeModule.NativeMethod| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
REACT_CLASS |
static java.lang.String |
TAG |
sStateDescriptionMETHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC| Constructor and Description |
|---|
ReactTextInputManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEventEmitters(ThemedReactContext reactContext,
ReactEditText editText)
Subclasses can override this method to install custom event emitters on the given View.
|
LayoutShadowNode |
createShadowNodeInstance()
This method should return a subclass of
ReactShadowNode which will be then used for
measuring position and size of the view. |
ReactEditText |
createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type.
|
java.util.Map<java.lang.String,java.lang.Integer> |
getCommandsMap()
Subclasses of
ViewManager that expect to receive commands through UIManagerModule.dispatchViewManagerCommand(int, com.facebook.react.bridge.Dynamic, com.facebook.react.bridge.ReadableArray) should override this method returning the map
between names of the commands and IDs that are then used in ViewManager.receiveCommand(T, int, com.facebook.react.bridge.ReadableArray) method
whenever the command is dispatched for this particular ViewManager. |
java.util.Map<java.lang.String,java.lang.Object> |
getExportedCustomBubblingEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed on
native views.
|
java.util.Map<java.lang.String,java.lang.Object> |
getExportedCustomDirectEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed on
native views.
|
java.util.Map |
getExportedViewConstants()
Returns a map of view-specific constants that are injected to JavaScript.
|
java.lang.String |
getName() |
java.lang.Class<? extends LayoutShadowNode> |
getShadowNodeClass()
This method should return
Class instance that represent type of shadow node that this
manager will return from ViewManager.createShadowNodeInstance(). |
protected void |
onAfterUpdateTransaction(ReactEditText view)
Callback that will be triggered after all properties are updated in current update transaction
(all @ReactProp handlers for properties updated in current transaction have been called).
|
void |
receiveCommand(ReactEditText reactEditText,
int commandId,
ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the
UIManager. |
void |
receiveCommand(ReactEditText reactEditText,
java.lang.String commandId,
ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the
UIManager. |
void |
setAllowFontScaling(ReactEditText view,
boolean allowFontScaling) |
void |
setAutoCapitalize(ReactEditText view,
Dynamic autoCapitalize) |
void |
setAutoCorrect(ReactEditText view,
java.lang.Boolean autoCorrect) |
void |
setBlurOnSubmit(ReactEditText view,
java.lang.Boolean blurOnSubmit) |
void |
setBorderColor(ReactEditText view,
int index,
java.lang.Integer color) |
void |
setBorderRadius(ReactEditText view,
int index,
float borderRadius) |
void |
setBorderStyle(ReactEditText view,
java.lang.String borderStyle) |
void |
setBorderWidth(ReactEditText view,
int index,
float width) |
void |
setCaretHidden(ReactEditText view,
boolean caretHidden) |
void |
setColor(ReactEditText view,
java.lang.Integer color) |
void |
setContextMenuHidden(ReactEditText view,
boolean contextMenuHidden) |
void |
setCursorColor(ReactEditText view,
java.lang.Integer color) |
void |
setDisableFullscreenUI(ReactEditText view,
boolean disableFullscreenUI) |
void |
setEditable(ReactEditText view,
boolean editable) |
void |
setFontFamily(ReactEditText view,
java.lang.String fontFamily) |
void |
setFontSize(ReactEditText view,
float fontSize) |
void |
setFontStyle(ReactEditText view,
java.lang.String fontStyleString)
/* This code was taken from the method setFontStyle of the class ReactTextShadowNode /* TODO:
Factor into a common place they can both use
|
void |
setFontWeight(ReactEditText view,
java.lang.String fontWeightString)
/* This code was taken from the method setFontWeight of the class ReactTextShadowNode /* TODO:
Factor into a common place they can both use
|
void |
setImportantForAutofill(ReactEditText view,
java.lang.String value) |
void |
setInlineImageLeft(ReactEditText view,
java.lang.String resource) |
void |
setInlineImagePadding(ReactEditText view,
int padding) |
void |
setKeyboardType(ReactEditText view,
java.lang.String keyboardType) |
void |
setLetterSpacing(ReactEditText view,
float letterSpacing) |
void |
setMaxFontSizeMultiplier(ReactEditText view,
float maxFontSizeMultiplier) |
void |
setMaxLength(ReactEditText view,
java.lang.Integer maxLength) |
void |
setMostRecentEventCount(ReactEditText view,
int mostRecentEventCount) |
void |
setMultiline(ReactEditText view,
boolean multiline) |
void |
setNumLines(ReactEditText view,
int numLines) |
void |
setOnContentSizeChange(ReactEditText view,
boolean onContentSizeChange) |
void |
setOnKeyPress(ReactEditText view,
boolean onKeyPress) |
void |
setOnScroll(ReactEditText view,
boolean onScroll) |
void |
setOnSelectionChange(ReactEditText view,
boolean onSelectionChange) |
void |
setPlaceholder(ReactEditText view,
java.lang.String placeholder) |
void |
setPlaceholderTextColor(ReactEditText view,
java.lang.Integer color) |
void |
setReturnKeyLabel(ReactEditText view,
java.lang.String returnKeyLabel) |
void |
setReturnKeyType(ReactEditText view,
java.lang.String returnKeyType) |
void |
setSecureTextEntry(ReactEditText view,
boolean password) |
void |
setSelectionColor(ReactEditText view,
java.lang.Integer color) |
void |
setSelectTextOnFocus(ReactEditText view,
boolean selectTextOnFocus) |
void |
setTextAlign(ReactEditText view,
java.lang.String textAlign) |
void |
setTextAlignVertical(ReactEditText view,
java.lang.String textAlignVertical) |
void |
setTextContentType(ReactEditText view,
java.lang.String autoCompleteType) |
void |
setUnderlineColor(ReactEditText view,
java.lang.Integer underlineColor) |
void |
showKeyboardOnFocus(ReactEditText view,
boolean showKeyboardOnFocus) |
void |
updateExtraData(ReactEditText view,
java.lang.Object extraData)
Subclasses can implement this method to receive an optional extra data enqueued from the
corresponding instance of
ReactShadowNode in ReactShadowNode.onCollectExtraUpdates(com.facebook.react.uimanager.UIViewOperationQueue). |
setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLiveRegion, setAccessibilityRole, setBackgroundColor, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setViewState, setViewStates, setZIndexcreateShadowNodeInstance, createView, createViewInstance, getDelegate, getNativeProps, measure, onDropViewInstance, updateLocalData, updateProperties, updateStatecanOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroypublic static final java.lang.String TAG
protected static final java.lang.String REACT_CLASS
public java.lang.String getName()
getName in interface NativeModulegetName in class ViewManager<ReactEditText,LayoutShadowNode>public ReactEditText createViewInstance(ThemedReactContext context)
ViewManagercreateViewInstance in class ViewManager<ReactEditText,LayoutShadowNode>public LayoutShadowNode createShadowNodeInstance()
ViewManagerReactShadowNode which will be then used for
measuring position and size of the view. In most of the cases this should just return an
instance of ReactShadowNodecreateShadowNodeInstance in class ViewManager<ReactEditText,LayoutShadowNode>public java.lang.Class<? extends LayoutShadowNode> getShadowNodeClass()
ViewManagerClass instance that represent type of shadow node that this
manager will return from ViewManager.createShadowNodeInstance().
This method will be used in the bridge initialization phase to collect properties exposed
using ReactProp (or ReactPropGroup) annotation from the ReactShadowNode
subclass specific for native view this manager provides.
getShadowNodeClass in class ViewManager<ReactEditText,LayoutShadowNode>Class object that represents type of shadow node used by this view manager.public java.util.Map<java.lang.String,java.lang.Object> getExportedCustomBubblingEventTypeConstants()
ViewManagerReturned map should be of the form:
{
"onTwirl": {
"phasedRegistrationNames": {
"bubbled": "onTwirl",
"captured": "onTwirlCaptured"
}
}
}
getExportedCustomBubblingEventTypeConstants in class ViewManager<ReactEditText,LayoutShadowNode>public java.util.Map<java.lang.String,java.lang.Object> getExportedCustomDirectEventTypeConstants()
ViewManagerReturned map should be of the form:
{
"onTwirl": {
"registrationName": "onTwirl"
}
}
getExportedCustomDirectEventTypeConstants in class BaseViewManager<ReactEditText,LayoutShadowNode>public java.util.Map<java.lang.String,java.lang.Integer> getCommandsMap()
ViewManagerViewManager that expect to receive commands through UIManagerModule.dispatchViewManagerCommand(int, com.facebook.react.bridge.Dynamic, com.facebook.react.bridge.ReadableArray) should override this method returning the map
between names of the commands and IDs that are then used in ViewManager.receiveCommand(T, int, com.facebook.react.bridge.ReadableArray) method
whenever the command is dispatched for this particular ViewManager.getCommandsMap in class ViewManager<ReactEditText,LayoutShadowNode>public void receiveCommand(ReactEditText reactEditText, int commandId, ReadableArray args)
ViewManagerUIManager. Good example of such a command would be scrollTo request with coordinates
for a ScrollView instance.
This method is deprecated use ViewManager.receiveCommand(View, String, ReadableArray) instead.
receiveCommand in class ViewManager<ReactEditText,LayoutShadowNode>reactEditText - View instance that should receive the commandcommandId - code of the commandargs - optional arguments for the commandpublic void receiveCommand(ReactEditText reactEditText, java.lang.String commandId, ReadableArray args)
ViewManagerUIManager. Good example of such a command would be scrollTo request with coordinates
for a ReactScrollView instance.receiveCommand in class ViewManager<ReactEditText,LayoutShadowNode>reactEditText - View instance that should receive the commandcommandId - code of the commandargs - optional arguments for the commandpublic void updateExtraData(ReactEditText view, java.lang.Object extraData)
ViewManagerReactShadowNode in ReactShadowNode.onCollectExtraUpdates(com.facebook.react.uimanager.UIViewOperationQueue).
Since css layout step and ui updates can be executed in separate thread apart of setting x/y/width/height this is the recommended and thread-safe way of passing extra data from css node to the native view counterpart.
TODO T7247021: Replace updateExtraData with generic update props mechanism after D2086999
updateExtraData in class ViewManager<ReactEditText,LayoutShadowNode>public void setFontSize(ReactEditText view, float fontSize)
public void setFontFamily(ReactEditText view, java.lang.String fontFamily)
public void setMaxFontSizeMultiplier(ReactEditText view, float maxFontSizeMultiplier)
public void setFontWeight(ReactEditText view, java.lang.String fontWeightString)
public void setFontStyle(ReactEditText view, java.lang.String fontStyleString)
public void setImportantForAutofill(ReactEditText view, java.lang.String value)
public void setOnSelectionChange(ReactEditText view, boolean onSelectionChange)
public void setBlurOnSubmit(ReactEditText view, java.lang.Boolean blurOnSubmit)
public void setOnContentSizeChange(ReactEditText view, boolean onContentSizeChange)
public void setOnScroll(ReactEditText view, boolean onScroll)
public void setOnKeyPress(ReactEditText view, boolean onKeyPress)
public void setLetterSpacing(ReactEditText view, float letterSpacing)
public void setAllowFontScaling(ReactEditText view, boolean allowFontScaling)
public void setPlaceholder(ReactEditText view, java.lang.String placeholder)
public void setPlaceholderTextColor(ReactEditText view, java.lang.Integer color)
public void setSelectionColor(ReactEditText view, java.lang.Integer color)
public void setCursorColor(ReactEditText view, java.lang.Integer color)
public void setMostRecentEventCount(ReactEditText view, int mostRecentEventCount)
public void setCaretHidden(ReactEditText view, boolean caretHidden)
public void setContextMenuHidden(ReactEditText view, boolean contextMenuHidden)
public void setSelectTextOnFocus(ReactEditText view, boolean selectTextOnFocus)
public void setColor(ReactEditText view, java.lang.Integer color)
public void setUnderlineColor(ReactEditText view, java.lang.Integer underlineColor)
public void setTextAlign(ReactEditText view, java.lang.String textAlign)
public void setTextAlignVertical(ReactEditText view, java.lang.String textAlignVertical)
public void setInlineImageLeft(ReactEditText view, java.lang.String resource)
public void setInlineImagePadding(ReactEditText view, int padding)
public void setEditable(ReactEditText view, boolean editable)
public void setNumLines(ReactEditText view, int numLines)
public void setMaxLength(ReactEditText view, java.lang.Integer maxLength)
public void setTextContentType(ReactEditText view, java.lang.String autoCompleteType)
public void setAutoCorrect(ReactEditText view, java.lang.Boolean autoCorrect)
public void setMultiline(ReactEditText view, boolean multiline)
public void setSecureTextEntry(ReactEditText view, boolean password)
public void setAutoCapitalize(ReactEditText view, Dynamic autoCapitalize)
public void setKeyboardType(ReactEditText view, java.lang.String keyboardType)
public void setReturnKeyType(ReactEditText view, java.lang.String returnKeyType)
public void setDisableFullscreenUI(ReactEditText view, boolean disableFullscreenUI)
public void setReturnKeyLabel(ReactEditText view, java.lang.String returnKeyLabel)
public void setBorderRadius(ReactEditText view, int index, float borderRadius)
public void setBorderStyle(ReactEditText view, java.lang.String borderStyle)
public void showKeyboardOnFocus(ReactEditText view, boolean showKeyboardOnFocus)
public void setBorderWidth(ReactEditText view, int index, float width)
public void setBorderColor(ReactEditText view, int index, java.lang.Integer color)
protected void onAfterUpdateTransaction(ReactEditText view)
ViewManageronAfterUpdateTransaction in class BaseViewManager<ReactEditText,LayoutShadowNode>protected void addEventEmitters(ThemedReactContext reactContext, ReactEditText editText)
ViewManageraddEventEmitters in class ViewManager<ReactEditText,LayoutShadowNode>public java.util.Map getExportedViewConstants()
ViewManagergetExportedViewConstants in class ViewManager<ReactEditText,LayoutShadowNode>