public class ReactTextInputManager extends BaseViewManager<ReactEditText,ReactTextInputShadowNode>
PROP_TEST_ID| 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.
|
ReactTextInputShadowNode |
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, int, 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 |
getExportedViewConstants()
Returns a map of view-specific constants that are injected to JavaScript.
|
java.lang.String |
getName() |
java.lang.Class<ReactTextInputShadowNode> |
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 |
setAutoCapitalize(ReactEditText view,
int autoCapitalize) |
void |
setAutoCorrect(ReactEditText view,
java.lang.Boolean autoCorrect) |
void |
setEditable(ReactEditText view,
boolean editable) |
void |
setFontSize(ReactEditText view,
float fontSize) |
void |
setKeyboardType(ReactEditText view,
java.lang.String keyboardType) |
void |
setMaxLength(ReactEditText view,
java.lang.Integer maxLength) |
void |
setMultiline(ReactEditText view,
boolean multiline) |
void |
setNumLines(ReactEditText view,
int numLines) |
void |
setOnSelectionChange(ReactEditText view,
boolean onSelectionChange) |
void |
setPassword(ReactEditText view,
boolean password) |
void |
setPlaceholder(ReactEditText view,
java.lang.String placeholder) |
void |
setPlaceholderTextColor(ReactEditText view,
java.lang.Integer color) |
void |
setSelectionColor(ReactEditText view,
java.lang.Integer color) |
void |
setTextAlign(ReactEditText view,
java.lang.String textAlign) |
void |
setTextAlignVertical(ReactEditText view,
java.lang.String textAlignVertical) |
void |
setUnderlineColor(ReactEditText view,
java.lang.Integer underlineColor) |
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). |
setAccessibilityComponentType, setAccessibilityLabel, setAccessibilityLiveRegion, setBackgroundColor, setDecomposedMatrix, setElevation, setImportantForAccessibility, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTranslateX, setTranslateYcreateView, getExportedCustomDirectEventTypeConstants, getNativeProps, onDropViewInstance, updatePropertiespublic java.lang.String getName()
getName in class ViewManager<ReactEditText,ReactTextInputShadowNode>public ReactEditText createViewInstance(ThemedReactContext context)
ViewManagercreateViewInstance in class ViewManager<ReactEditText,ReactTextInputShadowNode>public ReactTextInputShadowNode createShadowNodeInstance()
ViewManagerReactShadowNode which will be then used for
measuring position and size of the view. In mose of the cases this should just return an
instance of ReactShadowNodecreateShadowNodeInstance in class ViewManager<ReactEditText,ReactTextInputShadowNode>public java.lang.Class<ReactTextInputShadowNode> 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,ReactTextInputShadowNode>Class object that represents type of shadow node used by this view manager.@Nullable public java.util.Map<java.lang.String,java.lang.Object> getExportedCustomBubblingEventTypeConstants()
ViewManagergetExportedCustomBubblingEventTypeConstants in class ViewManager<ReactEditText,ReactTextInputShadowNode>@Nullable public java.util.Map<java.lang.String,java.lang.Integer> getCommandsMap()
ViewManagerViewManager that expect to receive commands through
UIManagerModule.dispatchViewManagerCommand(int, int, 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.
As an example we may consider ReactWebViewManager that expose the following commands:
goBack, goForward, reload. In this case the map returned from ViewManager.getCommandsMap() from
ReactWebViewManager will look as follows:
{
"goBack": 1,
"goForward": 2,
"reload": 3,
}
Now assuming that "reload" command is dispatched through UIManagerModule we trigger
ReactWebViewManager#receiveCommand passing "3" as commandId argument.getCommandsMap in class ViewManager<ReactEditText,ReactTextInputShadowNode>public void receiveCommand(ReactEditText reactEditText, int commandId, @Nullable ReadableArray args)
ViewManagerUIManager. Good example of such a command would be scrollTo request with
coordinates for a ScrollView or goBack request for a WebView instance.receiveCommand in class ViewManager<ReactEditText,ReactTextInputShadowNode>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(7247021): Replace updateExtraData with generic update props mechanism after D2086999updateExtraData in class ViewManager<ReactEditText,ReactTextInputShadowNode>public void setFontSize(ReactEditText view, float fontSize)
public void setOnSelectionChange(ReactEditText view, boolean onSelectionChange)
public void setPlaceholder(ReactEditText view, @Nullable java.lang.String placeholder)
public void setPlaceholderTextColor(ReactEditText view, @Nullable java.lang.Integer color)
public void setSelectionColor(ReactEditText view, @Nullable java.lang.Integer color)
public void setUnderlineColor(ReactEditText view, @Nullable java.lang.Integer underlineColor)
public void setTextAlign(ReactEditText view, @Nullable java.lang.String textAlign)
public void setTextAlignVertical(ReactEditText view, @Nullable java.lang.String textAlignVertical)
public void setEditable(ReactEditText view, boolean editable)
public void setNumLines(ReactEditText view, int numLines)
public void setMaxLength(ReactEditText view, @Nullable java.lang.Integer maxLength)
public void setAutoCorrect(ReactEditText view, @Nullable java.lang.Boolean autoCorrect)
public void setMultiline(ReactEditText view, boolean multiline)
public void setPassword(ReactEditText view, boolean password)
public void setAutoCapitalize(ReactEditText view, int autoCapitalize)
public void setKeyboardType(ReactEditText view, @Nullable java.lang.String keyboardType)
protected void onAfterUpdateTransaction(ReactEditText view)
ViewManageronAfterUpdateTransaction in class ViewManager<ReactEditText,ReactTextInputShadowNode>protected void addEventEmitters(ThemedReactContext reactContext, ReactEditText editText)
ViewManageraddEventEmitters in class ViewManager<ReactEditText,ReactTextInputShadowNode>@Nullable public java.util.Map getExportedViewConstants()
ViewManagergetExportedViewConstants in class ViewManager<ReactEditText,ReactTextInputShadowNode>