react-native/React/Modules
alvaromb e52cab5a7f Adds the ability to use UIManager to check if a node is an ancestor
Summary:
Sometimes is handy to check if a React node is a descendant of another node or not. For instance, I want to check if the focused `TextInput` is descendant of an specific `ScrollView`:

```js
const currentlyFocusedField = TextInput.State.currentlyFocusedField()
UIManager.viewIsAncestorOf(
  currentlyFocusedField,
  this.getInnerViewNode(),
  (isAncestor) => {
    if (isAncestor) {
      console.log('The focused field is a descendant of this ScrollView!')
    }
  }
)
```

This function uses the same strategy as the `measureLayout` method to check if one node is an ancestor of other node. As the `measureLayout` method, this is performed outside the main thread.

By now I've only implemented the iOS version and its tests, but if this function is going to be merged I'll implement the Android version too. I have objc experience but no Java or Android, so I prefer to validate this functionality before jumping into developing the Android part.
Closes https://github.com/facebook/react-native/pull/7876

Differential Revision: D3662045

Pulled By: javache

fbshipit-source-id: b9668e8ea94fd01db76651f16243926cf9c2566f
2016-08-03 04:13:43 -07:00
..
RCTAccessibilityManager.h Replaced RCTSparseArray with NSDictionary 2015-11-14 10:28:28 -08:00
RCTAccessibilityManager.m Update RCTNetworking, RCTNetInfo and RCTLocationManager to use new events system 2016-05-25 04:28:36 -07:00
RCTAlertManager.h Remove an existing UIAlertViews when invalidating the RCTAlertManager 2015-09-18 08:45:27 -07:00
RCTAlertManager.m ActionSheetIOS - support share sheet on modals 2016-05-20 17:13:21 -07:00
RCTAppState.h Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
RCTAppState.m iOS: Provide correct initial value for AppState.currentState 2016-07-12 23:28:22 -07:00
RCTAsyncLocalStorage.h Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
RCTAsyncLocalStorage.m Automated changes to remove implicit capture of self in blocks: Libraries/FBReactKit/BUCK 2016-07-07 12:44:14 -07:00
RCTClipboard.h add Clipboard component for ios and android 2015-12-09 10:04:21 -08:00
RCTClipboard.m Minor fixes to clipboard and Linking to remove TODOs 2016-02-10 12:25:51 -08:00
RCTDevLoadingView.h [RCTDevLoadingView] Add ability to disable during development. 2015-09-04 03:46:06 -08:00
RCTDevLoadingView.m Make bridge initialization configurable 2016-07-18 07:13:32 -07:00
RCTDevMenu.h Refactor hot loading implementation on iOS 2016-01-04 10:40:32 -08:00
RCTDevMenu.m Remove more weakSelf/strongSelf errors 2016-07-13 08:13:17 -07:00
RCTEventEmitter.h Added native event emitter 2016-05-11 06:27:29 -07:00
RCTEventEmitter.m Use new enqueueJSCall method everywhere 2016-08-02 11:14:06 -07:00
RCTExceptionsManager.h Refactored module access to allow for lazy loading 2015-11-25 04:49:45 -08:00
RCTExceptionsManager.m Replaced RegExp method parser with recursive descent 2015-12-10 10:12:29 -08:00
RCTI18nManager.h Move Bridge functions to OSS -- RTL experiment 2016-07-06 16:28:41 -07:00
RCTI18nManager.m Move Bridge functions to OSS -- RTL experiment 2016-07-06 16:28:41 -07:00
RCTI18nUtil.h Change forceRTL to allowRTL 2016-06-27 12:58:21 -07:00
RCTI18nUtil.m Change forceRTL to allowRTL 2016-06-27 12:58:21 -07:00
RCTKeyboardObserver.h Added native event emitter 2016-05-11 06:27:29 -07:00
RCTKeyboardObserver.m Added native event emitter 2016-05-11 06:27:29 -07:00
RCTRedBox.h Add ability to customize error messages and stacks within the iOS redbox 2016-07-18 11:28:36 -07:00
RCTRedBox.m Add ability to customize error messages and stacks within the iOS redbox 2016-07-18 11:28:36 -07:00
RCTSourceCode.h Remove SourceCode.getScriptText 2016-06-07 11:13:32 -07:00
RCTSourceCode.m Remove SourceCode.getScriptText 2016-06-07 11:13:32 -07:00
RCTStatusBarManager.h Added native event emitter 2016-05-11 06:27:29 -07:00
RCTStatusBarManager.m Added native event emitter 2016-05-11 06:27:29 -07:00
RCTTiming.h [ReactNative] Use a single DisplayLink held by the bridge 2015-04-15 07:07:48 -08:00
RCTTiming.m Use new enqueueJSCall method everywhere 2016-08-02 11:14:06 -07:00
RCTUIManager.h Expose UIManager queue via a static function to prevent race conditions 2016-05-16 08:13:21 -07:00
RCTUIManager.m Adds the ability to use UIManager to check if a node is an ancestor 2016-08-03 04:13:43 -07:00