-
public class SurfaceMountingManager
-
-
Constructor Summary
Constructors Constructor Description SurfaceMountingManager(int surfaceId, JSResponderHandler jsResponderHandler, ViewManagerRegistry viewManagerRegistry, RootViewManager rootViewManager, MountingManager.MountItemExecutor mountItemExecutor, ThemedReactContext reactContext)
-
Method Summary
Modifier and Type Method Description boolean
isStopped()
void
attachRootView(View rootView, ThemedReactContext themedReactContext)
int
getSurfaceId()
boolean
isRootViewAttached()
ThemedReactContext
getContext()
boolean
getViewExists(int tag)
void
executeOnViewAttach(MountItem item)
void
stopSurface()
Stop surface and all operations within it. void
addViewAt(int parentTag, int tag, int index)
void
removeViewAt(int tag, int parentTag, int index)
void
createView(@NonNull() String componentName, int reactTag, @Nullable() Object props, @Nullable() StateWrapper stateWrapper, @Nullable() EventEmitterWrapper eventEmitterWrapper, boolean isLayoutable)
void
createViewUnsafe(@NonNull() String componentName, int reactTag, @Nullable() Object props, @Nullable() StateWrapper stateWrapper, @Nullable() EventEmitterWrapper eventEmitterWrapper, boolean isLayoutable)
Perform view creation without any safety checks. void
updateProps(int reactTag, Object props)
void
receiveCommand(int reactTag, int commandId, @Nullable() ReadableArray commandArgs)
void
receiveCommand(int reactTag, @NonNull() String commandId, @Nullable() ReadableArray commandArgs)
void
sendAccessibilityEvent(int reactTag, int eventType)
void
updateLayout(int reactTag, int x, int y, int width, int height, int displayType)
void
updatePadding(int reactTag, int left, int top, int right, int bottom)
void
updateOverflowInset(int reactTag, int overflowInsetLeft, int overflowInsetTop, int overflowInsetRight, int overflowInsetBottom)
void
updateState(int reactTag, @Nullable() StateWrapper stateWrapper)
void
updateEventEmitter(int reactTag, @NonNull() EventEmitterWrapper eventEmitter)
synchronized void
setJSResponder(int reactTag, int initialReactTag, boolean blockNativeResponder)
void
didUpdateViews()
void
deleteView(int reactTag)
void
preallocateView(String componentName, int reactTag, @Nullable() Object props, @Nullable() StateWrapper stateWrapper, @Nullable() EventEmitterWrapper eventEmitterWrapper, boolean isLayoutable)
EventEmitterWrapper
getEventEmitter(int reactTag)
View
getView(int reactTag)
void
printSurfaceState()
-
-
Constructor Detail
-
SurfaceMountingManager
SurfaceMountingManager(int surfaceId, JSResponderHandler jsResponderHandler, ViewManagerRegistry viewManagerRegistry, RootViewManager rootViewManager, MountingManager.MountItemExecutor mountItemExecutor, ThemedReactContext reactContext)
-
-
Method Detail
-
isStopped
boolean isStopped()
-
attachRootView
void attachRootView(View rootView, ThemedReactContext themedReactContext)
-
getSurfaceId
int getSurfaceId()
-
isRootViewAttached
boolean isRootViewAttached()
-
getContext
@Nullable() ThemedReactContext getContext()
-
getViewExists
boolean getViewExists(int tag)
-
executeOnViewAttach
@AnyThread() void executeOnViewAttach(MountItem item)
-
stopSurface
@AnyThread() void stopSurface()
Stop surface and all operations within it. Garbage-collect Views (caller is responsible forremoving RootView from View layer).
Delete rootView from cache. Since RN does not control the RootView, in a sense, the fragmentis responsible for actually removing the RootView from the hierarchy / tearing down thefragment.
In the original version(s) of this function, we recursively went through all children of theView and dropped those Views as well; ad infinitum. This was before we had aSurfaceMountingManager, and all tags were in one global map. Doing this was particularlyimportant in the case of StopSurface, where race conditions between threads meant you couldn'trely on DELETE instructions actually deleting all Views in the Surface.
Now that we have SurfaceMountingManager, we can simply drop our local reference to the View.Since it will be removed from the View hierarchy entirely (outside of the scope of this class),garbage collection will take care of destroying it and all descendents.
-
removeViewAt
@UiThread() void removeViewAt(int tag, int parentTag, int index)
-
createView
@UiThread() void createView(@NonNull() String componentName, int reactTag, @Nullable() Object props, @Nullable() StateWrapper stateWrapper, @Nullable() EventEmitterWrapper eventEmitterWrapper, boolean isLayoutable)
-
createViewUnsafe
@UiThread() void createViewUnsafe(@NonNull() String componentName, int reactTag, @Nullable() Object props, @Nullable() StateWrapper stateWrapper, @Nullable() EventEmitterWrapper eventEmitterWrapper, boolean isLayoutable)
Perform view creation without any safety checks. You must ensure safety before calling thismethod (see existing callsites).
-
updateProps
void updateProps(int reactTag, Object props)
-
receiveCommand
@Deprecated() void receiveCommand(int reactTag, int commandId, @Nullable() ReadableArray commandArgs)
-
receiveCommand
void receiveCommand(int reactTag, @NonNull() String commandId, @Nullable() ReadableArray commandArgs)
-
sendAccessibilityEvent
void sendAccessibilityEvent(int reactTag, int eventType)
-
updateLayout
@UiThread() void updateLayout(int reactTag, int x, int y, int width, int height, int displayType)
-
updatePadding
@UiThread() void updatePadding(int reactTag, int left, int top, int right, int bottom)
-
updateOverflowInset
@UiThread() void updateOverflowInset(int reactTag, int overflowInsetLeft, int overflowInsetTop, int overflowInsetRight, int overflowInsetBottom)
-
updateState
@UiThread() void updateState(int reactTag, @Nullable() StateWrapper stateWrapper)
-
updateEventEmitter
@UiThread() void updateEventEmitter(int reactTag, @NonNull() EventEmitterWrapper eventEmitter)
-
setJSResponder
@UiThread() synchronized void setJSResponder(int reactTag, int initialReactTag, boolean blockNativeResponder)
-
didUpdateViews
@UiThread() void didUpdateViews()
-
deleteView
@UiThread() void deleteView(int reactTag)
-
preallocateView
@UiThread() void preallocateView(String componentName, int reactTag, @Nullable() Object props, @Nullable() StateWrapper stateWrapper, @Nullable() EventEmitterWrapper eventEmitterWrapper, boolean isLayoutable)
-
getEventEmitter
@AnyThread()@Nullable() EventEmitterWrapper getEventEmitter(int reactTag)
-
printSurfaceState
void printSurfaceState()
-
-
-
-