public class ReactViewManager extends ViewGroupManager<ReactViewGroup>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROP_ACCESSIBLE |
static java.lang.String |
PROP_BORDER_RADIUS |
static java.lang.String |
PROP_BORDER_STYLE |
static java.lang.String |
PROP_NATIVE_BG |
static java.lang.String |
PROP_POINTER_EVENTS |
static java.lang.String |
REACT_CLASS |
| Constructor and Description |
|---|
ReactViewManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addView(ReactViewGroup parent,
android.view.View child,
int index) |
ReactViewGroup |
createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type.
|
android.view.View |
getChildAt(ReactViewGroup parent,
int index) |
int |
getChildCount(ReactViewGroup parent) |
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.lang.String |
getName() |
java.util.Map<java.lang.String,java.lang.String> |
getNativeProps() |
void |
receiveCommand(ReactViewGroup root,
int commandId,
ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the
UIManager. |
void |
removeView(ReactViewGroup parent,
android.view.View child) |
void |
updateView(ReactViewGroup view,
CatalystStylesDiffMap props)
Subclass should use this method to populate native view with updated style properties.
|
createCSSNodeInstance, needsCustomLayoutForChildren, updateExtraDataaddEventEmitters, createView, getExportedCustomBubblingEventTypeConstants, getExportedCustomDirectEventTypeConstants, getExportedViewConstants, onAfterUpdateTransaction, onDropViewInstance, updatePropertiespublic static final java.lang.String REACT_CLASS
public static final java.lang.String PROP_ACCESSIBLE
public static final java.lang.String PROP_BORDER_RADIUS
public static final java.lang.String PROP_BORDER_STYLE
public static final java.lang.String PROP_POINTER_EVENTS
public static final java.lang.String PROP_NATIVE_BG
public java.lang.String getName()
getName in class ViewManager<ReactViewGroup,ReactShadowNode>public ReactViewGroup createViewInstance(ThemedReactContext context)
ViewManagercreateViewInstance in class ViewManager<ReactViewGroup,ReactShadowNode>public java.util.Map<java.lang.String,java.lang.String> getNativeProps()
getNativeProps in class ViewManager<ReactViewGroup,ReactShadowNode>public void updateView(ReactViewGroup view, CatalystStylesDiffMap props)
ViewManagerupdateView in class ViewGroupManager<ReactViewGroup>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<ReactViewGroup,ReactShadowNode>public void receiveCommand(ReactViewGroup root, 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<ReactViewGroup,ReactShadowNode>root - View instance that should receive the commandcommandId - code of the commandargs - optional arguments for the commandpublic void addView(ReactViewGroup parent, android.view.View child, int index)
addView in class ViewGroupManager<ReactViewGroup>public int getChildCount(ReactViewGroup parent)
getChildCount in class ViewGroupManager<ReactViewGroup>public android.view.View getChildAt(ReactViewGroup parent, int index)
getChildAt in class ViewGroupManager<ReactViewGroup>public void removeView(ReactViewGroup parent, android.view.View child)
removeView in class ViewGroupManager<ReactViewGroup>