-
public class UIViewOperationQueue
This class acts as a buffer for command executed on NativeViewHierarchyManager. It expose similar methods as mentioned classes but instead of executing commands immediately it enqueues those operations in a queue that is then flushed from UIManagerModule once JS batch of ui operations is finished. This is to make sure that we execute all the JS operation coming from a single batch a single loop of the main (UI) android looper.
TODO(7135923): Pooling of operation objects TODO(5694019): Consider a better data structure for operations queue to save on allocations
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
UIViewOperationQueue.UIOperation
A mutation or animation operation on the view hierarchy.
-
Field Summary
Fields Modifier and Type Field Description public final static int
DEFAULT_MIN_TIME_LEFT_IN_FRAME_FOR_NONBATCHED_OPERATION_MS
-
Constructor Summary
Constructors Constructor Description UIViewOperationQueue(ReactApplicationContext reactContext, NativeViewHierarchyManager nativeViewHierarchyManager, int minTimeLeftInFrameForNonBatchedOperationMs)
-
Method Summary
Modifier and Type Method Description void
setViewHierarchyUpdateDebugListener(@Nullable() NotThreadSafeViewHierarchyUpdateDebugListener listener)
void
profileNextBatch()
Map<String, Long>
getProfiledBatchPerfCounters()
boolean
isEmpty()
void
addRootView(int tag, View rootView)
void
enqueueRemoveRootView(int rootViewTag)
void
enqueueSetJSResponder(int tag, int initialTag, boolean blockNativeResponder)
void
enqueueClearJSResponder()
void
enqueueDispatchCommand(int reactTag, int commandId, @Nullable() ReadableArray commandArgs)
void
enqueueDispatchCommand(int reactTag, String commandId, @Nullable() ReadableArray commandArgs)
void
enqueueUpdateExtraData(int reactTag, Object extraData)
void
enqueueShowPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success)
void
enqueueDismissPopupMenu()
void
enqueueCreateView(ThemedReactContext themedContext, int viewReactTag, String viewClassName, @Nullable() ReactStylesDiffMap initialProps)
void
enqueueUpdateInstanceHandle(int reactTag, long instanceHandle)
void
enqueueUpdateProperties(int reactTag, String className, ReactStylesDiffMap props)
void
enqueueOnLayoutEvent(int tag, int screenX, int screenY, int screenWidth, int screenHeight)
void
enqueueUpdateLayout(int parentTag, int reactTag, int x, int y, int width, int height)
void
enqueueManageChildren(int reactTag, @Nullable() Array<int> indicesToRemove, @Nullable() Array<ViewAtIndex> viewsToAdd, @Nullable() Array<int> tagsToDelete)
void
enqueueSetChildren(int reactTag, ReadableArray childrenTags)
void
enqueueSetLayoutAnimationEnabled(boolean enabled)
void
enqueueConfigureLayoutAnimation(ReadableMap config, Callback onAnimationComplete)
void
enqueueMeasure(int reactTag, Callback callback)
void
enqueueMeasureInWindow(int reactTag, Callback callback)
void
enqueueFindTargetForTouch(int reactTag, float targetX, float targetY, Callback callback)
void
enqueueSendAccessibilityEvent(int tag, int eventType)
void
enqueueLayoutUpdateFinished(ReactShadowNode node, UIImplementation.LayoutUpdateListener listener)
void
enqueueUIBlock(UIBlock block)
void
prependUIBlock(UIBlock block)
void
dispatchViewUpdates(int batchId, long commitStartTime, long layoutTime)
-
-
Constructor Detail
-
UIViewOperationQueue
UIViewOperationQueue(ReactApplicationContext reactContext, NativeViewHierarchyManager nativeViewHierarchyManager, int minTimeLeftInFrameForNonBatchedOperationMs)
-
-
Method Detail
-
setViewHierarchyUpdateDebugListener
void setViewHierarchyUpdateDebugListener(@Nullable() NotThreadSafeViewHierarchyUpdateDebugListener listener)
-
profileNextBatch
void profileNextBatch()
-
getProfiledBatchPerfCounters
Map<String, Long> getProfiledBatchPerfCounters()
-
isEmpty
boolean isEmpty()
-
addRootView
void addRootView(int tag, View rootView)
-
enqueueRemoveRootView
void enqueueRemoveRootView(int rootViewTag)
-
enqueueSetJSResponder
void enqueueSetJSResponder(int tag, int initialTag, boolean blockNativeResponder)
-
enqueueClearJSResponder
void enqueueClearJSResponder()
-
enqueueDispatchCommand
@Deprecated() void enqueueDispatchCommand(int reactTag, int commandId, @Nullable() ReadableArray commandArgs)
-
enqueueDispatchCommand
void enqueueDispatchCommand(int reactTag, String commandId, @Nullable() ReadableArray commandArgs)
-
enqueueUpdateExtraData
void enqueueUpdateExtraData(int reactTag, Object extraData)
-
enqueueShowPopupMenu
void enqueueShowPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success)
-
enqueueDismissPopupMenu
void enqueueDismissPopupMenu()
-
enqueueCreateView
void enqueueCreateView(ThemedReactContext themedContext, int viewReactTag, String viewClassName, @Nullable() ReactStylesDiffMap initialProps)
-
enqueueUpdateInstanceHandle
void enqueueUpdateInstanceHandle(int reactTag, long instanceHandle)
-
enqueueUpdateProperties
void enqueueUpdateProperties(int reactTag, String className, ReactStylesDiffMap props)
-
enqueueOnLayoutEvent
void enqueueOnLayoutEvent(int tag, int screenX, int screenY, int screenWidth, int screenHeight)
-
enqueueUpdateLayout
void enqueueUpdateLayout(int parentTag, int reactTag, int x, int y, int width, int height)
-
enqueueManageChildren
void enqueueManageChildren(int reactTag, @Nullable() Array<int> indicesToRemove, @Nullable() Array<ViewAtIndex> viewsToAdd, @Nullable() Array<int> tagsToDelete)
-
enqueueSetChildren
void enqueueSetChildren(int reactTag, ReadableArray childrenTags)
-
enqueueSetLayoutAnimationEnabled
void enqueueSetLayoutAnimationEnabled(boolean enabled)
-
enqueueConfigureLayoutAnimation
void enqueueConfigureLayoutAnimation(ReadableMap config, Callback onAnimationComplete)
-
enqueueMeasure
void enqueueMeasure(int reactTag, Callback callback)
-
enqueueMeasureInWindow
void enqueueMeasureInWindow(int reactTag, Callback callback)
-
enqueueFindTargetForTouch
void enqueueFindTargetForTouch(int reactTag, float targetX, float targetY, Callback callback)
-
enqueueSendAccessibilityEvent
void enqueueSendAccessibilityEvent(int tag, int eventType)
-
enqueueLayoutUpdateFinished
void enqueueLayoutUpdateFinished(ReactShadowNode node, UIImplementation.LayoutUpdateListener listener)
-
enqueueUIBlock
void enqueueUIBlock(UIBlock block)
-
prependUIBlock
void prependUIBlock(UIBlock block)
-
dispatchViewUpdates
void dispatchViewUpdates(int batchId, long commitStartTime, long layoutTime)
-
-
-
-