public class UIViewOperationQueue
extends java.lang.Object
NativeViewHierarchyManager
or on
AnimationRegistry
. 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 allocationsModifier 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,
SizeMonitoringFrameLayout rootView,
ThemedReactContext themedRootContext) |
void |
dispatchViewUpdates(int batchId,
long commitStartTime,
long layoutTime) |
void |
enqueueAddAnimation(int reactTag,
int animationID,
Callback onSuccess) |
void |
enqueueClearJSResponder() |
void |
enqueueConfigureLayoutAnimation(ReadableMap config,
Callback onSuccess,
Callback onError) |
void |
enqueueCreateView(ThemedReactContext themedContext,
int viewReactTag,
java.lang.String viewClassName,
ReactStylesDiffMap initialProps) |
void |
enqueueDismissPopupMenu() |
void |
enqueueDispatchCommand(int reactTag,
int commandId,
ReadableArray commandArgs) |
void |
enqueueFindTargetForTouch(int reactTag,
float targetX,
float targetY,
Callback callback) |
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 |
enqueueRegisterAnimation(Animation animation) |
void |
enqueueRemoveAnimation(int animationID) |
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(@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener)
public void profileNextBatch()
public java.util.Map<java.lang.String,java.lang.Long> getProfiledBatchPerfCounters()
public boolean isEmpty()
public void addRootView(int tag, SizeMonitoringFrameLayout rootView, ThemedReactContext themedRootContext)
protected void enqueueUIOperation(UIViewOperationQueue.UIOperation operation)
public void enqueueRemoveRootView(int rootViewTag)
public void enqueueSetJSResponder(int tag, int initialTag, boolean blockNativeResponder)
public void enqueueClearJSResponder()
public void enqueueDispatchCommand(int reactTag, int commandId, @Nullable 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, @Nullable 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, @Nullable int[] indicesToRemove, @Nullable ViewAtIndex[] viewsToAdd, @Nullable int[] tagsToDelete)
public void enqueueSetChildren(int reactTag, ReadableArray childrenTags)
public void enqueueRegisterAnimation(Animation animation)
public void enqueueAddAnimation(int reactTag, int animationID, Callback onSuccess)
public void enqueueRemoveAnimation(int animationID)
public void enqueueSetLayoutAnimationEnabled(boolean enabled)
public void enqueueConfigureLayoutAnimation(ReadableMap config, Callback onSuccess, Callback onError)
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 enqueueUIBlock(UIBlock block)
public void prependUIBlock(UIBlock block)
public void dispatchViewUpdates(int batchId, long commitStartTime, long layoutTime)