Back out "[RN][Android] Remove viewIsDescendantOf from Android code"

Summary:
Adding viewIsDescendantOf back, more context 9ae7f0c7da
This method might no not be implemented in Fabric

Reviewed By: ejanzer

Differential Revision: D16186407

fbshipit-source-id: bd7a3f46ac8fbe19ba270b2fbf5c324c9400b740
This commit is contained in:
David Vacca 2019-07-10 20:52:57 -07:00 коммит произвёл Facebook Github Bot
Родитель 2ec8ec050f
Коммит c242fac096
2 изменённых файлов: 19 добавлений и 0 удалений

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

@ -513,6 +513,18 @@ public class UIImplementation {
mOperationsQueue.enqueueFindTargetForTouch(reactTag, targetX, targetY, callback);
}
/** Check if the first shadow node is the descendant of the second shadow node */
public void viewIsDescendantOf(
final int reactTag, final int ancestorReactTag, final Callback callback) {
ReactShadowNode node = mShadowNodeRegistry.getNode(reactTag);
ReactShadowNode ancestorNode = mShadowNodeRegistry.getNode(ancestorReactTag);
if (node == null || ancestorNode == null) {
callback.invoke(false);
return;
}
callback.invoke(node.isDescendantOf(ancestorNode));
}
/**
* 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.

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

@ -629,6 +629,13 @@ public class UIManagerModule extends ReactContextBaseJavaModule
callback);
}
/** Check if the first shadow node is the descendant of the second shadow node */
@ReactMethod
public void viewIsDescendantOf(
final int reactTag, final int ancestorReactTag, final Callback callback) {
mUIImplementation.viewIsDescendantOf(reactTag, ancestorReactTag, callback);
}
@Override
@ReactMethod
public void setJSResponder(int reactTag, boolean blockNativeResponder) {