Commit Graph

1130 Commits

Author SHA1 Message Date
Emil Sjolander b7ded130df Dont use explicit .so file name to support more platforms
Reviewed By: dreiss

Differential Revision: D3981166

fbshipit-source-id: 0b19f73e6de48a30613419ccc54735c968701532
2016-10-08 09:28:42 -07:00
Aaron Chiu 24a83fae2f make view managers native modules
Reviewed By: achen1

Differential Revision: D3973591

fbshipit-source-id: 44886f3bf045ed64585c92eb2e291627eed86c92
2016-10-07 05:43:45 -07:00
Aaron Chiu 1296cb29eb add flag to enable lazy view managers
Reviewed By: achen1

Differential Revision: D3981171

fbshipit-source-id: 2f6b8370064a5835e2e3636d4c1a7f42cc28ccaf
2016-10-07 05:43:45 -07:00
Emil Sjolander d89f59d94a Resolve some differences between CSSNode and CSSNodeJNI
Reviewed By: lucasr

Differential Revision: D3960755

fbshipit-source-id: 3e13a9435208851a96a619c07625ef2a5402f5ec
2016-10-07 05:28:37 -07:00
Aaron Chiu 8708c8bb82 make ViewManager extend BaseJavaModule
Reviewed By: achen1

Differential Revision: D3950323

fbshipit-source-id: 91fda89a9a457e0e5b6952b744eeba5e31c46a9a
2016-10-06 15:58:38 -07:00
Mike Lambert 1502e66c31 Allow code to check android permissions when run from a Service as well as Activity
Summary:
This allows the React JS code that's running from a Service (ie GcmListenerService) to check permissions (ie check for VIBRATE permissions before delivering notifications)

**Test plan (required)**

I've run this code from a GcmListenerService subclass, and it works correctly.
Closes https://github.com/facebook/react-native/pull/10229

Differential Revision: D3980853

fbshipit-source-id: 026b1f0c953d7093b5af2bec0b4a93ebd228f62e
2016-10-06 04:28:35 -07:00
Felix Oghina f7cbd56d8e pass EventDispatcher to UIImplementation constructor
Summary: This way `UIImplementation` can hold on to it and use it outside of calls from the `UIManagerModule`.

Reviewed By: lexs

Differential Revision: D3899774

fbshipit-source-id: 01e4956c4540bcdf30774a3f40a625e934714ee9
2016-10-04 12:29:13 -07:00
Konstantin Raev 20ef20591f fixed mockito version
Summary:
Gradle unit tests started failing, this PR fixes mockito to be one specific version instead of loose 1.+

**Explain the **motivation** for making this change. What existing problem does the pull request solve?**

Circle CI started failing without any specific reason https://circleci.com/gh/facebook/react-native/tree/master, looks like a dependency error.

Alas it is, I can reproduce the error on master with clean caches.

**Test plan (required)**

After the fix:

```
bestander-pro:react-native bestander$ ./gradlew :ReactAndroid:testDebugUnitTest
Incremental java compilation is an incubating feature.
:ReactAndroid:preBuild UP-TO-DATE
:ReactAndroid:preDebugBuild UP-TO-DATE
:ReactAndroid:checkDebugManifest
:ReactAndroid:preDebugAndroidTestBuild UP-TO-DATE
:ReactAndroid:preDebugUnitTestBuild UP-TO-DATE
:ReactAndroid:preReleaseBuild UP-TO-DATE
:ReactAndroid:preReleaseUnitTestBuild UP-TO-DATE
:ReactAndroid:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:ReactAndroid:prepareComAndro
Closes https://github.com/facebook/react-native/pull/10239

Differential Revision: D3968396

Pulled By: matryoshcow

fbshipit-source-id: 63374261303fb98dc252898dfd5d3b3346597e4f
2016-10-04 10:43:35 -07:00
Pieter De Baets d7d89172c2 Expose ModuleRegistry on ExecutorDelegate
Differential Revision: D3944588

fbshipit-source-id: f8450a6735e1f6283c3bfe9d2ce883327172621c
2016-10-03 05:13:38 -07:00
Felix Oghina 6d175f2c25 Android: enable foreground ripple
Reviewed By: astreet

Differential Revision: D3932066

fbshipit-source-id: ee2f019cb9ba41e32cbbd8c1cd07c9ed5263fddc
2016-10-03 04:28:46 -07:00
Andy a2aab625f3 Fix webview crash when trying to display local html files
Summary:
When using webview on android and trying to link to an html file located on device (using `file://`), the application would crash with an error specifying that nothing handles the fired intent. This is due to [`33a1f28`](33a1f28654) which attempts to intercept all non `http(s)` links.

