public class ReactTextInputManager extends BaseViewManager<ReactEditText,LayoutShadowNode>
NativeModule.NativeMethod
Modifier and Type | Field and Description |
---|---|
protected ReactTextViewManagerCallback |
mReactTextViewManagerCallback |
static java.lang.String |
REACT_CLASS |
static java.lang.String |
TAG |
sStateDescription
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.
|
protected android.widget.EditText |
createInternalEditText(ThemedReactContext themedReactContext)
May be overriden by subclasses that would like to provide their own instance of the internal
EditText this class uses to determine the expected size of the view. |
ReactBaseTextShadowNode |
createShadowNodeInstance()
This method should return a subclass of
ReactShadowNode which will be then used for
measuring position and size of the view. |
ReactBaseTextShadowNode |
createShadowNodeInstance(ReactTextViewManagerCallback reactTextViewManagerCallback) |
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 |
setAutoFocus(ReactEditText view,
boolean autoFocus) |
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 fontStyle) |
void |
setFontWeight(ReactEditText view,
java.lang.String fontWeight) |
void |
setImportantForAutofill(ReactEditText view,
java.lang.String value) |
void |
setIncludeFontPadding(ReactEditText view,
boolean includepad) |
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 |
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 |
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.
|
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) . |
java.lang.Object |
updateState(ReactEditText view,
ReactStylesDiffMap props,
StateWrapper stateWrapper)
Subclasses can implement this method to receive state updates shared between all instances of
this component type.
|
setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLiveRegion, setAccessibilityRole, setAccessibilityValue, setBackgroundColor, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex
createShadowNodeInstance, createView, createViewInstance, getDelegate, getNativeProps, measure, onDropViewInstance, updateLocalData, updateProperties
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy
public static final java.lang.String TAG
public static final java.lang.String REACT_CLASS
protected ReactTextViewManagerCallback mReactTextViewManagerCallback
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 ReactBaseTextShadowNode 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 ReactBaseTextShadowNode createShadowNodeInstance(ReactTextViewManagerCallback reactTextViewManagerCallback)
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.public java.util.Map<java.lang.String,java.lang.Object> getExportedCustomBubblingEventTypeConstants()
ViewManager
Returned 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()
ViewManager
Returned 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()
ViewManager
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
.getCommandsMap
in class ViewManager<ReactEditText,LayoutShadowNode>
public void receiveCommand(ReactEditText reactEditText, int commandId, ReadableArray args)
ViewManager
UIManager
. 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)
ViewManager
UIManager
. 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)
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 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 fontWeight)
public void setFontStyle(ReactEditText view, java.lang.String fontStyle)
public void setIncludeFontPadding(ReactEditText view, boolean includepad)
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 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 setAutoFocus(ReactEditText view, boolean autoFocus)
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 BaseViewManager<ReactEditText,LayoutShadowNode>
protected void addEventEmitters(ThemedReactContext reactContext, ReactEditText editText)
ViewManager
addEventEmitters
in class ViewManager<ReactEditText,LayoutShadowNode>
public java.util.Map getExportedViewConstants()
ViewManager
getExportedViewConstants
in class ViewManager<ReactEditText,LayoutShadowNode>
public void setPadding(ReactEditText view, int left, int top, int right, int bottom)
ViewManager
setPadding
in class ViewManager<ReactEditText,LayoutShadowNode>
protected android.widget.EditText createInternalEditText(ThemedReactContext themedReactContext)
EditText
this class uses to determine the expected size of the view.public java.lang.Object updateState(ReactEditText view, ReactStylesDiffMap props, StateWrapper stateWrapper)
ViewManager
updateState
in class ViewManager<ReactEditText,LayoutShadowNode>