react-native/Libraries
Spencer Ahrens 1ef4e00fba [ReactNative] Introduce onLayout events
Summary:
Simply add an `onLayout` callback to a native view component, and the callback
will be invoked with the current layout information when the view is mounted and
whenever the layout changes.

The only limitation is that scroll position and other stuff the layout system
isn't aware of is not taken into account.  This is because onLayout events
wouldn't be triggered for these changes and if they are desired they should be
tracked separately (e.g. with `onScroll`) and combined.

Also fixes some bugs with LayoutAnimation callbacks.

@public

Test Plan:
- Run new LayoutEventsExample in UIExplorer and see it work correctly.
- New integration test passes internally (IntegrationTest project seems busted).
- New jest test case passes.

{F22318433}

```
2015-05-06 15:45:05.848 [info][tid:com.facebook.React.JavaScript] "Running application "UIExplorerApp" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF"
2015-05-06 15:45:05.881 [info][tid:com.facebook.React.JavaScript] "received text layout event
", {"target":27,"layout":{"y":123,"x":12.5,"width":140.5,"height":18}}
2015-05-06 15:45:05.882 [info][tid:com.facebook.React.JavaScript] "received image layout event
", {"target":23,"layout":{"y":12.5,"x":122,"width":50,"height":50}}
2015-05-06 15:45:05.883 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":70.5,"x":20,"width":294,"height":204}}
2015-05-06 15:45:05.897 [info][tid:com.facebook.React.JavaScript] "received text layout event
", {"target":27,"layout":{"y":206.5,"x":12.5,"width":140.5,"height":18}}
2015-05-06 15:45:05.897 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":70.5,"x":20,"width":294,"height":287.5}}
2015-05-06 15:45:09.847 [info][tid:com.facebook.React.JavaScript] "layout animation done."
2015-05-06 15:45:09.847 [info][tid:com.facebook.React.JavaScript] "received image layout event
", {"target":23,"layout":{"y":12.5,"x":82,"width":50,"height":50}}
2015-05-06 15:45:09.848 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":110.5,"x":60,"width":214,"height":287.5}}
2015-05-06 15:45:09.862 [info][tid:com.facebook.React.JavaScript] "received text layout event
", {"target":27,"layout":{"y":206.5,"x":12.5,"width":120,"height":68}}
2015-05-06 15:45:09.863 [info][tid:com.facebook.React.JavaScript] "received image layout event
", {"target":23,"layout":{"y":12.5,"x":55,"width":50,"height":50}}
2015-05-06 15:45:09.863 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":128,"x":60,"width":160,"height":337.5}}
```
2015-05-07 12:27:44 -08:00
..
ART [react-native] Remove iOS-specific attributes from ART text 2015-04-30 13:23:16 -08:00
ActionSheetIOS [ReactNative] Fix analyze errors on oss 2015-04-24 08:28:35 -08:00
AdSupport [ReactNative] Fix analyze errors on oss 2015-04-24 08:28:35 -08:00
Animation [React Native] Fix immediate animation crash 2015-05-05 07:21:43 -08:00
AppRegistry [ReactNative] Back out D2014163 entirely 2015-04-23 12:02:47 -08:00
AppStateIOS [ReactNative] Document AppStateIOS 2015-03-25 14:24:41 -08:00
BatchedBridge [ReactNative] parse localized JSON files in JS, not in ObjC 2015-04-28 09:52:35 -08:00
CameraRoll flowify some Libraries 2015-03-25 11:09:54 -08:00
Components [ReactNative] Introduce onLayout events 2015-05-07 12:27:44 -08:00
CustomComponents [ReactNative] Navigator initialRoute default change 2015-05-06 11:18:55 -08:00
Device flowify some Libraries 2015-03-25 11:09:54 -08:00
Fetch [ReactNative] Expanded license on js files 2015-03-23 13:17:54 -08:00
Geolocation [ReactNative] Use explicit doubles on RCTLocationOptions to avoid NSInvocation bug 2015-05-02 14:19:56 -08:00
Image [ReactNative] Do not throw when Image.source is null 2015-05-06 16:16:49 -08:00
Interaction React Native: Fix InteractionManager Race Condition 2015-04-13 11:14:11 -08:00
JavaScriptAppEngine [ReactNative] Only report console.error()s as exceptions in dev mode 2015-04-30 15:02:09 -08:00
LinkingIOS Bump .buckversion to 6cdb82cb7493a86c39d0f0dc3c102d0f470f55de. 2015-04-23 08:24:08 -08:00
Network Force `responseHeaders` to lower case to respect case-insensitivity 2015-05-05 14:09:40 -08:00
Picker [ReactNative] Expanded license on js files 2015-03-23 13:17:54 -08:00
PushNotificationIOS [ReactNative] pass in launchOptions to relevant bridged modules 2015-04-30 14:51:09 -08:00
RCTTest [ReactNative] Fail faster in OSS tests 2015-05-06 14:28:30 -08:00
RCTWebSocketDebugger [ReactNative] Suggest un-pausing debugger when there are issues 2015-04-30 17:20:39 -08:00
RKBackendNode Flowify a bunch of Libraries 2015-03-24 18:22:05 -08:00
ReactIOS [ReactNative] Introduce onLayout events 2015-05-07 12:27:44 -08:00
Settings Fixed UIExplorer in Catalyst shell 2015-05-06 00:08:08 -08:00
Storage Make AsyncStorage types match the implementations 2015-05-01 18:26:11 -08:00
StyleSheet [ReactNative] Pull transform properties out into TransformPropTypes 2015-05-06 14:24:10 -08:00
Text [ReactNative] Fix Text Updating Crash 2015-05-02 10:07:08 -08:00
Utilities [ReactNative] improve console logging a little bit 2015-05-04 18:57:03 -08:00
Vibration [ReactNative] Fix analyze errors on oss 2015-04-24 08:28:35 -08:00
react-native Add SegmentedControlIOS 2015-04-29 08:08:45 -08:00
vendor [ReactNative] Fix fatal from long press 2015-04-27 20:46:23 -08:00
Promise.js Replace ES6Promise with Promise 2015-04-15 06:06:29 -08:00