This is a simple fix so hopefully it can make it into the next stable release.
Closes https://github.com/facebook/react-native/pull/9668

Differential Revision: D3956485

fbshipit-source-id: 5a752abc21802a44e3a26e88669ccb6852076992
2016-10-01 11:43:37 -07:00
Pieter De Baets 86c195b3d8 Upgrade OSS folly dependency
Reviewed By: bestander

Differential Revision: D3952605

fbshipit-source-id: 70146987c07b3c9917d19d7fbf844242343f9777
2016-09-30 15:28:38 -07:00
Hoa Dinh 5a24ea0b42 Create headers symlinks for FBReactKit
Reviewed By: javache, skotchvail

Differential Revision: D3946452

fbshipit-source-id: c6354f529bec2f9635a0ecf5f65e21dc4e17b1e4
2016-09-30 14:28:41 -07:00
Alexander Pantyuhov c4ac8b329c StatusBar: barStyle support for Android (API 23+)
Summary:
Android (starting from API 23) supports "light status bar", thus it is possible to extend StatusBar and make `barStyle` property work not only for iOS, but also for Android.

This PR introduces one more `barStyle` option `dark-content` in addition to two existing ones (`default` and `light-content`).
Why there are 3 options instead of 2?

Two simple reasons:
1) to make all existing applications fully compatible with these changes;
2) the default status bar on Android is dark with white text and icons, while on iOS it is light with black text and icons on it. Thus the `default` option means something like "I don't really care, just apply the default color for this platform", while two other options (`light-content` and `dark-content`) allow to accurately specify the required result.
Closes https://github.com/facebook/react-native/pull/10185

Differential Revision: D3952346

fbshipit-source-id: 999a67614abff52321fbeb06298ebf1946c3f1d1
2016-09-30 12:58:37 -07:00
Pieter De Baets 5b52dab781 Remove follySupport.h
Reviewed By: lexs

Differential Revision: D3944918

fbshipit-source-id: 702907a12e3916f9d6edde7362416188df909d70
2016-09-30 12:28:41 -07:00
Andrei Coman 9b261dbc94 Modal statusbar cleanup
Summary:
The hack for the status bar height is not necessary any longer, so we can remove
all code related to it

Reviewed By: lexs

Differential Revision: D3943770

fbshipit-source-id: 2d70f4ea10dd76ea6e6a73bb6edccae388bde1c0
2016-09-30 03:13:36 -07:00
Dave Pack 12a97e1ecd Fix Modal size on Android tablet
Summary:
On tablets, using Display.getRotation() returned ROTATION_0 or ROTATION_180 when it was in landscape, not portrait as it does on phones. This resulted in the Modal being sized incorrectly on tablets. Using size and comparing width and height is the only way I can think of to figure out the device orientation and give the modal the correct size. With this change, all issues listed in #7708 should be resolved.

**Test plan**
Modal should correctly fill screen on Android phone and tablet in both portrait and landscape.
Closes https://github.com/facebook/react-native/pull/10159

Differential Revision: D3950369

Pulled By: andreicoman11

