ReactModalHostManager

View manager for ReactModalHostView components.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun addView(parent: ReactModalHostView, child: View, index: Int)

Adds a child view into the parent at the index specified as a parameter

Link copied to clipboard
open fun addViews(parent: ReactModalHostView, views: MutableList<View>)

Convenience method for batching a set of addView calls Note that this adds the views to the beginning of the ViewGroup

Link copied to clipboard
open override fun canOverrideExistingModule(): Boolean

Return true if you intend to override some other native module that was registered e.g. as part of a different package (such as the core one). Trying to override without returning true from this method is considered an error and will throw an exception during initialization. By default all modules return false.

Link copied to clipboard

This method should return a subclass of 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

Link copied to clipboard
open fun createView(reactTag: Int, @NonNull reactContext: ThemedReactContext, @Nullable props: ReactStylesDiffMap?, @Nullable stateWrapper: StateWrapper?, jsResponderHandler: JSResponderHandler): ReactModalHostView

Creates a view with knowledge of props and state.

Link copied to clipboard
open fun experimental_prefetchResource(reactContext: ReactContext, surfaceId: Int, reactTag: Int, params: MapBuffer)

THIS PREFETCH METHOD IS EXPERIMENTAL, DO NOT USE IT FOR PRODUCTION CODE, MOST LIKELY IT WILL CHANGE OR BE REMOVED IN THE FUTURE.

Link copied to clipboard
open override fun getChildAt(parent: ReactModalHostView, index: Int): View?
Link copied to clipboard
open override fun getChildCount(parent: ReactModalHostView): Int

Return the amount of children contained by the view specified as a parameter.

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard

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

Returns a map of config data passed to JS that defines eligible events that can be placed on native views. This should return bubbling directly-dispatched event types and specify what names should be used to subscribe to either form (bubbling/capturing).

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

Link copied to clipboard

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

Link copied to clipboard
open override fun getName(): String
Link copied to clipboard

Returns a , representing the native props of the view manager. The Map contains the names (key) and types (value) of the ViewManager's props.

Link copied to clipboard
open override fun getShadowNodeClass(): Class<out LayoutShadowNode>

This method should return Class instance that represent type of shadow node that this manager will return from createShadowNodeInstance.

Link copied to clipboard
open override fun initialize()

This method is called after ReactApplicationContext has been created.

Link copied to clipboard
open override fun invalidate()

Allow NativeModule to clean up. Called before React Native instance is destroyed.

Link copied to clipboard
open fun measure(context: Context, localData: ReadableMap, props: ReadableMap, state: ReadableMap, width: Float, widthMode: YogaMeasureMode, height: Float, heightMode: YogaMeasureMode, @Nullable attachmentsPositions: FloatArray?): Long

Subclasses can override this method to implement custom measure functions for the ViewManager

open fun measure(context: Context, localData: MapBuffer, props: MapBuffer, @Nullable state: MapBuffer?, width: Float, widthMode: YogaMeasureMode, height: Float, heightMode: YogaMeasureMode, @Nullable attachmentsPositions: FloatArray?): Long

THIS MEASURE METHOD IS EXPERIMENTAL, MOST LIKELY YOU ARE LOOKING TO USE THE OTHER OVERLOAD INSTEAD: measure

Link copied to clipboard

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

Link copied to clipboard

