mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 22:38:59 +08:00
Add NodeRegion to allow any FlatShadowNode to respond to touch events
Summary: @public When Android dispatches `MotionEvent` to `ReactRootView`, it needs to find a correspoding react node that should receive it. To be able to do it, we need to store boundaries of every `FlatShadowNode` in `FlatViewGroup`. Then we can iterate over node boundaries and find one that contains the touch event coordinates. Reviewed By: sriramramani Differential Revision: D2694197
This commit is contained in:
committed by
Ahmed El-Helw
parent
8de2acd3a9
commit
dad378e394
@@ -56,7 +56,8 @@ import com.facebook.react.uimanager.ViewManagerRegistry;
|
||||
/* package */ void updateMountState(
|
||||
int reactTag,
|
||||
@Nullable DrawCommand[] drawCommands,
|
||||
@Nullable AttachDetachListener[] listeners) {
|
||||
@Nullable AttachDetachListener[] listeners,
|
||||
@Nullable NodeRegion[] nodeRegions) {
|
||||
FlatViewGroup view = (FlatViewGroup) resolveView(reactTag);
|
||||
if (drawCommands != null) {
|
||||
view.mountDrawCommands(drawCommands);
|
||||
@@ -64,6 +65,9 @@ import com.facebook.react.uimanager.ViewManagerRegistry;
|
||||
if (listeners != null) {
|
||||
view.mountAttachDetachListeners(listeners);
|
||||
}
|
||||
if (nodeRegions != null) {
|
||||
view.mountNodeRegions(nodeRegions);
|
||||
}
|
||||
}
|
||||
|
||||
/* package */ void updateViewGroup(int reactTag, int[] viewsToAdd, int[] viewsToDetach) {
|
||||
|
||||
Reference in New Issue
Block a user