Differential Revision: D2663651

fb-gh-sync-id: 2b583fecf5fa7a88f071a7441d03b95d21b8620f
This commit is contained in:
Felix Oghină 2015-11-17 07:54:37 -08:00 коммит произвёл facebook-github-bot-3
Родитель fc511f0730
Коммит 8491b579c8
2 изменённых файлов: 18 добавлений и 4 удалений

Просмотреть файл

@ -835,4 +835,17 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
mOperationsQueue.enqueueSendAccessibilityEvent(tag, eventType); mOperationsQueue.enqueueSendAccessibilityEvent(tag, eventType);
} }
/**
* Get the first non-virtual (i.e. native) parent view tag of the react view with the passed tag.
* If the passed tag represents a non-virtual view, the same tag is returned. If the passed tag
* doesn't map to a react view, or a non-virtual parent cannot be found, -1 is returned.
*/
/* package */ int getNonVirtualParent(int reactTag) {
ReactShadowNode node = mShadowNodeRegistry.getNode(reactTag);
while (node != null && node.isVirtual()) {
node = node.getParent();
}
return node == null ? -1 : node.getReactTag();
}
} }

Просмотреть файл

@ -383,10 +383,11 @@ public class UIViewOperationQueue {
final float containerX = (float) mMeasureBuffer[0]; final float containerX = (float) mMeasureBuffer[0];
final float containerY = (float) mMeasureBuffer[1]; final float containerY = (float) mMeasureBuffer[1];
final int touchTargetReactTag = mNativeViewHierarchyManager.findTargetTagForTouch( final int touchTargetReactTag = mUIManagerModule.getNonVirtualParent(
mReactTag, mNativeViewHierarchyManager.findTargetTagForTouch(
mTargetX, mReactTag,
mTargetY); mTargetX,
mTargetY));
try { try {
mNativeViewHierarchyManager.measure( mNativeViewHierarchyManager.measure(