fbshipit-source-id: 9488c4302a76cc48e4f8a4026eb5770d40b6e3d2
2016-09-30 02:44:09 -07:00
Nicolas Charpentier aa36adb116 Fix example in buck DEFS
Summary:
I noticed that the example doesn't match the definition below.

cc bestander
Closes https://github.com/facebook/react-native/pull/10175

Differential Revision: D3943967

Pulled By: bestander

fbshipit-source-id: 6941d4d663e1fd42f8723cd722eb8a5712a63dc8
2016-09-29 08:28:39 -07:00
Felix Oghina 3080b8d26c Android: add support for headless js tasks
Summary: Provide a base `HeadlessJsTaskService` class that can be extended to run JS in headless mode in response to some event. Added `HeadlessJsTaskEventListener` for modules that are interested in background lifecycle events, and `HeadlessJsTaskContext` that basically extends `ReactContext` without touching it. The react instance is shared with the rest of the app (e.g. activities) through the `ReactNativeHost`.

Reviewed By: astreet

Differential Revision: D3225753

fbshipit-source-id: 2c5e7679636f31e0e7842d8a67aeb95baf47c563
2016-09-29 03:58:33 -07:00
Chris Hopman eafd9b258f Use std=c++1y in xreact pertests
Reviewed By: mzlee

Differential Revision: D3935375

fbshipit-source-id: b477d865427ed56d5271477b198af633bba2f314
2016-09-28 16:29:01 -07:00
Andrei Coman 404b7cc069 BREAKING: Fix modal resizing on keyboard show
Summary:
This changes modal behavior to resize when the keyboard appears/disappears.
Previously, the modal would not react in any way, or it would pan above to bring the
TextInput into view. Resizing is the correct behavior for android.

This is not trivial, as in, setting the flag, because of the combination of
react native laying out all views and the system reacting to the keyboard
appearance in a weird way. Namely:
- if `windowTranslucentStatus` is not set, the system will just call
  `onSizeChanged` on the dialog's content view, and everything works nicely
- with `windowTranslucentStatus` set, the system will consider the dialog as a
  full screen view that doesn't resize. In order for it to resize, the base
  view of the layout needs to have
  `setFitsSystemWindows(true)` called on it. This is needed, so that the system
  can call layout on that base view with the new value of `paddingBottom` that
  coincides with the height of the keyboard. Neat.

We fix this by wrapping our existing content view (mHostView) in a simple
FrameLayout that has `setFitsSystemWindows` set. That way, `mHostView` will have
`onSizeChanged` called on itself with the correct new size of the dialog.

This has the fortunate consequence of our layout now also getting `paddingTop` as the size of the
status bar, which means that we can remove the JS `top` hack in Modal, which
was necessary for no view getting drawn under the status bar.

This behavior is set as default, since that is the default correct Android behavior.

Reviewed By: astreet

Differential Revision: D3913784

fbshipit-source-id: 4378ada21f466dc7ac6e357abeca10b88009ca3f
2016-09-28 02:58:37 -07:00
Marc Horowitz fc62b00880 Update tests to work better with async runJSBundle
Reviewed By: bestander

Differential Revision: D3932963

fbshipit-source-id: 16967987b3f777104ab3a41d5967ff1b2f4678db
2016-09-27 14:58:41 -07:00
Aaron Chiu d22a85211e remove CompositeLazyReactPackage in favor of ReactInstanceManager.Builder's existing ReactPackage list
Reviewed By: andreicoman11

Differential Revision: D3928330

fbshipit-source-id: aee8a7c31d80f5500744029676b9f2b8c87aa98a
2016-09-27 09:58:30 -07:00
Aaron Chiu 1f27dd6643 log into QPL time to create module for lazy native modules
Reviewed By: andreicoman11

Differential Revision: D3928797

