public class UIViewOperationQueue
extends java.lang.Object
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
Modifier and Type | Class and Description |
---|---|
static interface |
UIViewOperationQueue.UIOperation
A mutation or animation operation on the view hierarchy.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MIN_TIME_LEFT_IN_FRAME_FOR_NONBATCHED_OPERATION_MS |
Constructor and Description |
---|
UIViewOperationQueue(ReactApplicationContext reactContext,
NativeViewHierarchyManager nativeViewHierarchyManager,
int minTimeLeftInFrameForNonBatchedOperationMs) |
Modifier and Type | Method and Description |
---|---|
void |
addRootView(int tag,
android.view.View rootView) |
void |
dispatchViewUpdates(int batchId,
long commitStartTime,
long layoutTime) |
void |
enqueueClearJSResponder() |
void |
enqueueConfigureLayoutAnimation(ReadableMap config,
Callback onAnimationComplete) |
void |
enqueueCreateView(ThemedReactContext themedContext,
int viewReactTag,
java.lang.String viewClassName,
ReactStylesDiffMap initialProps) |
void |
enqueueDismissPopupMenu() |
void |
enqueueDispatchCommand(int reactTag,
int commandId,
ReadableArray commandArgs)
Deprecated.
|
void |
enqueueDispatchCommand(int reactTag,
java.lang.String commandId,
ReadableArray commandArgs) |
void |
enqueueFindTargetForTouch(int reactTag,
float targetX,
float targetY,
Callback callback) |
void |
enqueueLayoutUpdateFinished(ReactShadowNode node,
UIImplementation.LayoutUpdateListener listener) |
void |
enqueueManageChildren(int reactTag,
int[] indicesToRemove,
ViewAtIndex[] viewsToAdd,
int[] tagsToDelete) |
void |
enqueueMeasure(int reactTag,
Callback callback) |
void |
enqueueMeasureInWindow(int reactTag,
Callback callback) |
void |
enqueueOnLayoutEvent(int tag,
int screenX,
int screenY,
int screenWidth,
int screenHeight) |
void |
enqueueRemoveRootView(int rootViewTag) |
void |
enqueueSendAccessibilityEvent(int tag,
int eventType) |
void |
enqueueSetChildren(int reactTag,
ReadableArray childrenTags) |
void |
enqueueSetJSResponder(int tag,
int initialTag,
boolean blockNativeResponder) |
void |
enqueueSetLayoutAnimationEnabled(boolean enabled) |
void |
enqueueShowPopupMenu(int reactTag,
ReadableArray items,
Callback error,
Callback success) |
void |
enqueueUIBlock(UIBlock block) |
protected void |
enqueueUIOperation(UIViewOperationQueue.UIOperation operation)
Enqueues a UIOperation to be executed in UI thread.
|
void |
enqueueUpdateExtraData(int reactTag,
java.lang.Object extraData) |
void |
enqueueUpdateInstanceHandle(int reactTag,
long instanceHandle) |
void |
enqueueUpdateLayout(int parentTag,
int reactTag,
int x,
int y,
int width,
int height) |
void |
enqueueUpdateProperties(int reactTag,
java.lang.String className,
ReactStylesDiffMap props) |
java.util.Map<java.lang.String,java.lang.Long> |
getProfiledBatchPerfCounters() |
boolean |
isEmpty() |
void |
prependUIBlock(UIBlock block) |
void |
profileNextBatch() |
void |
setViewHierarchyUpdateDebugListener(NotThreadSafeViewHierarchyUpdateDebugListener listener) |
public static final int DEFAULT_MIN_TIME_LEFT_IN_FRAME_FOR_NONBATCHED_OPERATION_MS
public UIViewOperationQueue(ReactApplicationContext reactContext, NativeViewHierarchyManager nativeViewHierarchyManager, int minTimeLeftInFrameForNonBatchedOperationMs)
public void setViewHierarchyUpdateDebugListener(NotThreadSafeViewHierarchyUpdateDebugListener listener)
public void profileNextBatch()
public java.util.Map<java.lang.String,java.lang.Long> getProfiledBatchPerfCounters()
public boolean isEmpty()
public void addRootView(int tag, android.view.View rootView)
protected void enqueueUIOperation(UIViewOperationQueue.UIOperation operation)
public void enqueueRemoveRootView(int rootViewTag)
public void enqueueSetJSResponder(int tag, int initialTag, boolean blockNativeResponder)
public void enqueueClearJSResponder()
@Deprecated public void enqueueDispatchCommand(int reactTag, int commandId, ReadableArray commandArgs)
public void enqueueDispatchCommand(int reactTag, java.lang.String commandId, ReadableArray commandArgs)
public void enqueueUpdateExtraData(int reactTag, java.lang.Object extraData)
public void enqueueShowPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success)
public void enqueueDismissPopupMenu()
public void enqueueCreateView(ThemedReactContext themedContext, int viewReactTag, java.lang.String viewClassName, ReactStylesDiffMap initialProps)
public void enqueueUpdateInstanceHandle(int reactTag, long instanceHandle)
public void enqueueUpdateProperties(int reactTag, java.lang.String className, ReactStylesDiffMap props)
public void enqueueOnLayoutEvent(int tag, int screenX, int screenY, int screenWidth, int screenHeight)
public void enqueueUpdateLayout(int parentTag, int reactTag, int x, int y, int width, int height)
public void enqueueManageChildren(int reactTag, int[] indicesToRemove, ViewAtIndex[] viewsToAdd, int[] tagsToDelete)
public void enqueueSetChildren(int reactTag, ReadableArray childrenTags)
public void enqueueSetLayoutAnimationEnabled(boolean enabled)
public void enqueueConfigureLayoutAnimation(ReadableMap config, Callback onAnimationComplete)
public void enqueueMeasure(int reactTag, Callback callback)
public void enqueueMeasureInWindow(int reactTag, Callback callback)
public void enqueueFindTargetForTouch(int reactTag, float targetX, float targetY, Callback callback)
public void enqueueSendAccessibilityEvent(int tag, int eventType)
public void enqueueLayoutUpdateFinished(ReactShadowNode node, UIImplementation.LayoutUpdateListener listener)
public void enqueueUIBlock(UIBlock block)
public void prependUIBlock(UIBlock block)
public void dispatchViewUpdates(int batchId, long commitStartTime, long layoutTime)