Summary: Added support for WebViews to take in an onContentSizeChange prop, which will return a native event that contains the width and height of the html content in the WebView. Also moved the ContentSizeChangeEvent from the recyclerview dir to the uimanager/events dir
Reviewed By: andreicoman11
Differential Revision: D3775399
fbshipit-source-id: 19a0579f8345e5853cc7311b80f1f1393c77ab58
Summary:
The MessageQueue has a _debugInfo object where it stores debug information associated with each callback. The size of this structure is currently unbounded.
It looks like the code attempted to restrict _debugInfo to a fixed number of entries but due to a logic bug, it leaked around 30 entries for every 1 entry it cleaned up.
This change limits the _debugInfo object to around 30 entries.
**Test plan (required)**
This change is currently being used in my team's app.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9611
Differential Revision: D3781875
fbshipit-source-id: 58c645c52c3e295fe571b7ca7e0d882169c301ef
Summary:
This adds cookie clearing support for iOS to match the existing support on Android. Helpful for resetting the app to a clean state (say, when logging a user out).
Closes https://github.com/facebook/react-native/pull/9264
Differential Revision: D3776492
Pulled By: javache
fbshipit-source-id: 59ae19ac09d3cf0d0e229cd9e8e30865e65ca96c
Summary:
This is a revised follow up version from #8574 ( originally implemented in `objc` )
This PR change the implementation in JS suggested by javache
**motivation**
To supports vibration pattern like android.
The [iOS vibration implementation link](http://stackoverflow.com/questions/12966467/are-there-apis-for-custom-vibrations-in-ios/13047464#13047464) mentioned by skv-headless at https://github.com/facebook/react-native/pull/6061#discussion_r54062592, which will not be accepted by apple since that implementation uses a private API. Thus, I use pure public API `NSTimer` to implement it.
**Note**
Since vibration time on iOS is not configurable, there are slightly differences with android.
for example:
**Android Usage:**
`Vibration.vibrate([0, 500, 200, 500])`
==> V(0.5s) --wait(0.2s)--> V(0.5s)
`Vibration.vibrate([300, 500, 200, 500])`
==> --wait(0.3s)--> V(0.5s) --wait(0.2s)--> V(0.5s)
**iOS Usage:**
if first argument is 0, it will not be included in pattern array.
( vibration
Closes https://github.com/facebook/react-native/pull/9233
Differential Revision: D3775085
Pulled By: javache
fbshipit-source-id: 370495857d5581399de32d2bed1ea1bcce193e9d
Summary:
Due to an earlier commit, we now have to use the full path for requiring `performanceNow`.
**Test plan (required)**
Verified that the IncrementalExample works when adding it to UIExplorer.
Closes https://github.com/facebook/react-native/pull/9595
Differential Revision: D3775101
Pulled By: javache
fbshipit-source-id: 6252ce8c872896f4cfdb9a31bdbc79d6aaf4684d
Summary:
This adds support for a controlled `selection` prop on `TextInput` on iOS (Android PR coming soon). This is based on the work by ehd in #2668 which hasn't been updated for a while, kept the original commit and worked on fixing what was missing based on the feedback in the original PR.
What I changed is:
- Make the prop properly controlled by JS
- Add a RCTTextSelection class to map the JS object into and the corresponding RCTConvert category
- Make sure the selection change event is properly triggered when the input is focused
- Cleanup setSelection
- Changed TextInput to use function refs to appease the linter
** Test plan **
Tested using the TextInput selection example in UIExplorer on iOS.
Also tested that it doesn't break Android.
Closes https://github.com/facebook/react-native/pull/8958
Differential Revision: D3771229
Pulled By: javache
fbshipit-source-id: b8ede46b97fb3faf3061bb2dac102160c4b20ce7
Summary:
fontVariant implemented in #9045. Appears to have lost platform annotation. Also fixes indentation.
Closes https://github.com/facebook/react-native/pull/9587
Differential Revision: D3774192
Pulled By: javache
fbshipit-source-id: 9bce0b9c39fa31ef40d01e94b699b1299914b67b
Summary:
Not seeing a hairline thick line is a common source of confusion with a simple cause. Let's warn about it.
Closes https://github.com/facebook/react-native/pull/9589
Differential Revision: D3770879
Pulled By: mkonicek
fbshipit-source-id: f1637e17832982fa8fb9b7f485056c452b38b3db
Summary:
Currently, text inputs do not scroll when inside other components like scroll
views. This fixes it by blocking any parent native component from taking the
responder when the text input is focused and is being scrolled. This fixes the
previous implementation, where the scroll view was not able to scroll on top of
other text inputs, even though they were not focused.
This makes the component similar to it's ios counterpart.
Reviewed By: foghina
Differential Revision: D3735237
fbshipit-source-id: 724f94a6e7332d03261a80f63ffa60d0e5846932
Summary:
This adds a new type of node that clamps an animated value between 2 values with a special twist, it is based on the difference between the previous value so getting far from a bound doesn't matter and as soon as we start getting closer again the value will start changing. The main use case for this node is to create a collapsible navbar when scrolling a scrollview. This is a pretty in apps (fb, youtube, twitter, all use something like this).
It updates using the following: `value = clamp(value + diff, min, max)` where `diff` is the difference with the previous value.
This gives the following output for parameters min = 0, max = 30:
```
in out
0 0
15 15
30 30
100 30
90 20
30 0
50 20
```
One issue I see is that this node is pretty specific to this use case but I can't see another simple way to do this with Animated that can also be offloaded to native easily. I'd be glad to discuss other solutions if some
Closes https://github.com/facebook/react-native/pull/9419
Differential Revision: D3753920
fbshipit-source-id: 40a749d38fd003aab2d3cb5cb8f0535e467d8a2a
Summary: This allows the onLoad callback to know which image has actually loaded. This is only for iOS at the moment - implementing this for Android will require quite a bit more work.
Reviewed By: majak
Differential Revision: D3738759
fbshipit-source-id: b1fc2bd0dc5de90096debeab02b8f795739a4547
Summary:
During development of an app I decided upon NavigationExperimental as I found it easily configurable with my Redux stores and make it work the way I wanted. One thing I found missing was the ability to decide if gestures were on or not for the card stack. In my case I need the gestures off as they conflict with what I am trying to do. This PR simply opens up the ability to turn the gestures for a CardStack off.
Testing was completed via UI Explorer. An additional example replicating the existing one with the new setting set to false was created. To ensure nothing broke I tested both the original example and new example to ensure gestures worked (and didn't work) when expected.
I did not see any unit tests around NavigationExperimental but if I simply missed them I would be more then happy to update/add any.
Closes https://github.com/facebook/react-native/pull/9505
Differential Revision: D3749880
Pulled By: ericvicenti
fbshipit-source-id: dfa42ff8b6c8b41490ad1efc931b364e47058243
Summary:
Currently, text inputs do not scroll when inside other components like scroll
views. This fixes it by blocking any parent native component from taking the
responder when the text input is focused and is being scrolled. This fixes the
previous implementation, where the scroll view was not able to scroll on top of
other text inputs, even though they were not focused.
This makes the component similar to it's ios counterpart.
Reviewed By: foghina
Differential Revision: D3735237
fbshipit-source-id: 0e56b2bbd3f5636540b4c3cc7cc13aa0f4d2737e
Summary: Provide RTL support in NavigationCardStack
Reviewed By: fkgozali
Differential Revision: D3740172
fbshipit-source-id: 69466d24e148d0d81cb9f21c55f545abda46ac35
Summary: Just cleaning the props for android rendering, similar to iOS
Reviewed By: foghina
Differential Revision: D3735324
fbshipit-source-id: aaf222543701409710a2cd217cc580e79f23bf7b
Summary: Add support for `useNativeDriver: true` to `Animated.decay`. Add example in Native Animated Example UIExplorer app.
Reviewed By: ritzau
Differential Revision: D3690127
fbshipit-source-id: eaa5e61293ed174191cec72255ea2677dbaa1757
Summary:
This brings RN up to date with https://github.com/facebook/react/pull/7472 (scheduled for React 15.3.1).
If you use React 15.3.1 with RN without this patch, Systrace output will lack the reconciler events.
(Since it’s a niche feature it didn’t seem to me that full backward compat is necessary so I just removed old hooks. This won’t cause crashes—it’s just you won’t get events in Systrace if you use new React but old RN.)
Closes https://github.com/facebook/react-native/pull/9383
Differential Revision: D3738463
Pulled By: spicyj
fbshipit-source-id: 791cdbc5558666a101fa403f4e7852f700038fc9
Summary:
This fix provides possibility to subscribe to a child animation lifecycle. You'll be able to observe every single animation:
```
Animated.sequence([
Animated.timing(
this.state.scale,
{
toValue: 0,
duration: 300,
onComplete: () => this.setState({someProp: 'new value'})
}
),
Animated.timing(
this.state.scale,
{
toValue: 1,
duration: 300
}
),
]).start();
```
`state.someProp`, will updated with `'new value'` when the first animation will be completed.
Closes https://github.com/facebook/react-native/pull/8494
Reviewed By: javache
Differential Revision: D3735322
Pulled By: foghina
fbshipit-source-id: fb69a4b993f7ab6a16da4fdd670e6c0b11c93517
Summary: Removes the inspector click handler that was stealing the scroll gesture from `ScrollView`. Instead, I've added a "Minimize" button. This also fixes a bug where the `ScrollView` was appearing underneath the button bar (and therefore permanently obscuring the last few lines of the warning).
Reviewed By: jingc
Differential Revision: D3725499
fbshipit-source-id: 1ec0e0ddf5e1e50989e297811a32779e6610c745
Summary:
Assert that the return value of these methods is sane.
Closes https://github.com/facebook/react-native/issues/8108
Reviewed By: majak
Differential Revision: D3722629
fbshipit-source-id: 2a67daae6dc380721e5dad27acd2ab67f71d0c6c
Summary:
`<Text>` accepts more than just string as its children; and it's handy to be able to style nav titles without a proptype warning throwing
Closes https://github.com/facebook/react-native/pull/8338
Differential Revision: D3719045
fbshipit-source-id: a02d181b5e133dbe467fbaca794f0d2119be2da7
Summary:
- Define a Styles type for the object that gets passed into StyleSheet.create
- Define a StyleSheet type that is returned from StyleSheet.create
- Clean up the type declarations in StyleSheet.create
Closes https://github.com/facebook/react-native/pull/8882
Differential Revision: D3587964
Pulled By: gabelevi
fbshipit-source-id: 629e0176484436848be69b1417638e1200a3669a
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?
The Android permissions native module was open sourced recently (b7352b4667) but it is currently undocumented and requires directly interfacing with the native module.
This provides a JS wrapper to make it easier to use the permissions module and documents it.
This could be cleaner if the native code used Promise blocks instead of callbacks, but I didn't want to change the native code without a thumbs up since I'm guessing this is used in one of facebook's apps. Happy to do that if it makes sense
I also tried to make the `PERMISSIONS` object a class property - it works in the actual code but not in the documentation (think it's a jsdocs problem), so decided to initialize in the constructor.
**Test plan (required)**
If the API looks good, I will change the UIExplorer example to use this.
cc andreicoman11
Closes https://github.com/facebook/react-native/pull/9292
Differential Revision: D3716303
Pulled By: andreicoman11
fbshipit-source-id: cd40b8757fdf70ea8faecfb58caa00e99a99789e
Summary:
We only want to call onTransitionEnd after the transition has fully completed, including scene cleanup.
This will help avoid race conditions when we start new navigation after a transition completes.
Reviewed By: fkgozali
Differential Revision: D3712235
fbshipit-source-id: 146f30a0caf3d2fe164285fbef12293b7b161c6e
Summary:
Adds support for `Animated.Value#addListener` for native driven animated values. Same as #8844 but for iOS. This depends on some JS code in #8844 so only review the 2nd commit and let's wait for #8844 to land first.
**Test plan**
Tested using the UIExplorer example.
Closes https://github.com/facebook/react-native/pull/9194
Differential Revision: D3681749
fbshipit-source-id: 521a61e2221c1ad1f6f40c75dd2dc957361d0271