fbshipit-source-id: d1c6c024c4994b237155f16e6a915b16f216d56d
2016-09-27 09:43:30 -07:00
Konstantin Raev 449c195941 Temporarily disabled CatalystUIManagerTestCase.testFlexWithTextViews test
Summary:
After D3876927 this test started failing on CI.
Locally we can't reproduce it, and it will take some time to understand what this test is intended for so that we could remove the variable part.
More investigation will follow, t13583009

Reviewed By: emilsjolander

Differential Revision: D3930334

fbshipit-source-id: 279f67eb5a77b5d4250afd48c8b94c828da6925c
2016-09-27 07:13:30 -07:00
Andrei Coman 30989dd24a Fix ReactSwipeRefreshLayout
Summary:
`ReactSwipeRefreshLayout` extends `SwipeRefreshLayout` which does not play nice with Android's touch handling system.
There are two problems:
1. `SwipeRefreshLayout` overrides and swallows `requestDisallowInterceptTouchEvent`, which means that Views underneath the `SwipeRefreshLayout` will not interact correctly with parent Views of
`SwipeRefreshLayout`. We've seen this in practice by H-ScrollViews having their touches intercepted by an enclosing ViewPager. This is fixed by passing `requestDisallowInterceptTouchEvent` up to the parents of `SwipeRefreshLayout`.
2. `SwipeRefreshLayout` overrides `onInterceptTouchEvent` and never calls `super.onInterceptTouchEvent`, therefore ignoring the value of `disallowIntercept`. That means that it will intercept some touches when it
shouldn't. One such case is again the H-ScrollView, which should receive all horizontal scrolls and stop `SwipeRefreshLayout` from intercepting any touch events after scrolling. Currently, after the H-ScrollView starts scrolling, it is still possible to get the `SwipeRefreshLayout` to detect and emit refresh events. This is fixed by checking and blocking on horizontal scrolls.

Reviewed By: foghina

Differential Revision: D3929893

fbshipit-source-id: e6f8050fb554e53318a7ca564c49c20cb5137df9
2016-09-27 04:28:34 -07:00
Kevin Gozali 0a0dd30c6a Introduced AnimatedDivision
Summary:
Combining 2 animated values via addition, multiplication, and modulo are already supported, and this adds another one: division.
There are some cases where an animated value needs to invert (1 / x) another animated value for calculation. An example is inverting a scale (2x --> 0.5x), e.g.:

```
const a = Animated.Value(1);
const b = Animated.divide(1, a);

Animated.spring(a, {
  toValue: 2,
}).start();
```

`b` will then follow `a`'s spring animation and produce the value of `1 / a`.

The basic usage is like this:

```
<Animated.View style={{transform: [{scale: a}]}}>
  <Animated.Image style={{transform: [{scale: b}]}} />
<Animated.View>
```

In this example, the inner image won't get stretched at all because the parent's scaling gets cancelled out.

Also added this to native animated implementation.

Reviewed By: foghina, mmmulani

Differential Revision: D3922891

fbshipit-source-id: 32508956c4b65b2deb7574d50a10c85b4809b961
2016-09-26 16:43:51 -07:00
Marc Horowitz 971cda8794 Move thread jump for js loading into NativeToJSBridge, out of platform code
Reviewed By: javache

Differential Revision: D3906009

fbshipit-source-id: b9782a6c209e3c1626899dac7fd50233cdef87f3
2016-09-26 16:14:10 -07:00
Emil Sjolander 0a9b6bedb3 BREAKING - Fix unconstraint sizing in main axis
Summary:
This fixes measuring of items in the main axis of a container. Previously items were in a lot of cases measured with UNSPECIFIED instead of AT_MOST. This was to support scrolling containers. The correct way to handle scrolling containers is to instead provide them with their own overflow value to activate this behavior. This is also similar to how the web works.