Allow NativeModule to clean up. Called before {CatalystInstance#onHostDestroy}

Link copied to clipboard
open override fun onDropViewInstance(view: ReactModalHostView)

Called when view is detached from view hierarchy and allows for some additional cleanup by the ViewManager subclass.

Link copied to clipboard
open override fun onLayoutChange(v: View, left: Int, top: Int, right: Int, bottom: Int, oldLeft: Int, oldTop: Int, oldRight: Int, oldBottom: Int)
Link copied to clipboard
open fun onSurfaceStopped(surfaceId: Int)

Lifecycle method: called when a surface is stopped. Currently only used for View Recycling cleanup. There is no corresponding startSurface lifecycle event for ViewManagers because we currently only need this for recycling cleanup. Only called in Fabric.

Link copied to clipboard
open fun receiveCommand(@NonNull root: ReactModalHostView, commandId: Int, @Nullable args: ReadableArray?)

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

open fun receiveCommand(@NonNull root: ReactModalHostView, commandId: String, @Nullable args: ReadableArray?)

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

Link copied to clipboard

Remove all child views from the parent View.

Link copied to clipboard
open fun removeView(parent: ReactModalHostView, view: View)
Link copied to clipboard
open override fun removeViewAt(parent: ReactModalHostView, index: Int)

Removes View from the parent View at the index specified as a parameter.

Link copied to clipboard
open fun setAccessibilityActions(view: ReactModalHostView, accessibilityActions: ReadableArray)
Link copied to clipboard
open fun setAccessibilityCollection(@NonNull view: ReactModalHostView, @Nullable accessibilityCollection: ReadableMap?)
Link copied to clipboard
open fun setAccessibilityCollectionItem(@NonNull view: ReactModalHostView, @Nullable accessibilityCollectionItem: ReadableMap?)
Link copied to clipboard
open fun setAccessibilityHint(@NonNull view: ReactModalHostView, @Nullable accessibilityHint: String?)
Link copied to clipboard
open fun setAccessibilityLabel(@NonNull view: ReactModalHostView, @Nullable accessibilityLabel: String?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setAccessibilityRole(@NonNull view: ReactModalHostView, @Nullable accessibilityRole: String?)
Link copied to clipboard
open fun setAccessibilityValue(view: ReactModalHostView, accessibilityValue: ReadableMap)
Link copied to clipboard
open override fun setAnimated(view: ReactModalHostView, value: Boolean)
Link copied to clipboard
open override fun setAnimationType(view: ReactModalHostView, animationType: String?)
Link copied to clipboard
open fun setBackgroundColor(@NonNull view: ReactModalHostView, @ColorInt backgroundColor: Int)
Link copied to clipboard
open fun setBorderBottomLeftRadius(view: ReactModalHostView, borderRadius: Float)
Link copied to clipboard
open fun setBorderBottomRightRadius(view: ReactModalHostView, borderRadius: Float)
Link copied to clipboard
open fun setBorderRadius(view: ReactModalHostView, borderRadius: Float)
Link copied to clipboard
open fun setBorderTopLeftRadius(view: ReactModalHostView, borderRadius: Float)
Link copied to clipboard
open fun setBorderTopRightRadius(view: ReactModalHostView, borderRadius: Float)
Link copied to clipboard
Link copied to clipboard
open fun setClick(@NonNull view: ReactModalHostView, value: Boolean)
Link copied to clipboard
Link copied to clipboard
open fun setElevation(@NonNull view: ReactModalHostView, elevation: Float)
Link copied to clipboard
Link copied to clipboard
open override fun setHardwareAccelerated(view: ReactModalHostView, hardwareAccelerated: Boolean)
Link copied to clipboard
open override fun setIdentifier(view: ReactModalHostView, value: Int)
Link copied to clipboard
open fun setImportantForAccessibility(@NonNull view: ReactModalHostView, @Nullable importantForAccessibility: String?)
Link copied to clipboard
open fun setMixBlendMode(@NonNull view: ReactModalHostView, @Nullable mixBlendMode: String?)
Link copied to clipboard
Link copied to clipboard
open fun setNativeId(@NonNull view: ReactModalHostView, @Nullable nativeId: String?)
Link copied to clipboard
open override fun setNavigationBarTranslucent(view: ReactModalHostView, navigationBarTranslucent: Boolean)
Link copied to clipboard
open fun setOpacity(@NonNull view: ReactModalHostView, opacity: Float)
Link copied to clipboard
open fun setOutlineColor(view: ReactModalHostView, @Nullable color: Int?)
Link copied to clipboard
open fun setOutlineOffset(view: ReactModalHostView, offset: Float)
Link copied to clipboard
open fun setOutlineStyle(view: ReactModalHostView, @Nullable outlineStyle: String?)
Link copied to clipboard
open fun setOutlineWidth(view: ReactModalHostView, width: Float)
Link copied to clipboard
open fun setPadding(view: ReactModalHostView, left: Int, top: Int, right: Int, bottom: Int)

Subclasses can override this method to set padding for the given View in Fabric. Since not all components support setting padding, the default implementation of this method does nothing.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun setPresentationStyle(view: ReactModalHostView, value: String?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setRole(@NonNull view: ReactModalHostView, @Nullable role: String?)
Link copied to clipboard
open fun setRotation(@NonNull view: ReactModalHostView, rotation: Float)
Link copied to clipboard
open fun setScaleX(@NonNull view: ReactModalHostView, scaleX: Float)
Link copied to clipboard
open fun setScaleY(@NonNull view: ReactModalHostView, scaleY: Float)
Link copied to clipboard
open fun setShadowColor(@NonNull view: ReactModalHostView, shadowColor: Int)
Link copied to clipboard
Link copied to clipboard
open override fun setStatusBarTranslucent(view: ReactModalHostView, statusBarTranslucent: Boolean)
Link copied to clipboard
Link copied to clipboard
open override fun setTestId(view: ReactModalHostView, value: String?)
Link copied to clipboard
Link copied to clipboard
open fun setTouchEnd(@NonNull view: ReactModalHostView, value: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setTransformOrigin(@NonNull view: ReactModalHostView, @Nullable transformOrigin: ReadableArray?)
Link copied to clipboard
open fun setTranslateX(@NonNull view: ReactModalHostView, translateX: Float)
Link copied to clipboard
open fun setTranslateY(@NonNull view: ReactModalHostView, translateY: Float)
Link copied to clipboard
open override fun setTransparent(view: ReactModalHostView, transparent: Boolean)
Link copied to clipboard
open fun setViewState(@NonNull view: ReactModalHostView, @Nullable accessibilityState: ReadableMap?)
Link copied to clipboard
open override fun setVisible(view: ReactModalHostView, visible: Boolean)
Link copied to clipboard
open fun setZIndex(@NonNull view: ReactModalHostView, zIndex: Float)
Link copied to clipboard
open override fun updateExtraData(root: ReactModalHostView, extraData: Any)

Subclasses can implement this method to receive an optional extra data enqueued from the corresponding instance of ReactShadowNode in onCollectExtraUpdates.

Link copied to clipboard

For the vast majority of ViewManagers, you will not need to override this. Only override this if you really know what you're doing and have a very unique use-case.

Link copied to clipboard
open override fun updateState(view: ReactModalHostView, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any?

Subclasses can implement this method to receive state updates shared between all instances of this component type.