public class ReactDrawerLayoutManager extends ViewGroupManager<com.facebook.react.views.drawer.ReactDrawerLayout>
ReactDrawerLayout
components.Modifier and Type | Class and Description |
---|---|
static class |
ReactDrawerLayoutManager.DrawerEventEmitter |
Modifier and Type | Field and Description |
---|---|
static int |
CLOSE_DRAWER |
static int |
OPEN_DRAWER |
mZIndexHash
PROP_TEST_ID
Constructor and Description |
---|
ReactDrawerLayoutManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEventEmitters(ThemedReactContext reactContext,
com.facebook.react.views.drawer.ReactDrawerLayout view)
Subclasses can override this method to install custom event emitters on the given View.
|
void |
addView(com.facebook.react.views.drawer.ReactDrawerLayout parent,
android.view.View child,
int index)
This method is overridden because of two reasons:
1.
|
protected com.facebook.react.views.drawer.ReactDrawerLayout |
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 . |
void |
getDrawerWidth(com.facebook.react.views.drawer.ReactDrawerLayout view,
float width) |
java.util.Map |
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() |
boolean |
needsCustomLayoutForChildren()
Returns whether this View type needs to handle laying out its own children instead of
deferring to the standard css-layout algorithm.
|
void |
receiveCommand(com.facebook.react.views.drawer.ReactDrawerLayout root,
int commandId,
ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the
UIManager . |
void |
setDrawerLockMode(com.facebook.react.views.drawer.ReactDrawerLayout view,
java.lang.String drawerLockMode) |
void |
setDrawerPosition(com.facebook.react.views.drawer.ReactDrawerLayout view,
int drawerPosition) |
void |
setElevation(com.facebook.react.views.drawer.ReactDrawerLayout view,
float elevation) |
addViews, createShadowNodeInstance, getChildAt, getChildCount, getShadowNodeClass, removeAllViews, removeView, removeViewAt, reorderChildrenByZIndex, setViewZIndex, shouldPromoteGrandchildren, updateExtraData
setAccessibilityComponentType, setAccessibilityLabel, setAccessibilityLiveRegion, setBackgroundColor, setImportantForAccessibility, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setZIndex
createView, getExportedCustomBubblingEventTypeConstants, getNativeProps, onAfterUpdateTransaction, onDropViewInstance, updateProperties
public static final int OPEN_DRAWER
public static final int CLOSE_DRAWER
public java.lang.String getName()
getName
in class ViewManager<com.facebook.react.views.drawer.ReactDrawerLayout,LayoutShadowNode>
protected void addEventEmitters(ThemedReactContext reactContext, com.facebook.react.views.drawer.ReactDrawerLayout view)
ViewManager
addEventEmitters
in class ViewManager<com.facebook.react.views.drawer.ReactDrawerLayout,LayoutShadowNode>
protected com.facebook.react.views.drawer.ReactDrawerLayout createViewInstance(ThemedReactContext context)
ViewManager
createViewInstance
in class ViewManager<com.facebook.react.views.drawer.ReactDrawerLayout,LayoutShadowNode>
public void setDrawerPosition(com.facebook.react.views.drawer.ReactDrawerLayout view, int drawerPosition)
public void getDrawerWidth(com.facebook.react.views.drawer.ReactDrawerLayout view, float width)
public void setDrawerLockMode(com.facebook.react.views.drawer.ReactDrawerLayout view, @Nullable java.lang.String drawerLockMode)
public void setElevation(com.facebook.react.views.drawer.ReactDrawerLayout view, float elevation)
setElevation
in class BaseViewManager<com.facebook.react.views.drawer.ReactDrawerLayout,LayoutShadowNode>
public boolean needsCustomLayoutForChildren()
ViewGroupManager
needsCustomLayoutForChildren
in class ViewGroupManager<com.facebook.react.views.drawer.ReactDrawerLayout>
@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<com.facebook.react.views.drawer.ReactDrawerLayout,LayoutShadowNode>
public void receiveCommand(com.facebook.react.views.drawer.ReactDrawerLayout root, 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<com.facebook.react.views.drawer.ReactDrawerLayout,LayoutShadowNode>
root
- View instance that should receive the commandcommandId
- code of the commandargs
- optional arguments for the command@Nullable public java.util.Map getExportedViewConstants()
ViewManager
getExportedViewConstants
in class ViewManager<com.facebook.react.views.drawer.ReactDrawerLayout,LayoutShadowNode>
@Nullable public java.util.Map getExportedCustomDirectEventTypeConstants()
ViewManager
getExportedCustomDirectEventTypeConstants
in class ViewManager<com.facebook.react.views.drawer.ReactDrawerLayout,LayoutShadowNode>
public void addView(com.facebook.react.views.drawer.ReactDrawerLayout parent, android.view.View child, int index)
addView
in class ViewGroupManager<com.facebook.react.views.drawer.ReactDrawerLayout>