This is a breaking change. Most of your layouts will continue to function as before however some of them might not. Typically this is due to having a `flex: 1` style where it is currently a no-op due to being measured with an undefined size but after this change it may collapse your component to take zero size due to the implicit `flexBasis: 0` now being correctly treated. Removing the bad `flex: 1` style or changing it to `flexGrow: 1` should solve most if not all layout issues your see after this diff.

Reviewed By: majak

Differential Revision: D3876927

fbshipit-source-id: 81ea1c9d6574dd4564a3333f1b3617cf84b4022f
2016-09-26 06:13:56 -07:00
Andrei Coman 0abaaeead0 Modal: move style to xml
Summary:
The styles that get applied to the Dialogs that are created in RN are set in
`themes.xml`, so I'm moving `windowTranslucentStatus` there as well so that we
have all of them collocated.

Reviewed By: astreet

Differential Revision: D3913402

fbshipit-source-id: 8f23e84fb017c8810634ffe8279171061292b351
2016-09-26 03:59:09 -07:00
Aaron Chiu 1b2d9a858b add perf marker for create module
Reviewed By: andreicoman11

Differential Revision: D3910533

fbshipit-source-id: 645da63ac9fb0721f13eba05f52ae2c37a868f60
2016-09-23 16:58:30 -07:00
Aaron Chiu 797ca6c219 Add ability to lazy load Native Java Modules
Summary: Utilizes the build time annotation processor ReactModuleSpecProcessor that creates ReactModuleInfos for modules annotated with ReactModule and listed in the ReactModuleList annotation of LazyReactPackages. This way we don't have to instantiate the native modules to get the name, canOverrideExistingModule, and supportsWebWorkers values of the native modules. In the NativeModuleRegistry, we either store these ReactModuleInfos inside of a ModuleHolder or if we can't get the ReactModuleInfo for a specific module we instantiate that module to get the values (as we previously did) to store in a LegacyModuleInfo.

Reviewed By: astreet

Differential Revision: D3796561

fbshipit-source-id: f8fb9b4993f59b51ce595eb2f2c3425129b28ce5
2016-09-23 15:58:46 -07:00
Don Yu 17219720e4 Add support for image onLoad, onLoadEnd, onError events for IgReactImageView
Summary: Create separate buck library for image events so you can depend on that without depending on all of fresco

Reviewed By: brosenfeld

Differential Revision: D3907894

fbshipit-source-id: dca7a00d38b8b8bb5bab05b6883f6933fff3fa76
2016-09-23 04:43:54 -07:00
Aaron Chiu 826d7345ad Test diff CI fix: Update CoreModulesPackage.java
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**

Explain the **motivation** for making this change. What existing problem does the pull request solve?

Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).

For more info, see
Closes https://github.com/facebook/react-native/pull/10057

Differential Revision: D3913431

Pulled By: bestander

fbshipit-source-id: c761640839ce0e85196ffd7fc1a4e1c615078b06
2016-09-23 04:43:53 -07:00
Aaron Chiu bdc47313e8 move some JS modules to debug only
Reviewed By: lexs

Differential Revision: D3893217

fbshipit-source-id: d84aea3391fea435ea1de39f7ce8cf08586b373f
2016-09-22 11:28:36 -07:00
Brad Daily 61eb3e8826 Reverted commit D3841122
Summary:
This commit brings Android in line with iOS WebSockets by sending along cookies from the shared CookieManager. See: https://github.com/facebook/react-native/pull/5630
Closes https://github.com/facebook/react-native/pull/6067

Differential Revision: D3841122

Pulled By: wutalman

fbshipit-source-id: 6dae03bdf1c4599f12c0b191fcc56a61952fb59e
2016-09-22 09:13:41 -07:00
Andrei Coman 3318483b31 Fix dev menu on top of modals
Summary:
The dialog intercepts all key events, we need to redirect some of them to the
activity so that it can display the dev menu.

Reviewed By: foghina

Differential Revision: D3894503

