Commit Graph

269 Commits

Author SHA1 Message Date
Yuta Okazaki 75ed1dd49e Fix typo of function name in ListView documentation
Summary:
When I read documents, I usually 'search within page' to see where they talk about specific things.
So I found this fix to be pretty useful. Hope it'll be merged!
Closes https://github.com/facebook/react-native/pull/1146
Github Author: Yuta Okazaki <s04155yo@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-14 09:52:19 -08:00
Eric Vicenti 4b5385b2f0 [ReactNative] Fix Navigator resetTo race condition
Summary:
SetState can be somewhat racy. By the time the route state finishes, another resetTo has already happened, so the origional route is no longer in the stack. Hence the redbox invariant "Calling pop to route for a route that doesn't exist!"

This could also be fixed in product code by not calling resetTo rapidly, but the navigator should be resilient to such shenanigans

@public

Test Plan: Cannot get AdsManager crash t7031976
2015-05-13 12:17:31 -08:00
Ben Alpert a0440daf98 [react-native] Codemod .getNodeHandle, .getNativeNode to React.findNodeHandle 2015-05-13 13:24:37 -07:00
Logan Bernard 2ed2d20dfe FloatFromLeft animation
Summary:
float from left animation for Navigator.SceneConfigs

#1100
@ericvicenti
@ide
Closes https://github.com/facebook/react-native/pull/1249
Github Author: Logan Bernard <bernard.logan4@gmail.com>

@public

Test Plan: Video: https://drive.google.com/file/d/0B9HtmABaCcR0Zi1yNkl5UDhWbzg/view
2015-05-13 13:24:37 -07:00
James Ide 6a699302c8 [Navigator] Pass route into onItemRef
Summary:
The index alone isn't so useful; pass the route as well. (I am using this to implement componentWill/DidFocus in a library instead of onWill/DidFocus; #1153).

Closes https://github.com/facebook/react-native/pull/1154
Github Author: James Ide <ide@jameside.com>

@public

Test Plan:  Set up a navigator with a couple of scenes, and see that when onItemRef is called for each one, the route is passed in as the third argument.
2015-05-13 13:24:37 -07:00
Eric Vicenti 1a68585990 [ReactNative] Navigator fix rapid gesture breakage
Summary:
When gesturing rapidly between scenes, the navigator can get into an unresponsive state. A few minor fixes can avoid that case

@public

Test Plan: Rapid gestures on iOS device and simulator can no longer get into bad state
2015-05-13 13:24:36 -07:00
Eric Vicenti 02d875869a [ReactNative] Fix Navigator empty scene issue
Summary:
In some situations, when quickly swiping back to a scene we are transitioning from, the scene is blank/missing. This is fixed by adding a check for the active gesture when we hide the scenes.

@public

Test Plan: Can no longer reproduce on simulator when quickly swiping back to the scene we are transitioning from
2015-05-13 13:24:36 -07:00
Eric Vicenti aa19232609 [ReactNative] Fix case where scenes are not reset on gesture detaching
Summary:
Sometimes, when quicly backing out of a gesture, the scene isn't fully reset to the middle position and remains offset by a few pixels. This makes sure that never happens.

@public

Test Plan: Tested on iOS and I can no longer see the scenes stop when backing out of a gesture
2015-05-13 13:24:35 -07:00
Eric Vicenti a852227279 [ReactNative] Improve Navigator start gesture logic
Summary:
Previously it was possible for a gesture to be granted initiated if the start direction is not respected before the gesture detection distance gets reached, if the gesture direction is met eventually. This change ensures the gesture gets started in the right direction, otherwise the gesture action will set the responder.

@public

Test Plan: Fixes left-right swiping issue in AdsManager when a vertical swipe is intended.
2015-05-13 13:24:35 -07:00
Eric Vicenti 40e3f6ea8c [ReactNative] Navigator initialRoute default change
Summary:
The default initialRoute was the first route, but it makes more sense for the default initialRoute to be the last route in the initialRouteStack.

Updated the docs to reflect that.

@public

