-
public class UIViewOperationQueueThis 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 interfaceUIViewOperationQueue.UIOperationA mutation or animation operation on the view hierarchy.
-
Field Summary
Fields Modifier and Type Field Description public final static intDEFAULT_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 voidsetViewHierarchyUpdateDebugListener(@Nullable() NotThreadSafeViewHierarchyUpdateDebugListener listener)voidprofileNextBatch()Map<String, Long>getProfiledBatchPerfCounters()booleanisEmpty()voidaddRootView(int tag, View rootView)voidenqueueRemoveRootView(int rootViewTag)voidenqueueSetJSResponder(int tag, int initialTag, boolean blockNativeResponder)voidenqueueClearJSResponder()voidenqueueDispatchCommand(int reactTag, int commandId, @Nullable() ReadableArray commandArgs)voidenqueueDispatchCommand(int reactTag, String commandId, @Nullable() ReadableArray commandArgs)voidenqueueUpdateExtraData(int reactTag, Object extraData)voidenqueueShowPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success)voidenqueueDismissPopupMenu()voidenqueueCreateView(ThemedReactContext themedContext, int viewReactTag, String viewClassName, @Nullable() ReactStylesDiffMap initialProps)voidenqueueUpdateInstanceHandle(int reactTag, long instanceHandle)voidenqueueUpdateProperties(int reactTag, String className, ReactStylesDiffMap props)voidenqueueOnLayoutEvent(int tag, int screenX, int screenY, int screenWidth, int screenHeight)voidenqueueUpdateLayout(int parentTag, int reactTag, int x, int y, int width, int height)voidenqueueManageChildren(int reactTag, @Nullable() Array<int> indicesToRemove, @Nullable() Array<ViewAtIndex> viewsToAdd, @Nullable() Array<int> tagsToDelete)voidenqueueSetChildren(int reactTag, ReadableArray childrenTags)voidenqueueSetLayoutAnimationEnabled(boolean enabled)voidenqueueConfigureLayoutAnimation(ReadableMap config, Callback onAnimationComplete)voidenqueueMeasure(int reactTag, Callback callback)voidenqueueMeasureInWindow(int reactTag, Callback callback)voidenqueueFindTargetForTouch(int reactTag, float targetX, float targetY, Callback callback)voidenqueueSendAccessibilityEvent(int tag, int eventType)voidenqueueLayoutUpdateFinished(ReactShadowNode node, UIImplementation.LayoutUpdateListener listener)voidenqueueUIBlock(UIBlock block)voidprependUIBlock(UIBlock block)voiddispatchViewUpdates(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)
-
-
-
-