public class UIImplementation
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
|
UIImplementation(ReactApplicationContext reactContext,
java.util.List<ViewManager> viewManagers) |
protected |
UIImplementation(ReactApplicationContext reactContext,
ViewManagerRegistry viewManagers,
UIViewOperationQueue operationsQueue) |
Modifier and Type | Method and Description |
---|---|
void |
addAnimation(int reactTag,
int animationID,
Callback onSuccess)
Adds an Animation previously registered with
registerAnimation(com.facebook.react.animation.Animation) to a View and starts it |
void |
addUIBlock(UIBlock block) |
protected void |
applyUpdatesRecursive(ReactShadowNode cssNode,
float absoluteX,
float absoluteY,
EventDispatcher eventDispatcher) |
protected void |
calculateRootLayout(ReactShadowNode cssRoot) |
void |
clearJSResponder() |
void |
configureNextLayoutAnimation(ReadableMap config,
Callback success,
Callback error)
Configure an animation to be used for the native layout changes, and native views
creation.
|
protected ReactShadowNode |
createRootShadowNode() |
protected ReactShadowNode |
createShadowNode(java.lang.String className) |
void |
createView(int tag,
java.lang.String className,
int rootViewTag,
ReadableMap props)
Invoked by React to create a new node with a given tag, class name and properties.
|
void |
dispatchViewManagerCommand(int reactTag,
int commandId,
ReadableArray commandArgs) |
void |
dispatchViewUpdates(EventDispatcher eventDispatcher,
int batchId)
Invoked at the end of the transaction to commit any updates to the node hierarchy.
|
void |
findSubviewIn(int reactTag,
float targetX,
float targetY,
Callback callback)
Find the touch target child native view in the supplied root view hierarchy, given a react
target location.
|
double |
getLayoutCount() |
double |
getLayoutTimer() |
protected void |
handleCreateView(ReactShadowNode cssNode,
int rootViewTag,
ReactStylesDiffMap styles) |
protected void |
handleUpdateView(ReactShadowNode cssNode,
java.lang.String className,
ReactStylesDiffMap styles) |
void |
manageChildren(int viewTag,
ReadableArray moveFrom,
ReadableArray moveTo,
ReadableArray addChildTags,
ReadableArray addAtIndices,
ReadableArray removeFrom)
Invoked when there is a mutation in a node tree.
|
void |
measure(int reactTag,
Callback callback)
Determines the location on screen, width, and height of the given view relative to the root
view and returns the values via an async callback.
|
void |
measureInWindow(int reactTag,
Callback callback)
Determines the location on screen, width, and height of the given view relative to the device
screen and returns the values via an async callback.
|
void |
measureLayout(int tag,
int ancestorTag,
Callback errorCallback,
Callback successCallback)
Measures the view specified by tag relative to the given ancestorTag.
|
void |
measureLayoutRelativeToParent(int tag,
Callback errorCallback,
Callback successCallback)
Like
measure(int, com.facebook.react.bridge.Callback) and measureLayout(int, int, com.facebook.react.bridge.Callback, com.facebook.react.bridge.Callback) but measures relative to the immediate parent. |
void |
onHostDestroy() |
void |
onHostPause() |
void |
onHostResume() |
void |
registerAnimation(Animation animation)
Registers a new Animation that can then be added to a View using
addAnimation(int, int, com.facebook.react.bridge.Callback) . |
void |
registerRootView(SizeMonitoringFrameLayout rootView,
int tag,
int width,
int height,
ThemedReactContext context)
Registers a root node with a given tag, size and ThemedReactContext
and adds it to a node registry.
|
void |
removeAnimation(int reactTag,
int animationID)
Removes an existing Animation, canceling it if it was in progress.
|
void |
removeRootView(int rootViewTag)
Unregisters a root node with a given tag.
|
protected void |
removeShadowNode(ReactShadowNode nodeToRemove) |
void |
removeSubviewsFromContainerWithID(int containerTag)
Method which takes a container tag and then releases all subviews for that container upon
receipt.
|
void |
replaceExistingNonRootView(int oldTag,
int newTag)
Replaces the View specified by oldTag with the View specified by newTag within oldTag's parent.
|
int |
resolveRootTagFromReactTag(int reactTag) |
protected ReactShadowNode |
resolveShadowNode(int reactTag) |
protected ViewManager |
resolveViewManager(java.lang.String className) |
void |
sendAccessibilityEvent(int tag,
int eventType) |
void |
setChildren(int viewTag,
ReadableArray childrenTags)
An optimized version of manageChildren that is used for initial setting of child views.
|
void |
setJSResponder(int reactTag,
boolean blockNativeResponder) |
void |
setLayoutAnimationEnabledExperimental(boolean enabled)
LayoutAnimation API on Android is currently experimental.
|
void |
setViewHierarchyUpdateDebugListener(NotThreadSafeViewHierarchyUpdateDebugListener listener) |
void |
showPopupMenu(int reactTag,
ReadableArray items,
Callback error,
Callback success)
Show a PopupMenu.
|
void |
synchronouslyUpdateViewOnUIThread(int tag,
ReactStylesDiffMap props)
Used by native animated module to bypass the process of updating the values through the shadow
view hierarchy.
|
void |
updateRootNodeSize(int rootViewTag,
int newWidth,
int newHeight,
EventDispatcher eventDispatcher)
Invoked when native view that corresponds to a root node has its size changed.
|
void |
updateView(int tag,
java.lang.String className,
ReadableMap props)
Invoked by React to create a new node with a given tag has its properties changed.
|
protected void |
updateViewHierarchy(EventDispatcher eventDispatcher) |
public UIImplementation(ReactApplicationContext reactContext, java.util.List<ViewManager> viewManagers)
protected UIImplementation(ReactApplicationContext reactContext, ViewManagerRegistry viewManagers, UIViewOperationQueue operationsQueue)
protected ReactShadowNode createRootShadowNode()
protected ReactShadowNode createShadowNode(java.lang.String className)
protected final ReactShadowNode resolveShadowNode(int reactTag)
protected final ViewManager resolveViewManager(java.lang.String className)
public void registerRootView(SizeMonitoringFrameLayout rootView, int tag, int width, int height, ThemedReactContext context)
public void removeRootView(int rootViewTag)
public void updateRootNodeSize(int rootViewTag, int newWidth, int newHeight, EventDispatcher eventDispatcher)
public double getLayoutCount()
public double getLayoutTimer()
public void createView(int tag, java.lang.String className, int rootViewTag, ReadableMap props)
protected void handleCreateView(ReactShadowNode cssNode, int rootViewTag, @Nullable ReactStylesDiffMap styles)
public void updateView(int tag, java.lang.String className, ReadableMap props)
public void synchronouslyUpdateViewOnUIThread(int tag, ReactStylesDiffMap props)
protected void handleUpdateView(ReactShadowNode cssNode, java.lang.String className, ReactStylesDiffMap styles)
public void manageChildren(int viewTag, @Nullable ReadableArray moveFrom, @Nullable ReadableArray moveTo, @Nullable ReadableArray addChildTags, @Nullable ReadableArray addAtIndices, @Nullable ReadableArray removeFrom)
tag
- react tag of the node we want to manageindicesToRemove
- ordered (asc) list of indicies at which view should be removedviewsToAdd
- ordered (asc based on mIndex property) list of tag-index pairs that represent
a view which should be added at the specified indextagsToDelete
- list of tags corresponding to views that should be removedpublic void setChildren(int viewTag, ReadableArray childrenTags)
viewTag
- tag of the parentchildrenTags
- tags of the childrenpublic void replaceExistingNonRootView(int oldTag, int newTag)
public void removeSubviewsFromContainerWithID(int containerTag)
containerTag
- the tag of the container for which the subviews must be removedpublic void findSubviewIn(int reactTag, float targetX, float targetY, Callback callback)
reactTag
- the tag of the root view to traversetargetX
- target X locationtargetY
- target Y locationcallback
- will be called if with the identified child view react ID, and measurement
info. If no view was found, callback will be invoked with no data.public void measure(int reactTag, Callback callback)
public void measureInWindow(int reactTag, Callback callback)
public void measureLayout(int tag, int ancestorTag, Callback errorCallback, Callback successCallback)
public void measureLayoutRelativeToParent(int tag, Callback errorCallback, Callback successCallback)
measure(int, com.facebook.react.bridge.Callback)
and measureLayout(int, int, com.facebook.react.bridge.Callback, com.facebook.react.bridge.Callback)
but measures relative to the immediate parent.public void dispatchViewUpdates(EventDispatcher eventDispatcher, int batchId)
protected void updateViewHierarchy(EventDispatcher eventDispatcher)
public void registerAnimation(Animation animation)
addAnimation(int, int, com.facebook.react.bridge.Callback)
.public void addAnimation(int reactTag, int animationID, Callback onSuccess)
registerAnimation(com.facebook.react.animation.Animation)
to a View and starts itpublic void removeAnimation(int reactTag, int animationID)
public void setLayoutAnimationEnabledExperimental(boolean enabled)
enabled
- whether layout animation is enabled or notpublic void configureNextLayoutAnimation(ReadableMap config, Callback success, Callback error)
config
- the configuration of the animation for view addition/removal/update.success
- will be called when the animation completes, or when the animation get
interrupted. In this case, callback parameter will be false.error
- will be called if there was an error processing the animationpublic void setJSResponder(int reactTag, boolean blockNativeResponder)
public void clearJSResponder()
public void dispatchViewManagerCommand(int reactTag, int commandId, ReadableArray commandArgs)
public void showPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success)
reactTag
- the tag of the anchor view (the PopupMenu is displayed next to this view); this
needs to be the tag of a native view (shadow views can not be anchors)items
- the menu items as an array of stringserror
- will be called if there is an error displaying the menusuccess
- will be called with the position of the selected item as the first argument, or
no arguments if the menu is dismissedpublic void sendAccessibilityEvent(int tag, int eventType)
public void onHostResume()
public void onHostPause()
public void onHostDestroy()
public void setViewHierarchyUpdateDebugListener(@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener)
protected final void removeShadowNode(ReactShadowNode nodeToRemove)
protected void calculateRootLayout(ReactShadowNode cssRoot)
protected void applyUpdatesRecursive(ReactShadowNode cssNode, float absoluteX, float absoluteY, EventDispatcher eventDispatcher)
public void addUIBlock(UIBlock block)
public int resolveRootTagFromReactTag(int reactTag)