Test Plan: Updated call sites and checked that they work. Not many places use initialRouteStack yet.
2015-05-06 11:18:55 -08:00
Eric Vicenti 86cfcbc77e [ReactNative] Navigator fix opacity reset for presented scene
Summary:
jumpN will call enableScene for the dest scene, which makes sure the scene can be made visible, but we need to avoid resetting the opacity for it when it is already the presented scene. There is already a check to make sure we don't reset opacity for the transitioningFrom scene.

@public

Test Plan: Fixes the issue on Android device when jumping to a scene that is already presented
2015-05-05 14:30:29 -08:00
jmstout 929b2999c4 Fix a bug in the Navigator's gesture.edgeHitWidth implementation
Summary:
Should resolve #1081

cc @ericvicenti
Closes https://github.com/facebook/react-native/pull/1082
Github Author: jmstout <git@jmstout.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.

Revert Plan: This seems legit, but I'm not qualified to review.
2015-05-05 06:26:51 -08:00
Eric Vicenti 50de4a67b0 [ReactNative] Navigator use flattenStyle
Summary:
A hack was implemented in Navigator to do this manually, but there is a proper function to get these styles for setting native props

@public

Test Plan: Testing Navigator behavior on iOS and Android
2015-05-04 14:33:25 -08:00
Eric Vicenti 548a0a6a4f [ReactNative] Fix Navigator scene hiding logic
Summary:
Scenes with 0 opacity are being rendered on top of other scenes with full absolute positioning. On iOS this is fine, because the platform will not send touch events to a view with no opacity. On Android is poses a problem because the view on top, even with no opacity, is catching the touch events for the presented scene below.

This change enhances the scene enabling and hiding logic, has better naming, and improves the documentation of it.

@public

Test Plan: Tested transitions and gestures in slow motion on iOS and Android
2015-05-04 08:54:19 -08:00
Eric Vicenti c0d77dbe9c [ReactNative] Navigator pop specify route to pop
Summary:
Now you can pass a route to the pop function in the navigator context, and the Navigator will pop that scene off the stack and every scene that follows.

This changes the request API that bubbles up to the top-level navigator. The `pop` request had previously taken a route for `popToRoute`, but that is a more obscure use case. This makes the request API more closely match the context method naming.

@public

Test Plan: Verified this works by popping several routes in AdsManager. Experimented with UIExplorer Navigator example to make sure popToRoute still works as expected
2015-05-01 18:11:13 -08:00
Eric Vicenti 28e6e993c6 [ReactNative] Navigator focus handler context fix 2015-05-01 17:01:58 -08:00
Eric Vicenti 5453be2ab2 [ReactNative] Fix touch issue caused by D2036644 after swiping back 2015-05-01 16:15:28 -08:00
Eric Vicenti 6abf37b47e [ReactNative] Navigator.Interceptor handler arg fix 2015-05-01 14:20:09 -08:00
Eric Vicenti 76dc14684d [ReactNative] Navigator block touches to non-active scenes
Summary:
When tapping a link quickly, it will cause two scenes to be pushed on. This prevents against that case by swallowing touches for all non-active scenes.

@public

Test Plan: Can no longer double-push scenes
2015-04-30 15:49:37 -08:00
Eric Vicenti 08ec846176 [ReactNative] Fix logic in popToRoute 2015-04-29 20:52:32 -08:00
Andy Street c82c6a07ae [react_native] JS files from D2027859: [react_native] Fix ToTheLeft wizard transitions 2015-04-29 04:49:43 -08:00
Eric Vicenti 349f8b942a [ReactNative] Avoid Navigator invariant in edge case
Summary:
It is very rare, but sometimes there is no active gesture when the responder gets released. This will avoid a redbox in that case

@public

Test Plan: Saw the redbox. No longer see the redbox. Hardcoded missing activeGesture while responder and verified no redbox
2015-04-28 23:53:39 -08:00
Eric Vicenti 9209c444c7 [ReactNative] Androidized Navigator animations
Summary:
Added configurations for android-like animations, with gestures disabled.

@public

