Commit Graph

2845 Commits

Author SHA1 Message Date
rxb dcf245a9a2 Definable distance pagination for ScrollView
Summary: This is an enhancement for ScrollView that adds the ability to paginate based on a width other than the width of the ScrollView itself. This is a fairly common pattern used on apps like Facebook, App Store, and Twitter to scroll through a horizontal set of cards or icons:

![img_8726 2](https://cloud.githubusercontent.com/assets/451050/8017899/39f9f47c-0bd2-11e5-9c1d-889452f20cf7.PNG) ![img_8727 2](https://cloud.githubusercontent.com/assets/451050/8017898/39f962dc-0bd2-11e5-98b4-461ac0f7f21b.PNG)  ![img_8728 2](https://cloud.githubusercontent.com/assets/451050/8017900/39fd91a4-0bd2-11e5-8786-4cf0316295a0.PNG)

After trying to accomplish this only with JS, it appears that attempting to take over an in-progress native scroll animation with JS is always going to result in some amount of jankiness and jumping.

This pull request uses `scrollViewWillEndDragging` in RCTScrollView.m to adjust `targetContentOffset` based on two new optional props added to ScrollView. `snapToInterval` sets the multiple that the
Closes https://github.com/facebook/react-native/pull/1532

Reviewed By: @​svcscm, @​trunkagent

Differential Revision: D2443701

Pulled By: @vjeux
2015-09-23 11:47:25 -07:00
alvaromb b9ef384f74 Updated TouchableHighlight docs
Summary: ``onlyChild`` restriction is implemented in ``TouchableHighlight``, not ``TouchableOpacity``.
Closes https://github.com/facebook/react-native/pull/2542

Reviewed By: @​svcscm

Differential Revision: D2471539

Pulled By: @vjeux
2015-09-23 11:25:34 -07:00
Brent Vatne 118cf51522 Fix PanResponder example code
Summary: Fixes this:

![](http://url.brentvatne.ca/VwLF.png)
Closes https://github.com/facebook/react-native/pull/1464

Reviewed By: @​svcscm

Differential Revision: D2471541

Pulled By: @vjeux
2015-09-23 11:25:27 -07:00
Tadeu Zagallo 1ab650f958 Remove use of const from packager and add systrace internally
Reviewed By: @martinbigio

Differential Revision: D2471270
2015-09-23 10:56:31 -07:00
Amir Rosenfeld da284f6e36 stub Java QPL for OSS
Reviewed By: @mkonicek

Differential Revision: D2470258
2015-09-23 10:30:28 -07:00
Christopher Chedeau 393b6791a8 Delete ResponderExample.js
See https://github.com/facebook/react-native/pull/1743
2015-09-23 10:18:05 -07:00
Justin Spahr-Summers bcd2ef5dfc Improve RCTImageView resizing logic
Summary: @​public

It's less important to reload for downscaling than upscaling, so increase the threshold in that direction. Also, this now considers each dimension separately, and a big enough change either way should result in a reload.

Finally, this considers both the current image size and the inflight target size, so we don't reload if either is already good.

Reviewed By: @tadeuzagallo

Differential Revision: D2470911
2015-09-23 07:32:30 -07:00
Justin Spahr-Summers de85bcab0b Cancel previous calls to -[RCTImageView reloadImage] to prevent extra work
Reviewed By: @tadeuzagallo

Differential Revision: D2470902
2015-09-23 07:32:23 -07:00
Christopher Chedeau 75d0b904b9 Merge pull request #2609 from exponentjs/faster-ci-tests
[Travis] Use Xcode 7 image, remove brew update, install nvm directly
2015-09-23 07:25:20 -07:00
James Ide 3b68869fc8 Add scrollWithoutAnimationTo to Android
Summary: `ScrollView.scrollWithoutAnimationTo` is supported on iOS but not Android. This is an existing API, and this diff adds Android support.

Closes https://github.com/facebook/react-native/pull/2695

Reviewed By: @​svcscm

Differential Revision: D2452630

Pulled By: @mkonicek
2015-09-23 05:58:27 -07:00
Bret Johnson 5b0dd6432a Added a more explicit error message when ndk.dir / ANDROID_NDK is set,
Summary: but the NDK build command can't be found in that directory.   This
more explicit error now shows the full NDK path where it's looking
and (importantly) includes a hint that backslashes need to be escaped
on Windows for ndk.dir.   When I built on Windows the first time,
I didn't realize ndk.dir backslashes needed to be escaped and the
generic "not found" error made the root cause harder to track
down.   This change should help others that build on Windows & run into
the same.
Closes https://github.com/facebook/react-native/pull/2960

Reviewed By: @​svcscm

Differential Revision: D2470761

Pulled By: @kmagiera
2015-09-23 05:57:24 -07:00
James Ide 8a77aa60c3 [Travis] Use Xcode 7 image, remove brew update, install nvm directly
- Uses the Xcode 7 image
- The new image includes xctool 0.2.5 (current)
- Removes the `brew update` command, which needed to fetch a lot of data
- Disables the npm spinner before installing flow-bin
- Uses `$TMPDIR` instead of spinning up Node
2015-09-22 22:41:12 -07:00
Martín Bigio a85884275d Temp dependency should be a dev one
Reviewed By: @vjeux

Differential Revision: D2468639
2015-09-22 18:24:26 -07:00
Amir Rosenfeld 8a638d8e58 move qpl to oss
Reviewed By: @mkonicek

Differential Revision: D2465929
2015-09-22 17:33:28 -07:00
Alex Coco 12a0045412 Fix typo in cloneWithRows comments
Summary: `s/informatoin/information/`
Closes https://github.com/facebook/react-native/pull/2532

Reviewed By: @​svcscm

Differential Revision: D2469067

Pulled By: @vjeux
2015-09-22 17:02:27 -07:00
James Ide b7efd0212f Merge pull request #2937 from unknownexception/patch-2
[Showcase] Add Hashley app
2015-09-22 15:52:12 -07:00
Amjad Masad 45ed000d4b Remove server error listener so that it throws
Summary: @​public
We swallow errors like it's nobody's business :(
Having an error handler that `reject`s after the promise has been resolved is a no-op. In node, if there is no `error` event handler then the error would throw.

So after we start listening and we want to resolve the promise, we remove the error listener so that we make sure errors actually throw.

Finally, I made the `uncaughtError` handler log `error.stack` so we can get an idea of what's going on.

Reviewed By: @martinbigio

Differential Revision: D2468472
2015-09-22 15:48:29 -07:00
Amjad Masad 30cca276fa Return concrete file paths to the client
Reviewed By: @martinbigio

Differential Revision: D2465182
2015-09-22 15:45:25 -07:00
Martín Bigio c4cb95f2d7 Add logging information when client's socket gets closed unexpetedly
Reviewed By: @amasad

Differential Revision: D2468293
2015-09-22 15:21:35 -07:00
Jan Kassens 9486642322 Prop routeMapper of Navigator.NavigationBar is required
Summary: The component will crash if the prop is not provided. This helps with a better
error message in the console output.
Closes https://github.com/facebook/react-native/pull/2894

Reviewed By: @​svcscm

Differential Revision: D2461752

Pulled By: @ericvicenti
2015-09-22 14:44:28 -07:00
Colin Parsons 972ae4c186 fix minor grammar and typo errors in comments
Summary: comments only. no code modified.
Closes https://github.com/facebook/react-native/pull/2038

Reviewed By: @​svcscm

Differential Revision: D2468021

Pulled By: @vjeux
2015-09-22 14:41:28 -07:00
Amjad Masad f39e3fe113 Simplify over-engineered Activity module
Summary: @​public
I've noticed that the logs can be sometimes misleading, as when an Activity ends it doesn't log immediatly. A sync `console.log` would log before it although the Acitivity should've finished before.

Turns out we wait before writing out the logs to the console. I don't see any reason for this. Looking at the `Activity` module it's over-engineered. This diff makes logging sync and simplfies the module.

Reviewed By: @martinbigio

Differential Revision: D2467922
2015-09-22 14:25:37 -07:00
Tamara Woodson 4447bff976 Fix minor grammatical error in documentation
Summary: No code changes; comments/documentation only.
Closes https://github.com/facebook/react-native/pull/2083

Reviewed By: @​svcscm

Differential Revision: D2468024

Pulled By: @vjeux
2015-09-22 14:25:25 -07:00
Christopher Chedeau f7ff980876 Merge pull request #1416 from dalinaum/fix-warning
[Cosmetic] Fix some lint warnings
2015-09-22 14:06:41 -07:00
Christopher Chedeau 48e042378d Merge pull request #2946 from vjeux/fix_animated_docs
Fix website with Animated
2015-09-22 14:00:52 -07:00
Joel Arvidsson 7f76f08a11 Better feature detection for FormData/FileReader/Blob
Summary: This PR bumps fetch to 0.9.0, the latest release and fixes broken feature detection originating in that self is not referring to `window.self` but an empty object. Assigning that object to window.self or GLOBAL won't work in the chrome dev tools because of CORS restrictions. This is a pragmatic solution but maybe not ideal.

Background to the problem can be read here: https://github.com/facebook/react-native/issues/2376
Closes https://github.com/facebook/react-native/pull/2587

Reviewed By: @​trunkagent, @​svcscm

Differential Revision: D2438341

Pulled By: @vjeux
2015-09-22 13:53:24 -07:00
Christopher Chedeau 69a4024c85 Fix lint warnings when adding a new js file
Summary: @​public
When we updated eslint, some of the rules have been renamed and are spamming everytime someone adds a new js file. It turns out that the rules that those have been deprecated to were already present in the current eslint config and enabled, so I just needed to remove them.

Reviewed By: @jingc

Differential Revision: D2467315
2015-09-22 13:05:43 -07:00
Christopher Chedeau 00ceec9def Fix website with Animated
Animated.js has been renamed (and moved) to AnimatedImplementation.js, so we need to update the path and add another translation rule.
2015-09-22 12:54:04 -07:00
Amjad Masad 7806c0875b Log exit code
Reviewed By: @martinbigio

Differential Revision: D2467457
2015-09-22 12:40:25 -07:00
Christoph Pojer cee01bef4f Don't transform node_modules in open source
Summary: We aren't ignoring node_modules so we apply our transform on *all of them*.

See https://github.com/facebook/react-native/pull/2942 and https://github.com/facebook/react-native/issues/2939

@​public

Reviewed By: @vjeux

Differential Revision: D2467324
2015-09-22 12:13:38 -07:00
Christopher Chedeau a50b4ea7b9 Initial web implementation
Summary: @​public

This diff does a couple of things:
- Move all the code in a src/ folder
- Move bezier.js in the Animated folder
- Rename Animated.js into AnimatedImplementation.js and adds two entry points: AnimatedReactNative.js and AnimatedWeb.js
- Implement very dumb polyfills for flattenStyle, Set and InteractionManager
- Import my work in progress demo.html file to make sure that the code is actually working.

Everything is not working correctly:
- It calls forceUpdate on every frame and doesn't use bindings because setNativeProps is not implemented
- None of the style: {transform} are working because React web doesn't know about the array notation for transform
- The demo need more work

Reviewed By: @sahrens

Differential Revision: D2464277
2015-09-22 11:58:37 -07:00
Martin Konicek c45be4d55a Test export to github
Reviewed By: @mkonicek

Differential Revision: D2467343

committer: Service User <svcscm@fb.com>
2015-09-22 11:34:27 -07:00
Yusef Napora 2f9bd1f62f App Extension support
Summary: This adds workarounds for the code that was preventing React from compiling when linked against an iOS App Extension target.

Some iOS APIs are unavailable to App Extensions, and Xcode's static analysis will catch attempts to use methods that have been flagged as unavailable.

React currently uses two APIs that are off limits to extensions: `[UIApplication sharedApplication]` and `[UIAlertView initWith ...]`.

This commit adds a helper function to `RCTUtils.[hm]` called `RCTRunningInAppExtension()`, which returns `YES` if, at runtime, it can be determined that we're running in an app extension (by checking whether the path to `[NSBundle mainBundle]` has the `"appex"` path extension).

It also adds a `RCTSharedApplication()` function, which will return `nil` if running in an App Extension. If running in an App, `RCTSharedApplication()` calls `sharedApplication` by calling `performSelector:` on the `UIApplication` class.  This passes the static analysis check, and, in my opinion, obeys the "spirit of th
Closes https://github.com/facebook/react-native/pull/1895

Reviewed By: @​svcscm

Differential Revision: D2224128

Pulled By: @nicklockwood
2015-09-22 10:46:26 -07:00
Martin Konicek 3f220f6b59 [ReactNative] Export latest Android changes 2015-09-22 18:36:21 +01:00
Martín Bigio 833ca598bc Introduce react native CLI
Reviewed By: @frantic

Differential Revision: D2430522
2015-09-22 09:02:32 -07:00
Dmitry e56ec9da35 Add Hashley app to Showcase 2015-09-22 19:00:51 +05:00
Martin Konicek 71628638f6 Export latest Android changes 2015-09-22 11:15:50 +01:00
Martin Bigio daba14264c Remove `node_modules` dir early fail check
Reviewed By: @vjeux

Differential Revision: D2464127
2015-09-21 17:51:35 -07:00
Martín Bigio 37b5cd45e1 Add `temp` node dependency
Reviewed By: @vjeux

Differential Revision: D2445915
2015-09-21 17:49:37 -07:00
Christoph Pojer 24b0064eae Upgrade jest to 0.5.6
Reviewed By: @vjeux

Differential Revision: D2459297
2015-09-21 14:39:55 -07:00
Christoph Pojer d088750163 Fix tests + enable inline requires on react-native
Reviewed By: @sahrens, @vjeux

Differential Revision: D2456607
2015-09-21 14:39:44 -07:00
Martin Konicek 6b733bdcf1 Minor fixes in comments
Reviewed By: @mkonicek

Differential Revision: D2463595

committer: Service User <svcscm@fb.com>
2015-09-21 14:39:36 -07:00
Martin Bigio 8f5b2ccbe0 Log uncaught exceptions on the socket server
Reviewed By: @frantic

Differential Revision: D2462114
2015-09-21 12:08:29 -07:00
Jason Als f762a55abd Wrong function name
Summary: RippleAndroid is actually Ripple
Closes https://github.com/facebook/react-native/pull/2710

Reviewed By: @​svcscm

Differential Revision: D2452607

Pulled By: @mkonicek
2015-09-21 09:00:34 -07:00
Martin Konicek 86ff767268 [ReactNative] Fix typo in ReactInstanceManager.java 2015-09-21 16:01:52 +01:00
Aaron Chiu e665acca4b pull in github css-layout into fbobjc react native
Reviewed By: @vjeux

Differential Revision: D2448929
2015-09-20 20:35:29 -07:00
Pieter De Baets d94ed42e1c Enable Jest tests
Reviewed By: @amasad

Differential Revision: D2422290
2015-09-20 16:48:35 -07:00
James Ide ddd6fe3fae Merge pull request #2898 from taydakov/patch-1
Fix misspelling
2015-09-20 15:04:04 -07:00
Lev Taydakov ecc79dc6f5 Fix misspelling 2015-09-20 13:48:27 -07:00
James Ide 95b6f88686 Merge pull request #2874 from dgellow/fix-doc-runningondeviceios
fix AppDelegate.m path
2015-09-19 17:14:10 -07:00