public class ReactTextInputManager extends BaseViewManager<ReactEditText,LayoutShadowNode>
NativeModule.NativeMethod
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
REACT_CLASS |
PROP_NATIVE_ID, PROP_TEST_ID
METHOD_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, 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<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 |
setAutoCapitalize(ReactEditText view,
int 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 |
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 |
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 |
setMaxLength(ReactEditText view,
java.lang.Integer maxLength) |
void |
setMultiline(ReactEditText view,
boolean multiline) |
void |
setNumLines(ReactEditText view,
int numLines) |
void |
setOnContentSizeChange(ReactEditText view,
boolean onContentSizeChange) |
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 |
setSelection(ReactEditText view,
ReadableMap selection) |
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 |
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, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setZIndex
createShadowNodeInstance, createView, getNativeProps, onDropViewInstance, updateProperties
canOverrideExistingModule, getConstants, hasConstants, initialize, onCatalystInstanceDestroy
protected static final java.lang.String REACT_CLASS
public java.lang.String getName()
getName
in interface NativeModule
getName
in class ViewManager<ReactEditText,LayoutShadowNode>
public ReactEditText createViewInstance(ThemedReactContext context)
ViewManager
createViewInstance
in class ViewManager<ReactEditText,LayoutShadowNode>
public LayoutShadowNode createShadowNodeInstance()
ViewManager
ReactShadowNode
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 ReactShadowNode
createShadowNodeInstance
in class ViewManager<ReactEditText,LayoutShadowNode>
public java.lang.Class<? extends LayoutShadowNode> getShadowNodeClass()
ViewManager
Class
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.@Nullable public java.util.Map<java.lang.String,java.lang.Object> getExportedCustomBubblingEventTypeConstants()
ViewManager
getExportedCustomBubblingEventTypeConstants
in class ViewManager<ReactEditText,LayoutShadowNode>
@Nullable public java.util.Map<java.lang.String,java.lang.Object> getExportedCustomDirectEventTypeConstants()
ViewManager
getExportedCustomDirectEventTypeConstants
in class ViewManager<ReactEditText,LayoutShadowNode>
@Nullable public java.util.Map<java.lang.String,java.lang.Integer> getCommandsMap()
ViewManager
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
.
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,LayoutShadowNode>
public void receiveCommand(ReactEditText reactEditText, int commandId, @Nullable ReadableArray args)
ViewManager
UIManager
. 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,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)
ViewManager
ReactShadowNode
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,LayoutShadowNode>
public void setFontSize(ReactEditText view, float fontSize)
public void setFontFamily(ReactEditText view, java.lang.String fontFamily)
public void setFontWeight(ReactEditText view, @Nullable java.lang.String fontWeightString)
public void setFontStyle(ReactEditText view, @Nullable java.lang.String fontStyleString)
public void setSelection(ReactEditText view, @Nullable ReadableMap selection)
public void setOnSelectionChange(ReactEditText view, boolean onSelectionChange)
public void setBlurOnSubmit(ReactEditText view, @Nullable java.lang.Boolean blurOnSubmit)
public void setOnContentSizeChange(ReactEditText view, boolean onContentSizeChange)
public void setOnScroll(ReactEditText view, boolean onScroll)
public void setLetterSpacing(ReactEditText view, float letterSpacing)
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 setCaretHidden(ReactEditText view, boolean caretHidden)
public void setContextMenuHidden(ReactEditText view, boolean contextMenuHidden)
public void setSelectTextOnFocus(ReactEditText view, boolean selectTextOnFocus)
public void setColor(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 setInlineImageLeft(ReactEditText view, @Nullable 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, @Nullable java.lang.Integer maxLength)
public void setAutoCorrect(ReactEditText view, @Nullable java.lang.Boolean autoCorrect)
public void setMultiline(ReactEditText view, boolean multiline)
public void setSecureTextEntry(ReactEditText view, boolean password)
public void setAutoCapitalize(ReactEditText view, int autoCapitalize)
public void setKeyboardType(ReactEditText view, @Nullable 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, @Nullable java.lang.String borderStyle)
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)
ViewManager
onAfterUpdateTransaction
in class ViewManager<ReactEditText,LayoutShadowNode>
protected void addEventEmitters(ThemedReactContext reactContext, ReactEditText editText)
ViewManager
addEventEmitters
in class ViewManager<ReactEditText,LayoutShadowNode>
@Nullable public java.util.Map getExportedViewConstants()
ViewManager
getExportedViewConstants
in class ViewManager<ReactEditText,LayoutShadowNode>