Test Plan: Tested on AdsManager Android
2015-04-28 13:10:49 -08:00
Eric Vicenti 8afdf30363 [ReactNative] Navigator refactor and improvements 2015-04-27 21:37:33 -08:00
Eric Vicenti ec3d70e738 [ReactNative] Quiet Navigator context warning 2015-04-27 17:31:12 -08:00
Eric Vicenti 6749f88650 [ReactNative] Fix Navigator resetTo 2015-04-27 17:18:52 -08:00
Eric Vicenti 36afc46274 [ReactNative] Fix for Navigator.replacePreviousAndPop 2015-04-23 14:19:44 -08:00
Eric Vicenti 7aa413d619 [ReactNative] Fix Android back btn regression from D2010265 2015-04-22 10:06:10 -08:00
Eric Vicenti 40eeaf5b37 [ReactNative] Navigator contextual popToRoute and imperitive vs contextual docs 2015-04-21 13:27:44 -08:00
Eric Vicenti 45c10ffc53 [ReactNative] Navigator touch grant bug from D2001635 2015-04-21 11:26:53 -08:00
Andy Street b0348edcae [react_native] JS files from D2001635: [react_native] Use hardware layers during adsmanager Navigator navigation 2015-04-21 04:10:52 -08:00
Philipp von Weitershausen dbe8e31c20 [ReactNative][Navigator] Remove another unnecessary use of absolute screen width 2015-04-17 15:02:48 -08:00
Eric Vicenti e382894ef3 [ReactNative] Navigator fix BackAndroid warning on iOS 2015-04-16 10:28:19 -08:00
Eric Vicenti b3a2d6c574 [ReactNative] Navigator initially render all scenes 2015-04-16 10:19:52 -08:00
Eric Vicenti 699a9c3e0c [ReactNative] Fix focusing of nested Navigators 2015-04-10 17:58:30 -08:00
Eric Vicenti 75d52b0f33 [ReactNative] Avoid navigator scene renders during transition 2015-04-10 15:13:00 -08:00
Eric Vicenti 50959dd42c [AdsManager|ReactNative] Switch to contextual request pop instead of parentNavigator 2015-04-10 12:54:07 -08:00
Eric Vicenti 839e533955 [ReactNative] Re-configure horizontal swipe animations 2015-04-08 21:13:32 -08:00
Philipp von Weitershausen ae76d3982b [MAdMan] Dimensions.get('window') considered harmful 2015-04-08 18:08:23 -08:00
Josh Levine be46ccf4c4 Navigator: Changed transitioner background color to 'transparent'
Summary:
... for setting the transition background color between scenes. For issue #563
Closes https://github.com/facebook/react-native/pull/654
Github Author: Josh Levine <josh.levine1@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-08 16:37:26 -08:00
Eric Vicenti 009f8ebe63 [ReactNative] Fix typo/bug in Navigator._completeTransition 2015-04-07 20:35:33 -08:00
Eric Vicenti d63bf428cd [ReactNative] Fix Navigator exception when touching during transition 2015-04-07 19:54:34 -08:00
Eric Vicenti ccbd656070 [AdsManager] Correct back button functionality 2015-04-07 16:07:43 -08:00
Eric Vicenti 31b6ff6d1a [ReactNative] Replace Backstack with BackAndroid 2015-04-07 16:07:42 -08:00
Kureev Alexey 8a8244a583 navigator.getCurrentRoutes()
Summary:
According to our talk with @ericvicenti about `renderScene` arguments
Closes https://github.com/facebook/react-native/pull/553
Github Author: Kureev Alexey <kureev-mail@ya.ru>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-04 10:58:44 -08:00
Peter Janak de8a370e02 Fixing jsdoc parsing of functions that are defined over multiple lines (Fixes #410)
Summary:
As it was implemented, the jsdoc parser would look only the first non-blank line immediately preceding a function declaration. However, the line that was set as the beginning of a function declaration was where the opening bracket (`{`) was. This is insufficient for functions whose definitions span multiple lines. For example, this declaration would not find the comments above it:

```
/**
 * Clones rows
 **/
cloneWithRows(
       dataBlob: Array<any> | {[key: string]: any},
       rowIdentities: ?Array<string>
   ): ListViewDataSource {
...
}
```

With this change, the parser will first check if we have a closing parenthesis. If we do and don't have a matching open parenthesis we continue moving up the lines until we find it. Then we set previous line to be the line before that, the true beginning of the function declaration.
Closes https://github.com/facebook/react-native/pull/360
Github Author: Peter Janak <pjanak@nhl.com>

Test Plan: Run the website
2015-04-04 09:56:16 -08:00
Eric Vicenti 34ed3a0cec [ReactNative] Start Navigator gesture config, disable gesture in AdsManager 2015-04-03 14:11:32 -08:00
Andy Street 3de7ad6c33 [react_native] JS files from D1955639: [react_native] Update AnimationsDebugModule to output more accurate FPS info 2015-04-01 08:13:53 -08:00
Eric Vicenti 5a6bf00223 [ReactNative] Rename NavigationBar props 2015-04-01 07:43:22 -08:00
Cspeisman 50dc709f01 missing '.' in ListView.DataSource example
Summary:
The `ListView.DataSource` example is missing a period. Previously looked like a method i.e.` ListViewDataSource`
Closes https://github.com/facebook/react-native/pull/520
Github Author: Cspeisman <Cspeisman@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-03-31 10:06:09 -08:00
Philipp von Weitershausen db693f32a9 [ReactNative] Clean up no longer needed reference to NavigationBarClass 2015-03-30 18:33:06 -08:00
Philipp von Weitershausen a9167a29b7 [ReactNative] PropTypes for NavigationBars 2015-03-30 14:36:25 -08:00
Nick Lockwood 961f301d65 Renamed throttleScrollCallbackMS to scrollEventThrottle 2015-03-30 04:56:59 -08:00
Tadeu Zagallo 932e600205 [ReactNative][Docs] Remove references to ReactNavigator from docs 2015-03-26 13:53:26 -08:00
Philipp von Weitershausen bdd170568c [ReactNative][MAdMan] Clean up after D1942269 2015-03-26 10:18:39 -08:00
Tadeu Zagallo 921da23e22 [ReactNative][CustomComponents] Update old headers 2015-03-26 09:12:48 -08:00
Eric Vicenti f9c1a9357a [ReactNative] Navigator docs 2015-03-26 00:34:15 -08:00
Eric Vicenti 5b8aad5fdc [ReactNative] License headers and renaming 2015-03-26 00:34:14 -08:00
Tadeu Zagallo 558b8c65e0 [ReactNative] s/ReactNavigator/Navigator/ 2015-03-25 20:20:57 -08:00
Philipp von Weitershausen ea570844f9 [MAdMan][Android] Make things look more Androidy 2015-03-25 13:05:18 -08:00
Eric Vicenti 7311260e58 [ReactNative] Rename JSNavigationStack to ReactNavigator, rename scene config 2015-03-24 19:27:59 -08:00
Eric Vicenti d71bfa104d [ReactNative] JSNavigationStack - Use key to blow away old scenes 2015-03-24 17:58:43 -08:00
Eric Vicenti eb16bb4dfd [ReactNative] Fix OSS Dependency Issues 2015-03-24 16:15:23 -08:00
Eric Vicenti 9b03bec662 [ReactNative] rename navigationOperations to navigator 2015-03-24 15:28:36 -08:00
Eric Vicenti 23094dbfc3 [ReactNative] JSNavigationStack rename routeMapper to renderSceneForRoute 2015-03-24 11:48:42 -08:00
Tadeu Zagallo 57ee9e7dc0 [ReactNative] Use oss TimerMixin 2015-03-24 10:46:05 -08:00
Eric Vicenti c9a40a989b [ReactNative] OSS JSNavigationStack w/ Examples 2015-03-24 09:39:40 -08:00
Christopher Chedeau e1ef0328d9 [ReactNative] Expanded license on js files 2015-03-23 13:17:54 -08:00
Christopher Chedeau ac804244a6 [ReactNative] Add Custom Components folder 2015-03-20 09:19:28 -08:00