Commit Graph

1055 Commits

Author SHA1 Message Date
Bhuwan Khattar d82f2553fb Replace @provides with @providesModule
Reviewed By: davidaurelio

Differential Revision: D4494624

fbshipit-source-id: 192cc77126a99b3a3baeb806ed605c2194c4713a
2017-02-02 08:58:33 -08:00
Marc Horowitz 81b2d69575 Fork UIExplorer.xcodeproj into UIExplorerCxx.xcodeproj
Reviewed By: javache

Differential Revision: D4434102

fbshipit-source-id: 45e128e7d985b58c04dda14f8e692051a552a491
2017-02-01 14:14:33 -08:00
Satyajit Sahoo 295a0150d4 Support customizing thumb, track and progress colors for slider on Android
Summary:
**Motivation**

Ability to customize slider colors is desirable to match the brand. Currently iOS allows using images for slider parts, but android doesn't have any customization options. This PR adds support for customizing `thumbTintColor`, `trackTintColor` and `progressTintColor`.

**Test plan (required)**

Run UIExplorer example with the changes and verify everything works fine.

![image](https://cloud.githubusercontent.com/assets/1174278/22020752/f32a6eec-dcdf-11e6-928d-481bb28bd0a3.png)

cc brentvatne
Closes https://github.com/facebook/react-native/pull/11946

Differential Revision: D4427474

fbshipit-source-id: ec3a38db600bac6108691a4cfa15e2409143b9f3
2017-02-01 00:43:29 -08:00
Valentin Shergin d1990f8fc4 Better (right) implementation of `intrinsicContentSize`
Reviewed By: emilsjolander

Differential Revision: D4486767

fbshipit-source-id: d37ea11f9f48425d4d99c29e8bfb6c8ed2353f04
2017-01-31 16:58:32 -08:00
Satyajit Sahoo 31099aa233 Support tintColor and thumbTintColor for Switch on Android
Summary:
**Motivation**

`Switch` on Android doesn't allow changing the colors unlike iOS. Changing the colors is desirable in a lot of cases to match the brand colors.

The PR adds support for the `tintColor`, `onTintColor` and `thumbTintColor` props on Android, which more or less behave the same as iOS. The only difference is `tintColor` styles the border color on iOS, whereas it styles the background color on Android.

**Test plan (required)**

Run UIExplorer with the changes, and ensure that the switch example works properly. Here are screenshots from iOS and Android to compare.

![image](https://cloud.githubusercontent.com/assets/1174278/22018002/b05d6482-dcd2-11e6-9c00-f55a71d6ce29.png)

![image](https://cloud.githubusercontent.com/assets/1174278/22018012/b923e974-dcd2-11e6-8d4e-86994f5a66e6.png)

cc brentvatne
Closes https://github.com/facebook/react-native/pull/11940

Differential Revision: D4427491

fbshipit-source-id: 16c569d2e2261daaea93fffa83198f8f6b59a6c8
2017-01-31 13:43:43 -08:00
Peter W 1beb6274b8 Clarify ActionSheetIOSExample.js
Summary:
The `successCallback` passed via `static showShareActionSheetWithOptions(options, failureCallback, successCallback)` has two parameters (see [native code](e1577df1fd/Libraries/ActionSheetIOS/RCTActionSheetManager.m (L174))), and the name used for the first parameter in the JS example is confusing. This fixes that.

The first parameter is a boolean indicating whether the user completed the sharing (when TRUE) or cancelled it (when FALSE). Instead of calling it "success" in the example, I propose using `completed`, which is more in line with what you see in the native code.

Otherwise, we have a "successCallback" function whose first parameter tells us if we were "successful", and that's confusing (indeed, I think it already caused some confusion in the [react-native-share](https://github.com/EstebanFuentealba/react-native-share/) module: see [this issue](https://github.com/EstebanFuentealba/react-native-share/issues/48)).
Closes https://github.com/facebook/react-native/pull/11914

Differential Revision: D4490039

Pulled By: mkonicek

fbshipit-source-id: 5d7f01eae760e3fb271e7fa080c2f0147c53418a
2017-01-31 13:28:32 -08:00
Sokovikov 412acd237a fix gratuitous app crash
Summary:
Now it fails

<img src="https://cloud.githubusercontent.com/assets/1488195/22402686/1bb46f5a-e61a-11e6-9c4a-7b01e7f89508.gif" width="300"/>

**Test plan (required)**
UIExplorer
Closes https://github.com/facebook/react-native/pull/12110

Differential Revision: D4480641

fbshipit-source-id: c9941e9cc2f0624c7120cfb17a3534c92207bf7a
2017-01-29 12:43:27 -08:00
Andrei Coman 9f10b85e10 Fix UIExplorer for android getting in a broken state
Summary:
If you have a new example that you add to the UIExplorer, enter the example, but
then change the name of the example or remove it, the explorer enters a
completely broken state. It remembers the name of the last module entered and
keeps trying to enter it. Reloading, refreshing, nothing will work until you
completely reinstall the app.
This fixes this by not trying to render the current module if it doesn't exist.
It will simply skip it.

Reviewed By: yungsters

Differential Revision: D4475088

fbshipit-source-id: d4a530b235aa2712d663377e33fe65091163d262
2017-01-29 04:13:27 -08:00
Janic Duplessis 850c71c2f3 Remove usages of RecyclerViewBackedScrollView in UIExplorer and NetworkOverlay
Summary:
RecyclerViewBackedScrollView was deprecated, this removes usages in Examples as well as in NetworkOverlay.

**Test plan**
Tested that RecyclerViewBackedScrollView deprecation warning doesn't show up anymore.
Closes https://github.com/facebook/react-native/pull/11999

Differential Revision: D4443707

Pulled By: hramos

fbshipit-source-id: 087afc9f183b3f2087965a2fe84301f422e48e9c
2017-01-28 10:43:35 -08:00
Martin Konicek 9dee696ed8 Add scrollToEnd to ScrollView and ListView
Summary:
**Motivation**

A basic task of making a React Native ScrollView or ListView scroll to the bottom is currently very hard to accomplish:
- https://github.com/facebook/react-native/issues/8003
- https://github.com/facebook/react-native/issues/913
- http://stackoverflow.com/questions/29829375/how-to-scroll-to-bottom-in-react-native-listview

**NOTE:** If you're building something like a chat app where you want a ListView to keep scrolling to the bottom at all times, it's easiest to use the [react-native-invertible-scrollview](https://github.com/exponent/react-native-invertible-scroll-view) component rather calling `scrollToEnd` manually when layout changes. The invertible-scrollview uses a clever trick to invert the direction of the ScrollView.

This pull request adds a `scrollToEnd` method which scrolls to the bottom if the ScrollView is vertical, to the right if the ScrollView is horizontal.

The implementation is based on this SO answer:
http://stackoverflow.com/questions/952412/uiscrollview-scrol
Closes https://github.com/facebook/react-native/pull/12088

Differential Revision: D4474974

Pulled By: mkonicek

fbshipit-source-id: 6ecf8b3435f47dd3a31e2fd5be6859062711c233
2017-01-27 10:13:29 -08:00
Ryan Gomba 7e869b9d0a Drive any numerical prop via NativeAnimated
Summary:
In theory, we should be able to animate any non-layout property, including custom ones. While there is still work to be done on the native side to fully enable this, we should start by dropping the prop whitelist.
Closes https://github.com/facebook/react-native/pull/10658

Differential Revision: D4379031

Pulled By: ericvicenti

fbshipit-source-id: fe9c30ea101e93a8b260d7d09a909fafbb82fee6
2017-01-26 18:28:53 -08:00
Pieter De Baets 0fc62eebc3 Revert D4450924: Expose StatusBar height on iOS
Differential Revision: D4450924

fbshipit-source-id: a883a7417e85f0a923d5fcc4d5efff75b99c2272
2017-01-25 17:59:30 -08:00
Mathieu Acthernoene eebfd33b70 Expose StatusBar height on iOS
Summary:
Following the PR https://github.com/facebook/react-native/pull/6195, this adds a `HEIGHT` constant on `StatusBar` for iOS.

Combined with `statusBarFrameDidChange` and `statusBarFrameWillChange` StatusBar native events, it solves various problems with In-Call cellar bar / Location bar / others 40pt status bars, and offers a correct `keyboardVerticalOffset` value for the KeyboardAvoidingView component.
Closes https://github.com/facebook/react-native/pull/12041

Differential Revision: D4450924

Pulled By: hramos

fbshipit-source-id: 664798260f4226140f3fa3f9222a415a305d0d78
2017-01-23 12:58:34 -08:00
Philipp von Weitershausen 16bb6e87ba XHR: support typed arrays for request payloads
Summary:
Support `xhr.send(data)` for typed arrays.

**Test plan:** run UIExplorer example on iOS and Android.
Closes https://github.com/facebook/react-native/pull/11904

Differential Revision: D4425551

fbshipit-source-id: 065ab5873407a406ca4a831068ab138606c3361b
2017-01-20 18:43:27 -08:00
Luke Miles 577fd0cbb9 Fix typo for messaging test in webview example
Summary:
Simple fix for a typo in the webview examples.
Closes https://github.com/facebook/react-native/pull/11794

Differential Revision: D4393755

fbshipit-source-id: 43939c4f6eaede51a0e3948181eb58132ba84191
2017-01-20 13:58:27 -08:00
Fred Liu 8f5a72de8e Remove listener
Reviewed By: hedgerwang

Differential Revision: D4440698

fbshipit-source-id: 24a4a42aa6ca4c5f62df3ab9c1f3f37ea632f153
2017-01-19 22:28:27 -08:00
yueshuaijie 94f71a3884 Add one more parameter(keyboardType) to AlertIOS.promot().
Summary:
Add one more parameter which can specify the keyboard type of first text input(if exists) to AlertIOS.prompt().

Example usage:
`AlertIOS.prompt('Type a phone number', null, null, 'plain-text', undefined, 'phone-pad')`
Closes https://github.com/facebook/react-native/pull/8781

Differential Revision: D4437900

Pulled By: hramos

fbshipit-source-id: 8141cc0d7c70d13603cd5a1d5ea3f1ab1ce437a6
2017-01-19 14:43:37 -08:00
Satyajit Sahoo 72be2d35cc Add selectionColor prop for Text on Android
Summary:
**Motivation**

Customizing the selection color allows to use brand colors in the app. The PR implements a `selectionColor` prop for `Text` component similar to `TextInput`.

**Test plan (required)**

Run UIExplorer example with the changes and verify everything works fine.

![image](https://cloud.githubusercontent.com/assets/1174278/22023258/70197d84-dceb-11e6-8662-2879d78d14d4.png)

cc brentvatne
Closes https://github.com/facebook/react-native/pull/11947

Differential Revision: D4430265

fbshipit-source-id: 462f16548d93ab03aadb27d6f12acf90842627ab
2017-01-18 12:58:44 -08:00
Peter Salanki 52d8851fc8 Cache policy control for image source
Summary:
In the context of an app an image exists in three resolutions on the server: `thumb` (30px) `feed` (300px) `full` (900px). When looking at an individual item a user can come either from the feed, via a permalink or from other parts of the app. This allows a situation where the `feed` image might or might not already be loaded somewhere in the app. In the detail view I want to render `thumb` with a blur (to quickly display something), then the `feed` image if it exists to have something decent to display until `full` loads. However it is quite a waste to load the `feed` image if it isn't already in cache, and will slow down the time until `full` is loaded. It is possible to track the navigation from feed->detail and that the `feed` image has actually completed loading by the feed component however as component hierarchies grow this turns into quite a lot of prop passing and bad separation of concerns.

NSURLRequests accepts a [Cache Policy](https://developer.apple.com/reference/fo
Closes https://github.com/facebook/react-native/pull/10844

Differential Revision: D4425959

Pulled By: lacker

fbshipit-source-id: 679835439c761a2fc894f56eb6d744c036cf0b49
2017-01-17 17:13:31 -08:00
Douglas Lowder a531efe26e Add an integration test for WebSocket
Summary:
**Motivation**

See if we can safely run a WebSocket test in Travis CI
Closes https://github.com/facebook/react-native/pull/11433

Differential Revision: D4342024

Pulled By: ericvicenti

fbshipit-source-id: 137fb0c39ed7ea3726e2778d5c0bdac4cef6ab89
2017-01-16 13:28:43 -08:00
Philipp von Weitershausen 3c806652cf Consolidate XHR UIExplorer examples
Summary:
The XHRExample file had been forked between iOS and Android for various reasons that are no longer valid, making maintenance unnecessarily difficult. New features demos had in fact been added in separate files to avoid further duplication. This change continues on that same trajectory and splits the entire example file into multiple files. This makes them much easier to handle. We also get rid of the iOS/Android fork.

**Test plan:** Run UIExplorer app, specifically the XHR examples, on both iOS and Android.
Closes https://github.com/facebook/react-native/pull/11901

Differential Revision: D4419882

Pulled By: ericvicenti

fbshipit-source-id: ec12836dfa8e1b9259b92a7510914857a8db58d5
2017-01-14 18:58:26 -08:00
Michael Lee 55f0294b7d clean up buck dep order
Reviewed By: adamjernst

Differential Revision: D4404770

fbshipit-source-id: d5801cc2b529f513e1531840310b884af951d702
2017-01-11 14:43:31 -08:00
Emil Sjolander 3f49e743be Add percentage support to react native
Summary:
Adds support for percentage value in react native.

syntax: property: 100 | property | '100%'

supported properties:
padding
margin
width
height
minWidth
minHeight
maxWidth
maxHeight
flexBasis

```
class Playground extends React.Component {
  render() {
    return (
      <View style={{backgroundColor: 'white', padding: 10, paddingTop: 30, height: '100%'}}>
        <Text>
          If you want to quickly test out something,
          open the Playground.js file and start coding.
        </Text>
        <View style={{backgroundColor: 'red', height: 50, width: 50}}/>
        <View style={{backgroundColor: 'blue', height: '50%', width: '50%'}}/>
      </View>
    );
  }
}
```

Reviewed By: astreet

Differential Revision: D4376549

fbshipit-source-id: c41d68a7555396f95d063a7527ee081773ac56dc
2017-01-11 03:58:37 -08:00
Timur Gibadullin 6e2595e8ee Fix TicTacToe example layout
Summary:
I noticed that after starting a new game the board is not correctly layouted:

![-08-2017 21-39-21](https://cloud.githubusercontent.com/assets/3778452/21752532/06afc648-d5eb-11e6-9f8a-ccdad00d3a6f.gif)

Maybe this bug was introduced after the change of flex behaviour in 0.36.
Just replacing empty view with null fixed it.

**Test plan (required)**

 - launch the TicTacToe app
 - complete a round
 - press on new game

 a new board should be centred both vertically and horizontally
Closes https://github.com/facebook/react-native/pull/11775

Differential Revision: D4392024

Pulled By: ericvicenti

fbshipit-source-id: d2742d6ecafd786c38212adeb3c952f18a0e6f2b
2017-01-09 00:28:37 -08:00
Luke Miles da9a712a9e Add a injectJavaScript method to the WebView component
Summary:
Currently, < WebView > allows you to pass JS to execute within the view. This works great, but there currently is not a way to execute JS after the page is loaded. We needed this for our app.

We noticed that the WebView had messaging support added (see #9762) . Initially, this seemed like more than enough functionality for our use case - just write a function that's injected on initial load that accepts a message with JS, and `eval()` it. However, this broke once we realized that Content Security Policy can block the use of eval on pages. The native methods iOS provide to inject JS allow you to inject JS without CSP interfering. So, we just wrapped the native methods on iOS (and later Android) and it worked for our use case. The method injectJavaScript was born.

Now, after I wrote this code, I realized that #8798 exists and hadn't been merged because of a lack of tests. I commend what was done in #8798 as it sorely solves a problem (injecting JS after the initial load) and has more features than what I'
Closes https://github.com/facebook/react-native/pull/11358

Differential Revision: D4390425

fbshipit-source-id: 02813127f8cf60fd84229cb26eeea7f8922d03b3
2017-01-06 20:29:02 -08:00
Buchi Anora 588004b417 Update DatePickerAndroidExample.js
Summary:
updated this.state to reflect the different date type options in the DatePickerAndroid components.
Closes https://github.com/facebook/react-native/pull/11600

Differential Revision: D4376621

Pulled By: ericvicenti

fbshipit-source-id: 6802d346c200870e9b3de766c9e575c7d9f7e6df
2017-01-02 11:28:25 -08:00
Lukas Woehrl 16359ec8ee Add feature to use percentage as value unit
Summary:
Adds the feature to use percentage as a value unit.

You can use the function ```YGPx(float)``` and ```YGPercent(float)``` for convenience.

I did some benchmarks:

```
Without Percentage Feature - Release x86:

Stack with flex: median: 0.000000 ms, stddev: 0.146683 ms
Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.136525 ms
Nested flex: median: 0.000000 ms, stddev: 0.490101 ms
Huge nested layout: median: 23.000000 ms, stddev: 0.928291 ms

Stack with flex: median: 0.000000 ms, stddev: 0.170587 ms
Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.143384 ms
Nested flex: median: 0.000000 ms, stddev: 0.477791 ms
Huge nested layout: median: 22.000000 ms, stddev: 2.129779 ms

With Percentage Feature - Release x86:

Stack with flex: median: 0.000000 ms, stddev: 0.132951 ms
Align stretch in undefined axis: median: 0.000000 ms, stddev: 0.136525 ms
Nested flex: median: 0.000000 ms, stddev: 0.489570 ms
Huge nested layout: median: 21.000000 ms, stddev: 1.390476 ms
Closes https://github.com/facebook/yoga/pull/258

Reviewed By: dshahidehpour

Differential Revision: D4361945

Pulled By: emilsjolander

fbshipit-source-id: a8f5bc63ad352eb9410d792729e56664468cd76a
2017-01-02 05:28:30 -08:00
Pieter De Baets c92ad5f6ae Apple TV support 4: support for input (tvOS focus engine)
Reviewed By: shergin

Differential Revision: D4333546

fbshipit-source-id: 8655070e81dbb62a80ab1f00a43ef6c2d9654618
2016-12-19 06:28:40 -08:00
John Shelley 901178d53c BREAKING: Android - ReactNativeHost getUseDeveloperSupport to public #2
Summary:
AaaChiuuu
See: https://github.com/facebook/react-native/pull/11329
Closes https://github.com/facebook/react-native/pull/11505

Differential Revision: D4338559

Pulled By: AaaChiuuu

fbshipit-source-id: 6cd1fd366a2bc30d496b7e907242e7f89a384a19
2016-12-15 21:13:38 -08:00
Maxime Lapointe d56530d7d5 Reworking keyboardShouldPersistTaps to have a middle ground
Summary:
Right now, the ScrollView's keyboard hiding behavior is either all or nothing: Hide the keyboard on any tap, or do nothing ever. This PR introduces a third mode to keyboardShouldPersistTaps which is much closer to what I consider should be the default.

In the new behavior, the tap responding is done in the bubbling phase (instead of the capture phase like =true). As a result, a child can handle the tap. If no child does, then the ScrollView will receive the tap and will hide the keyboard. As a result, changing TextInput focus works as a user expects, with a single tap and without keyboard hiding. But taping on Text or on the empty part of the ScrollView hides the keyboard and removes the focus.

You can view the behavior in a monkey patched ScrollView demo on rnplay:
https://rnplay.org/apps/E90UYw
https://rnplay.org/apps/UGzhKA

In order to have a uniform props set, i added 3 values to the keyboardShouldPersistTaps:
'never' and 'always' are the same as false and true.
'handled' is the new behavior.

I don't
Closes https://github.com/facebook/react-native/pull/10628

Differential Revision: D4294945

Pulled By: ericvicenti

fbshipit-source-id: 1a753014156cac1a23fabfa8e1faa9a768868ef2
2016-12-07 21:43:35 -08:00
Pieter De Baets 59407f3660 Redo exported headers and include paths for opensource
Summary:
Xcode really sucks, per some discussion on e1577df1fd and https://developer.apple.com/library/content/technotes/tn2215/_index.html, if you use the headers phase, and mark headers in your static library as public, they will actually end up in the final package that's built and you can't submit to the app store! This changes our xcode setup to use a copy files phase instead.

I've also changed the header include path to be $(BUILT_PRODUCTS_DIR)/include, which is added to the include path by Xcode by default, so 3rd party libraries should not be impacted by these changes anymore.

Reviewed By: mkonicek

Differential Revision: D4291607

fbshipit-source-id: 969b9ebcbeb8161f85427f8c429e198d9d0fae30
2016-12-07 15:28:29 -08:00
Emil Sjolander 7f8c2985a8 Rename directories
Reviewed By: gkassabli

Differential Revision: D4284681

fbshipit-source-id: f0c6855c2c6e4389b7867f48f72cbb697830fc5a
2016-12-07 05:14:12 -08:00
Emil Sjolander 85ac5fc354 Rename C api
Differential Revision: D4259190

fbshipit-source-id: 26c8b356ca464d4304f5f9dc4192bff10cea2dc9
2016-12-03 04:44:10 -08:00
Ben Clayton 833961e05d <Text> Expose Android's includeFontPadding property to JavaScript.
Summary:
By default Android will put extra space above text to allow for upper-case accents or other ascenders. With some fonts, this can make text look slightly misaligned when centered vertically.

We have found that the effect is very noticeable with certain custom fonts on Android. On iOS the font aligns vertically as expected.

Android exposes a property `includeFontPadding` that will remove this extra padding if set to false. This PR exposes that to JS, and adds it to the documentation and UIExplorer.
Closes https://github.com/facebook/react-native/pull/9323

Differential Revision: D4266713

Pulled By: lacker

fbshipit-source-id: f9711254bc26c09b4586a865f0e95ef4bf77cf3f
2016-12-02 12:58:36 -08:00
Emil Sjolander 779508c0ba Rename enums
Differential Revision: D4244360

fbshipit-source-id: c9fcbdd231098c9ff230a6055676bbc7cbd11001
2016-12-02 05:58:45 -08:00
Don Yu 946913e9fa Add in UI Explorer example for showing annotation callouts by default in <MapView>
Reviewed By: martinbigio

Differential Revision: D4253281

fbshipit-source-id: b4bd9fedf7042d3d43d2a50bdb7474caa875781f
2016-12-01 08:58:34 -08:00
Pieter De Baets 81c8a3f2ea Fix headers for UIExplorerUnitTests
Reviewed By: davidaurelio

Differential Revision: D4258382

fbshipit-source-id: 0538deb409e9dc000a5a339d6d0c76302b52c8d5
2016-12-01 07:13:33 -08:00
Vojta Bartos abf1438f54 fixing shake to open Dev Menu only work once
Summary:
Fixing issues https://github.com/facebook/react-native/issues/10588

This bug has been introduced during refactoring UIActionSheet to UIAlertController d368ebfab2 (diff-f78a84ff95f2bcee5a70d3accb504528)

**Test plan**

- shake to open DevMenu, choose random menu item, it should close DevMenu and after another shaking it should open again
Closes https://github.com/facebook/react-native/pull/10676

Differential Revision: D4168254

Pulled By: javache

fbshipit-source-id: 6e2935b765053a2b55809af357d2b6ea03e04e8b
2016-11-29 13:43:31 -08:00
Sokovikov 837814240b unselectedItemTintColor property available since iOS10
Summary:
**motivation:**

make possible to use new tab bar property.

![1475603157804](https://cloud.githubusercontent.com/assets/1488195/19085757/8b7cc8a4-8a7c-11e6-82c7-7c76313fb545.jpg)

It is not working for previous versions but not failing.
https://developer.apple.com/reference/uikit/uitabbar/1648949-unselecteditemtintcolor
Closes https://github.com/facebook/react-native/pull/10241

Differential Revision: D4168046

Pulled By: mmmulani

fbshipit-source-id: aa0c9b36cbdbc50a9a60bbbc658355c3066ba1a5
2016-11-29 12:28:55 -08:00
Sokovikov a50bafa678 badgeColor property
Summary:
**motivation:**

make possible to use new tab bar item property

![1476033023249](https://cloud.githubusercontent.com/assets/1488195/19222245/f4c1292c-8e64-11e6-8a29-7b95b45e153c.jpg)
Closes https://github.com/facebook/react-native/pull/10315

Differential Revision: D4000011

Pulled By: mmmulani

fbshipit-source-id: 5c00b0b5f56c551cc4151fcc030da6c8bc1a3649
2016-11-29 11:43:31 -08:00
Connor McEwen 51efaab120 Handle "Never Ask Again" in permissions and add requestMultiplePermissions
Summary:
In order to get featured in the Google Play Store, we had to handle a few specific cases with permissions based on feedback from the editorial team.

First, which was previously possible with this permissions module was bumping the sdk to version 23.

The second is requesting multiple permissions at one time. In order for the camera + upload to work, we needed to request both camera permissions + media storage in one flow.

The last is handling the case where the user checks the "Never Ask Again" box. This will only appear after a user denies a permission once and is then prompted again. The logic for handling this case is taken from here: http://stackoverflow.com/questions/31928868/how-do-we-distinguish-never-asked-from-stop-asking-in-android-ms-runtime-permis/35495372#35495372

We were also seeing a few crashes similar to #10009 due to `onRequestPermissionsResult` being called before `onResume` (http://stackoverflow.com/questions/35205643/why-is-onresume-called-after-onrequestpermissionsresult), so I delaye
Closes https://github.com/facebook/react-native/pull/10221

Differential Revision: D4232551

fbshipit-source-id: fee698d1c48a2d86623cb87996f3d17f4c10a62e
2016-11-24 22:43:28 -08:00
Pieter De Baets 439092742a Fix imports in UIExplorerUnitTests
Reviewed By: bestander

Differential Revision: D4231271

fbshipit-source-id: 84f903f6b14256ed1958ad1800f128133590a3dc
2016-11-24 09:58:31 -08:00
Pieter De Baets f2a46b17d4 Replace RCTJSCWrapper with JSCWrapper from ReactCommon
Reviewed By: mhorowitz

Differential Revision: D4204516

fbshipit-source-id: 6bcb122daf2848035dfae404ee7a2e9aca0f8087
2016-11-23 11:43:48 -08:00
Pieter De Baets e1577df1fd Move all header imports to "<React/..>"
Summary:
To make React Native play nicely with our internal build infrastructure we need to properly namespace all of our header includes.

Where previously you could do `#import "RCTBridge.h"`, you must now write this as `#import <React/RCTBridge.h>`. If your xcode project still has a custom header include path, both variants will likely continue to work, but for new projects, we're defaulting the header include path to `$(BUILT_PRODUCTS_DIR)/usr/local/include`, where the React and CSSLayout targets will copy a subset of headers too. To make Xcode copy headers phase work properly, you may need to add React as an explicit dependency to your app's scheme and disable "parallelize build".

Reviewed By: mmmulani

Differential Revision: D4213120

fbshipit-source-id: 84a32a4b250c27699e6795f43584f13d594a9a82
2016-11-23 07:58:39 -08:00
Pandiarajan Nagarajan eaccd7e82e Android datepicker mode configurations added
Summary:
Currently, The **DatePickerAndroid** component opens the native date picker with default mode. We can't able to change the mode via configurations. To support android **[date-picker mode](https://developer.android.com/reference/android/widget/DatePicker.html)**, existing component needs to be changed.

**For Android >= 5.0**, The DatePickerDialog doesn't provide the default method to change the mode of a date picker.  So I have added custom theme which will support two kinds of **mode('spinner','calendar')** ref:https://developer.android.com/reference/android/R.attr.html#datePickerStyle.

**For Android < 5.0,** The DatePickerDialog provides the default method to change the mode of a date picker. ref:https://developer.android.com/reference/android/widget/DatePicker.html#setCalendarViewShown(boolean).

With the help of **Build.VERSION.SDK_INT** I have done the above functionality with limited lines of code changes and also I have added the example to UIExplorer.

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

Differential Revision: D4176089

Pulled By: ericvicenti

fbshipit-source-id: 7dfa9101214501ac2124bda7ee273a538f04e7cf
2016-11-23 04:58:31 -08:00
Alex Kotliarskyi 22141468ab Kill require('image!...')
Reviewed By: yungsters

Differential Revision: D4179964

fbshipit-source-id: e56ee7814e23a3afc6223527f1afefe51a9e0aec
2016-11-22 21:13:52 -08:00
Alex Kotliarskyi cab88104a3 Cleanup before image! codemod
Reviewed By: fkgozali

Differential Revision: D4196297

fbshipit-source-id: 5c32646dfe858f34c185a917e7d081a60777f242
2016-11-22 21:13:52 -08:00
Andy Street ec467fbd34 Fix tic-tac-toe example is OSS
Summary: flex: 1 is no longer correct

Reviewed By: emilsjolander

Differential Revision: D4182840

fbshipit-source-id: 912119c09d887d545a28d2855c5583f1d8d7c93e
2016-11-21 09:58:32 -08:00
Pieter De Baets 7c91f894ba Fix CSSLayout import hack, update podspec
Summary: Correct header import paths, update podspec so we point at the copy in ReactCommon (and can eventually remove the copy under React)

Reviewed By: astreet

Differential Revision: D4204501

fbshipit-source-id: e979a010092f025b2cdc289e1e5f22fc7b65a8d1
2016-11-21 09:13:36 -08:00
Tim Yung 23331df5a4 RN: Cleanup OSS JS & Flow Declarations
Reviewed By: vjeux

Differential Revision: D4210763

fbshipit-source-id: 5abaa547100b8badd13bcf311ceffc5b4098d252
2016-11-20 17:58:29 -08:00