fbshipit-source-id: fb62346a4da783f28a73c5a9e20566a451177629
2016-09-22 04:49:58 -07:00
Andrei Coman 922cd6ddfc Fix Modal freeze
Summary:
In some cases, the size of the content view changes before we add views to the
Modal. That means that the size of that view will not be set through the
`onSizeChanged` method. This can result in some apps apparently freezing,
since the dialog is created, but there are no actual views in it.
For that reason, we still need the ModalHostShadowNode to set the size of the
initial view, so that by the time the view gets added it already has the correct
size.
There's a new helper class so that we can reuse the modal size computation.

Reviewed By: foghina

Differential Revision: D3892795

fbshipit-source-id: 6a32bd7680a74d9912a21bfebb4ebd7a3c3c3e38
2016-09-20 06:58:49 -07:00
Gant Laborde c6024f6391 - Add ability to detect if location was mocked
Summary:
Since API 18, Android locations have had the `isFromMockProvider()` function, to verify the validity of a provided location.  This was one of many methods one could verify location data, but as of Marshmallow, the other ways of detecting if "Mock Locations" is on in developer settings has been deprecated or defunct.

This means some devices can only detect location mocking by exposing the method on the location object.

This change provides that exposure.
Closes https://github.com/facebook/react-native/pull/9390

Differential Revision: D3858205

Pulled By: bestander

fbshipit-source-id: 3bae429cc0596ea01926c5be204f4403e4a2414f
2016-09-20 05:59:04 -07:00
Brad Daily 04392f2428 Android WebSocket: include cookies with request
Summary:
This commit brings Android in line with iOS WebSockets by sending along cookies from the shared CookieManager. See: https://github.com/facebook/react-native/pull/5630
Closes https://github.com/facebook/react-native/pull/6067

Differential Revision: D3841122

Pulled By: mkonicek

fbshipit-source-id: 6607424feeb31c9da4e370ebe4b33dbbedc0a446
2016-09-19 15:44:17 -07:00
Pieter De Baets 145109fc6d Remove additional JSON encoding for native->JS communication
Reviewed By: mhorowitz

Differential Revision: D3857323

fbshipit-source-id: 4386cc107b8a1425ecb7297b0f659f6c47f01a78
2016-09-19 04:44:12 -07:00
Andy Street 5deb528695 Don't crash if OEM has replaced OverScroller in ScrollView
Summary: Some OEMs have changed out the default scroller implementation in their ScrollView. We now check for that case and handle it gracefully instead of crashing.

Reviewed By: foghina

Differential Revision: D3876492

fbshipit-source-id: 4d03b88c4972e939c8352eeb9f30275e3ecf76e2
2016-09-19 04:14:01 -07:00
Janic Duplessis 6565929358 Add support for animated events
Summary:
This adds support for `Animated.event` driven natively. This is WIP and would like feedback on how this is implemented.

At the moment, it works by providing a mapping between a view tag, an event name, an event path and an animated value when a view has a prop with a `AnimatedEvent` object. Then we can hook into `EventDispatcher`, check for events that target our view + event name and update the animated value using the event path.

For now it works with the onScroll event but it should be generic enough to work with anything.
Closes https://github.com/facebook/react-native/pull/9253

Differential Revision: D3759844

Pulled By: foghina

fbshipit-source-id: 86989c705847955bd65e6cf5a7d572ec7ccd3eb4
2016-09-19 04:14:01 -07:00
Andrei Coman bdff10b4ea Fix text, textinput padding
Summary:
The issue here is that on some devices (ie. Nexus 5X), under certain
circumstances, the text gets trimmed. A simple example is P56651885, where the
text is at the end of the line and some padding is set. Digging further with
P56659346, I found that only the paddings that have integer pixel values work
correctly: these are the values P56656483, and this is the screenshot of that
test: {F63510378}.

