Package 

Class ReactDrawerLayoutManager

  • All Implemented Interfaces:
    com.facebook.react.bridge.NativeModule , com.facebook.react.uimanager.BaseViewManagerInterface , com.facebook.react.uimanager.IViewManagerWithChildren , com.facebook.react.viewmanagers.AndroidDrawerLayoutManagerInterface

    
    public class ReactDrawerLayoutManager
    extends ViewGroupManager<ReactDrawerLayout> implements AndroidDrawerLayoutManagerInterface<ReactDrawerLayout>
                        

    View Manager for ReactDrawerLayout components.

    • Method Summary

      Modifier and Type Method Description
      String getName()
      void setDrawerPosition(ReactDrawerLayout view, @Nullable() String value)
      void setDrawerPosition(ReactDrawerLayout view, Dynamic drawerPosition)
      void setDrawerWidth(ReactDrawerLayout view, float width)
      void setDrawerWidth(ReactDrawerLayout view, @Nullable() Float width)
      void setDrawerLockMode(ReactDrawerLayout view, @Nullable() String drawerLockMode)
      void openDrawer(ReactDrawerLayout view)
      void closeDrawer(ReactDrawerLayout view)
      void setKeyboardDismissMode(ReactDrawerLayout view, @Nullable() String value)
      void setDrawerBackgroundColor(ReactDrawerLayout view, @Nullable() Integer value)
      void setStatusBarBackgroundColor(ReactDrawerLayout view, @Nullable() Integer value)
      void setElevation(@NonNull() ReactDrawerLayout view, float elevation)
      boolean needsCustomLayoutForChildren() Returns whether this View type needs to handle laying out its own children instead of deferringto the standard css-layout algorithm.
      Map<String, Integer> getCommandsMap() Subclasses of ViewManager that expect to receive commands through should override this method returning the mapbetween names of the commands and IDs that are then used in receiveCommand methodwhenever the command is dispatched for this particular ViewManager.
      void receiveCommand(ReactDrawerLayout root, int commandId, @Nullable() ReadableArray args) Subclasses may use this method to receive events/commands directly from JS through the .
      void receiveCommand(@NonNull() ReactDrawerLayout root, String commandId, @Nullable() ReadableArray args) Subclasses may use this method to receive events/commands directly from JS through the .
      Map getExportedViewConstants() Returns a map of view-specific constants that are injected to JavaScript.
      Map getExportedCustomDirectEventTypeConstants() Returns a map of config data passed to JS that defines eligible events that can be placed onnative views.
      void addView(ReactDrawerLayout parent, View child, int index) This method is overridden because of two reasons: 1.
      ViewManagerDelegate<ReactDrawerLayout> getDelegate() Override this method and return an instance of ViewManagerDelegate if the props of theview managed by this view manager should be set via this delegate.
      • Methods inherited from class com.facebook.react.uimanager.ViewGroupManager

        addView, addViews, createShadowNodeInstance, getChildAt, getChildCount, getShadowNodeClass, getViewZIndex, removeAllViews, removeView, removeViewAt, setViewZIndex, shouldPromoteGrandchildren, updateExtraData
      • Methods inherited from class com.facebook.react.uimanager.BaseViewManager

        getExportedCustomBubblingEventTypeConstants, getExportedCustomDirectEventTypeConstants, setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setAccessibilityValue, setBackgroundColor, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setElevation, setImportantForAccessibility, setMoveShouldSetResponder, setMoveShouldSetResponderCapture, setNativeId, setOpacity, setPointerEnter, setPointerLeave, setPointerMove, setRenderToHardwareTexture, setResponderEnd, setResponderGrant, setResponderMove, setResponderReject, setResponderRelease, setResponderStart, setResponderTerminate, setResponderTerminationRequest, setRotation, setScaleX, setScaleY, setShadowColor, setShouldBlockNativeResponder, setStartShouldSetResponder, setStartShouldSetResponderCapture, setTestId, setTouchCancel, setTouchEnd, setTouchMove, setTouchStart, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex
      • Methods inherited from class com.facebook.react.uimanager.ViewManager

        createShadowNodeInstance, createShadowNodeInstance, createView, getExportedViewConstants, getNativeProps, getShadowNodeClass, measure, measure, onDropViewInstance, receiveCommand, receiveCommand, setPadding, updateExtraData, updateProperties, updateState
      • Methods inherited from class com.facebook.react.bridge.BaseJavaModule

        canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy
      • Methods inherited from class com.facebook.react.uimanager.BaseViewManagerInterface

        setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setBackgroundColor, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setShadowColor, setTestId, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex
      • Methods inherited from class com.facebook.react.viewmanagers.AndroidDrawerLayoutManagerInterface

        closeDrawer, openDrawer, setDrawerBackgroundColor, setDrawerLockMode, setDrawerPosition, setDrawerWidth, setKeyboardDismissMode, setStatusBarBackgroundColor
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReactDrawerLayoutManager

        ReactDrawerLayoutManager()
    • Method Detail

      • setDrawerWidth

         void setDrawerWidth(ReactDrawerLayout view, float width)
      • openDrawer

         void openDrawer(ReactDrawerLayout view)
      • closeDrawer

         void closeDrawer(ReactDrawerLayout view)
      • needsCustomLayoutForChildren

         boolean needsCustomLayoutForChildren()

        Returns whether this View type needs to handle laying out its own children instead of deferringto the standard css-layout algorithm. Returns true for the layout to *not* be automaticallyinvoked. Instead onLayout will be invoked as normal and it is the View instance'sresponsibility to properly call layout on its children. Returns false for the default behaviorof automatically laying out children without going through the ViewGroup's onLayout method. Inthat case, onLayout for this View type must *not* call layout on its children.

      • getCommandsMap

        @Nullable() Map<String, Integer> getCommandsMap()

        Subclasses of ViewManager that expect to receive commands through should override this method returning the mapbetween names of the commands and IDs that are then used in receiveCommand methodwhenever the command is dispatched for this particular ViewManager.

      • receiveCommand

         void receiveCommand(ReactDrawerLayout root, int commandId, @Nullable() ReadableArray args)

        Subclasses may use this method to receive events/commands directly from JS through the . Good example of such a command would be {@code scrollTo} request with coordinatesfor a ScrollView instance.

        This method is deprecated use receiveCommand instead.

        Parameters:
        root - View instance that should receive the command
        commandId - code of the command
        args - optional arguments for the command
      • receiveCommand

         void receiveCommand(@NonNull() ReactDrawerLayout root, String commandId, @Nullable() ReadableArray args)

        Subclasses may use this method to receive events/commands directly from JS through the . Good example of such a command would be {@code scrollTo} request with coordinatesfor a ReactScrollView instance.

        Parameters:
        root - View instance that should receive the command
        commandId - code of the command
        args - optional arguments for the command
      • getExportedViewConstants

        @Nullable() Map getExportedViewConstants()

        Returns a map of view-specific constants that are injected to JavaScript. These constants aremade accessible via UIManager..Constants.

      • getExportedCustomDirectEventTypeConstants

        @Nullable() Map getExportedCustomDirectEventTypeConstants()

        Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. This should return non-bubbling directly-dispatched event types.

        Returned map should be of the form:

        {
          "onTwirl": {
            "registrationName": "onTwirl"
          }
        }
        
      • addView

         void addView(ReactDrawerLayout parent, View child, int index)

        This method is overridden because of two reasons: 1. A drawer must have exactly two children 2.The second child that is added, is the navigationView, which gets panned from the side.

      • getDelegate

         ViewManagerDelegate<ReactDrawerLayout> getDelegate()

        Override this method and return an instance of ViewManagerDelegate if the props of theview managed by this view manager should be set via this delegate. The provided instance willthen get calls to setProperty for every propthat must be updated and it's the delegate's responsibility to apply these values to the view.

        By default this method returns {@code null}, which means that the view manager doesn't havea delegate and the view props should be set internally by the view manager itself.