It turns out that when we set the padding directly on the TextView, we have to
convert from float to int, and use `ceil` in the process. We lose some precision
here, since the csslayout will use the float values to compute the layout of the
views. The ideal solution would be to just set the float values on the TextView,
but since we can't do that, we should avoid using `ceil` instead of `floor`
since it can have bad side-effects in some scenarios.
Going way back to D1881202 and D1710471, we started using `ceil` because that
is how android handles non-integer
density ratios: "This figure is the factor by which you should multiply the dp
units on order to get the actual pixel count for the current screen. (Then add
0.5f to round the figure up to the nearest whole number, when converting to an
integer.)", see https://developer.android.com/guide/practices/screens_support.html.

Reviewed By: emilsjolander

Differential Revision: D3876310

fbshipit-source-id: 701c05a8b1a045d4e06fc89ffe79162c1eecb62c
2016-09-19 02:58:48 -07:00
Andrei Coman 4941cbcf1e Fix modal size
Summary:
With our previous fix to resize the Modal on orientation change, we broke the
computation of its size. The existing computation in `ModalHostShadowNode` was
in fact correct, and we were overriding it from `onSizeChanged`. By computing the
size of the Modal in `onSizeChanged` directly (and correctly), we fix this, and
simplify code by removing the `ModalHostShadowNode`.

Reviewed By: foghina

Differential Revision: D3863054

fbshipit-source-id: aaf4a8881798df4d2ab1dab882a9d9dfdc0a9342
2016-09-19 02:58:47 -07:00
ransj 44b0e6b91f optimize getNativeProps method
Summary:
The original method getNativeProps in ViewManagerPropertyUpdater.java create more HashMaps and putAll method need to re-hash the key again to avoid conflicts. This pull request pass the map as params to avoid the problem and update ReactPropertyProcessor.java to adapt the change.
Closes https://github.com/facebook/react-native/pull/9916

Differential Revision: D3873152

fbshipit-source-id: 089840e5272265662cdbf58d88580f9203153b69
2016-09-15 15:43:36 -07:00
Janic Duplessis d0d1712851 Reverted commit D3827366
Summary:
This adds support for sticky headers on Android. The implementation if based primarily on the iOS one (https://github.com/facebook/react-native/blob/master/React/Views/RCTScrollView.m#L272) and adds some stuff that was missing to be able to handle z-index, view clipping, view hierarchy optimization and touch handling properly.

Some notable changes:
- Add `ChildDrawingOrderDelegate` interface to allow changing the `ViewGroup` drawing order using `ViewGroup#getChildDrawingOrder`. This is used to change the content view drawing order to make sure headers are drawn over the other cells. Right now I'm only reversing the drawing order as drawing only the header views last added a lot of complexity especially because of view clipping and I don't think it should cause issues.

- Add `collapsableChildren` prop that works like `collapsable` but applies to every child of the view. This is needed to be able to reference sticky headers by their indices otherwise some subviews can get optimized out and break indexes.
Closes https://github.com/facebook/react-native/pull/9456

Differential Revision: D3827366

Pulled By: fred2028

fbshipit-source-id: d346068734c5b987518794ab23e13914ed13b5c4
2016-09-15 12:13:39 -07:00
Fred Liu b7ee6adade Reverted commit D3870895
Reviewed By: foghina

Differential Revision: D3870895

fbshipit-source-id: 305534c752d1041bf03e27f28d6b5bf0a66a5a61
2016-09-15 11:58:36 -07:00
Andy Street 5c3f9547c6 Unbreak nodes that use ScrollViews
Reviewed By: foghina

Differential Revision: D3870895

fbshipit-source-id: e01130f19cca96ae1bcd0b8040e78552727fd6dc
2016-09-15 11:13:51 -07:00
Andy Street 6f42603d0e Add Dependency Injection, nodes support for RN/Components integration
Reviewed By: lexs, emilsjolander

Differential Revision: D3863226

fbshipit-source-id: f7528a9ff69697dd51fc7f7496a1c46110a42bed
2016-09-15 09:28:46 -07:00