Граф коммитов

4698 Коммитов

Автор SHA1 Сообщение Дата
Joshua Gross 57afad1c1f RCTCameraRollManager: fix "all" photos filter
Summary: Currently, trying to fetch "all" photos will loop and never complete. Now it appears to produce the expected results (acting like the "All Photos" smart library in Photos) and doesn't loop. Confirmed console log results, showing no loops: P60994983

Reviewed By: PeteTheHeat

Differential Revision: D14221545

fbshipit-source-id: 31381b1ba2c673fd210cb95f3b7d0f8ffc23ec3f
2019-02-26 11:29:56 -08:00
zhongwuzw f3ad49be67 Fixed placeholder font not consistent with text's font when in multiline mode (#23654)
Summary:
Placeholder's font not consistent with text's font, it leads to cursor dislocation. We need to keep consistent between placeholder and text.

[iOS] [Fixed] - Fixed placeholder font not consistent with text's font when in multiline mode
Pull Request resolved: https://github.com/facebook/react-native/pull/23654

Differential Revision: D14226174

Pulled By: hramos

fbshipit-source-id: 7cfb3b73d8799d22d5cbbfe557df8de3f5fcf034
2019-02-26 09:36:45 -08:00
zhongwuzw 06c6c7c673 Remove compatible system code for iOS8 and before (#23656)
Summary:
We already only support `iOS9+`, so we can remove all compatible codes now.

[iOS] [Fixed] - Remove compatible system code for iOS8 and before
Pull Request resolved: https://github.com/facebook/react-native/pull/23656

Differential Revision: D14224986

Pulled By: hramos

fbshipit-source-id: cac9ffe6788dd3eaf4f4f5f2b219f325ba78e85f
2019-02-26 07:58:52 -08:00
Masayuki Iwai 58c956768a Update _scrollAnimatedValue offset of ScrollViews. (#19481)
Summary:
`_scrollAnimatedValue` offset of ScrollView is set once in `UNSAFE_componentWillMount` but it is never updated.
It causes unexpected render result.

![rn-scrollview-fix1](https://user-images.githubusercontent.com/143255/40640292-61843eca-6350-11e8-9412-f5383ea65ea0.gif)

So I suggest to update `_scrollAnimatedValue` offset when ScrollView contentInset is updated.
Pull Request resolved: https://github.com/facebook/react-native/pull/19481

Differential Revision: D14223304

Pulled By: cpojer

fbshipit-source-id: 4191cfcf6414adf3a0abd156517d5f9778565671
2019-02-26 01:42:28 -08:00
Christoph Nakazawa 14d9b2d68d Remove ListView and SwipeableListView from React Native
Summary:
This diff removes ListView and SwipeableListView from React Native:
* Removes the code and all examples
* Removes the exports on `react-native-implementation` but leaves an error message in dev mode only
* Uses `deprecated-react-native-listview` for `ListView` and `deprecated-react-native-swipeable-listview` for `SwipeableListView`

Both ListView and SwipeableListView are now fully removed from React Native in open source and we will continue to use the deprecated packages internally.

Reviewed By: TheSavior

Differential Revision: D14181708

fbshipit-source-id: 5030c33791f998567de058fee934449c16fa1d54
2019-02-25 22:40:10 -08:00
zhongwuzw 9ac219e077 fix getter of result from Image query cache (#23602)
Summary:
We assume `map` is the type of `Map`, but actually it's not, so we would get type error.

[iOS] [Fixed] - [RNTester] fix getter of result from Image query cache
Pull Request resolved: https://github.com/facebook/react-native/pull/23602

Differential Revision: D14221747

Pulled By: cpojer

fbshipit-source-id: 06cf08078a330e4d5731ad72010c87e9e69fcd7b
2019-02-25 20:34:44 -08:00
Albert Sun 24b9889fb2 Location (iOS): Call back on requests only if they pass age and accuracy filters
Summary:
iOS pretty much always immediately updates location with the last cached location. This leads to the getCurrentPosition() API often returning this stale location. This change adds filtering to keep waiting until CLLocationManager provides a location fix that passes the requirements for each pending request.

This is potentially breaking in that clients that rely upon getCurrentPosition being extremely fast may find that location fixes take longer than before. However in such cases they should relax their requirements for maximumAge and/or accuracy.

Reviewed By: mmmulani

Differential Revision: D13889626

fbshipit-source-id: f566314ed5968151dad0839b99e0d3c9a562af13
2019-02-25 14:21:36 -08:00
Spencer Ahrens ea54ceca13 basic useNativeDriver functionality
Summary:
Not super clean, but not terrible.

Unfortunately this still relies on the old Paper UIManager calling delegate methods to flush the operations queues. This will work for Marketplace You since Paper will be active, but we need to fix this, along with Animated Events which don't work at all yet.

Random aside: it seems like taps are less responsive in fabric vs. paper, at least on iOS. There is a sporadic delay between the touches event coming in nativly to the JS callback invoking the native module function to start the animation - this will need some debugging.

Reviewed By: shergin

Differential Revision: D14143331

fbshipit-source-id: 63a17eaafa1217d77a532a2716d9f886a96fae59
2019-02-25 12:25:34 -08:00
Pim de Witte 7c4dbd617d Prop to disable the default pan responder on ScrollView that blocks touches when snapToInterval is enabled (#19110)
Summary:
The ScrollView component seems to have been written for a default touch up / touch down scrolling behavior. However, when using snapToInterval, this default behavior of adding PanResponders while the ScrollView is animating or has an active touch causes bugs with the PanResponder hijacking touches it is not supposed to hijack.
Pull Request resolved: https://github.com/facebook/react-native/pull/19110

Differential Revision: D14071342

Pulled By: hramos

fbshipit-source-id: ac285d9967dd6e2a347943b2455d4f986062ef62
2019-02-25 12:14:19 -08:00
ericlewis fd3db03427 Update openUrl (#23640)
Summary:
Fix deprecation with openUrl, handles feedback in #17011.

[iOS] [Fixed] - openUrl deprecation
Pull Request resolved: https://github.com/facebook/react-native/pull/23640

Differential Revision: D14211015

Pulled By: hramos

fbshipit-source-id: 9c8fa9f61aaa14542af9456dc39f6bfabd6a1405
2019-02-25 11:42:18 -08:00
ericlewis cd7cc7d640 Fix deadstore in RCTSpringAnimation (#23643)
Summary:
Fixes an unused storage of variable.

[iOS] [Fixed] - Fix deadstore in RCTSpringAnimation
Pull Request resolved: https://github.com/facebook/react-native/pull/23643

Differential Revision: D14211089

Pulled By: hramos

fbshipit-source-id: 640d46be25f03d766698f6e85490c7d1a6a019fc
2019-02-25 11:36:56 -08:00
ericlewis b758d63bc9 Fix image scaling (#23641)
Summary:
An updated version of: #22009, this compares the correct image size.

[iOS] [Fixed] - Compare network image sizes correctly
Pull Request resolved: https://github.com/facebook/react-native/pull/23641

Differential Revision: D14210991

Pulled By: hramos

fbshipit-source-id: 079053ef4a8f0e62da6eead9afc8de9285b35966
2019-02-25 11:31:55 -08:00
Takeru Chuganji b664dfdae3 iOS: Resolve a build warning for 32bit devices (#19416)
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

This PR resolves a warning `Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')` when building not only this library **but also apps** for 32bit devices since it's declared in public header file.
Pull Request resolved: https://github.com/facebook/react-native/pull/19416

Differential Revision: D14206633

Pulled By: cpojer

fbshipit-source-id: a65a4774235fa7fb24fac2f9bf7e51ba2a027377
2019-02-25 00:07:51 -08:00
zhongwuzw 7a7eb11965 Fix textAttributes not applied when typing text (#23585)
Summary:
Currently, if we has `defaultValue`, textAttributes like `letterSpacing` can works, but if textinput has not default text, when we typing the text, some attributes not applied.

[iOS] [Fixed] - Fix textAttributes not applied when typing text
Pull Request resolved: https://github.com/facebook/react-native/pull/23585

Differential Revision: D14206568

Pulled By: cpojer

fbshipit-source-id: 7db276d811684bf6e01f8d30287cca80095db87c
2019-02-24 23:37:41 -08:00
zhongwuzw 5bc9c9b014 Add Image query cache result type (#23608)
Summary:
In iOS, seems we have no ways to check wether the cached item is from disk or memory, only `storagePolicy == NSURLCacheStorageAllowedInMemoryOnly ` we can think it's from memory. So we need to add a new result like `disk/memory`?

[iOS] [Added] - Add Image query cache result type
Pull Request resolved: https://github.com/facebook/react-native/pull/23608

Differential Revision: D14205902

Pulled By: cpojer

fbshipit-source-id: 29c253878b5c6776cd4776508e24c57e6bfa7dfa
2019-02-24 21:59:50 -08:00
Peter Argany e38be82dfa Revert of [D13948951]Apply the fix for CJK languages on single-line test fields.
Summary:
This PR (https://github.com/facebook/react-native/pull/22546) broke single line text inputs. After inputting some text and tapping away, the text input reverts back to default text.

Revert solved the issue.

Reviewed By: cpojer

Differential Revision: D14185897

fbshipit-source-id: cc7f0f2ebfb0494062afbc628c4fe27ad27fb1c6
2019-02-22 11:00:07 -08:00
Eric Lewis 8ce3c1b43e Toggle secureTextEntry cursor spacing (#23524)
Summary:
This is a fix for #5859, based on the feedback in #18587. Instead of using `didSetProps` it uses a setter. I will also note that setting to `nil` no longer works (crashes) so setting it to a blank string then back to the original works fine.

[iOS] [Fixed] - Toggling secureTextEntry correctly places cursor.
Pull Request resolved: https://github.com/facebook/react-native/pull/23524

Differential Revision: D14143028

Pulled By: cpojer

fbshipit-source-id: 5f3203d56b1329eb7359465f8ab50eb4f4fa5507
2019-02-21 23:51:16 -08:00
ericlewis 9d817751b3 Fix RNTester warnings (#23584)
Summary:
Part of #22609. This brings the warning count down to 0 for the RNTester target, also adds a fancy new icon!

[General] [Fixed] - All RNTester warnings fixed
Pull Request resolved: https://github.com/facebook/react-native/pull/23584

Differential Revision: D14181197

Pulled By: cpojer

fbshipit-source-id: 4377a55cee6a2d87a7926f1c34663b8a070aef88
2019-02-21 23:17:37 -08:00
zhongwuzw d834197746 Fix build error warning of Text module (#23586)
Summary:
Throw error warning when build Text module, we can add tvOS available check to remove error.

[iOS] [Fixed] - Fix build error warning of Text module
Pull Request resolved: https://github.com/facebook/react-native/pull/23586

Differential Revision: D14181198

Pulled By: cpojer

fbshipit-source-id: 6a62c831ba119ddcbc6effa0b24f22bd4588b982
2019-02-21 23:12:39 -08:00
Vojtech Novak 976f4be457 support checkbox tinting (#18300)
Summary:
RN offers checkbox component on android: https://facebook.github.io/react-native/docs/checkbox.html

The Checkbox colors for checked and unchecked states cannot be controlled from JS at the moment; this PR adds support for that.

The essence of changing colors for the states is this:

```
ColorStateList cls = new ColorStateList(
        new int[][] {
                new int[] { -android.R.attr.state_checked }, // unchecked
                new int[] {  android.R.attr.state_checked }  // checked
        },
        new int[] {
                uncheckedColor,
                checkedColor
        }
);
checkBox.setSupportButtonTintList(cls);
```

Because of this, I did it so that both colors have to provided together in an object. This is similar to [switch](https://facebook.github.io/react-native/docs/switch#trackcolor)
Pull Request resolved: https://github.com/facebook/react-native/pull/18300

Differential Revision: D14180218

Pulled By: cpojer

fbshipit-source-id: 88a9d1faf061c0651e3e28950f697535b90fbfd4
2019-02-21 20:16:14 -08:00
Kevin Gozali 8b7a0c2a9b Created spec for SegmentFetcher native module
Summary: [General] [Added] - Simply adding spec for better enforcement of types.

Reviewed By: cpojer

Differential Revision: D14177690

fbshipit-source-id: ab4c112d1bd65fef7e37b4c1d6c44055f5576936
2019-02-21 20:10:30 -08:00
Ville Immonen 2321b3fd7f Split React.podspec into separate podspecs for each Xcode project (#23559)
Summary:
This PR implements the first part of [RFC0004: CocoaPods Support Improvements](353d44f649/proposals/0004-cocoapods-support-improvements.md), splitting the `React.podspec` into separate podspecs to more closely match the structure of Xcode projects.

The new structure aims to have one to one mapping between Xcode projects and podspecs. The only places where we differ from this mapping are:
* `React/React-DevSupport.podspec`: `DevSupport` is a part of `React.xcodeproj`, which corresponds to the `React-Core` pod. However, we can't include it in the `React-Core` pod because `DevSupport` depends on `React-RCTWebSocket`, which depends on `React-Core`. Pods may not have circular dependencies.
* The new pods under `ReactCommon/` don't have a corresponding `xcodeproj` because there are no `xcodproj` files in `ReactCommon/`. Those C++ modules are included in `React.xcodeproj`.

*Next steps (not in scope of this PR):*
- Start submitting the Podspecs to CocoaPods on a deploy (or turn the React Native repo into a spec repo): this is important in order to make the experience nicer for library consumers, so that it's not necessary to specify the local path of each Podspec in `Podfile`, you can just add `pod 'React', <version>`.
- Add `Podfile` to the default project template (I have a PR ready for this, but because of bugs related to subspecs, it's blocked on this PR)

[iOS] [Changed] - Split React.podspec into separate podspecs for each Xcode project
Pull Request resolved: https://github.com/facebook/react-native/pull/23559

Differential Revision: D14179326

Pulled By: cpojer

fbshipit-source-id: 397a9c30b6b5d24f86c790057c71f0d403f56c3d
2019-02-21 18:35:44 -08:00
Joshua Gross 286abc5d08 Enable profile builds by adding ObjC annotations
Summary: Currently xcode fails profile builds since these variables are unused when asserts are disabled.

Reviewed By: PeteTheHeat

Differential Revision: D14160565

fbshipit-source-id: 997352dd148d23c28fa92d4171071c1abbb742f5
2019-02-21 12:40:38 -08:00
Grégoire Rit c416b40542 Add setNextFocus support (#22082)
Summary:
Add properties to be able to set the nextFocus. It can be very useful with Android TV.

New android View properties :

* nextFocusDown binded to [setNextFocusDownId](https://developer.android.com/reference/android/view/View.html#setNextFocusDownId(int))
* nextFocusForward binded to [setNextFocusForwardId](https://developer.android.com/reference/android/view/View.html#setNextFocusForwardId(int))
* nextFocusLeft binded to [setNextFocusLeftId](https://developer.android.com/reference/android/view/View.html#setNextFocusLeftId(int))
* nextFocusRight binded to [setNextFocusRightId](https://developer.android.com/reference/android/view/View.html#setNextFocusRightId(int))
* nextFocusUp binded to [setNextFocusUpId](https://developer.android.com/reference/android/view/View.html#setNextFocusUpId(int))

Can be used to fix :

* Fixes #20593
* Fixes #20100

Same PR as #22080 but accorded to changes on master
Pull Request resolved: https://github.com/facebook/react-native/pull/22082

Differential Revision: D14162740

Pulled By: cpojer

fbshipit-source-id: 9a13a185d4e8307ce67014fb076c62d135c487c3
2019-02-20 23:37:35 -08:00
alanfoster c06473ab46 Update network inspector to have smarter scroll stickiness (#21952)
Summary:
When making use of the network inspector on a react-native app, it can be quite annoying that as new requests come in the network inspector instantly sticks to the bottom.

This PR makes this logic smarter by allowing the user to be scrolled away from the bottom by two rows to override this automatic scrolling to the bottom logic.
Pull Request resolved: https://github.com/facebook/react-native/pull/21952

Differential Revision: D14162762

Pulled By: cpojer

fbshipit-source-id: ad49858509dd74a817ebabab54fdacc99773bf22
2019-02-20 21:51:29 -08:00
Evan Bacon 104b1f9367 Add HMRLoadingView module for web target (#23389)
Summary:
* Added a default value for HMRLoadingView this will prevent errors from being thrown when `HMRClient` attempts to include it in a `web` context.

* [Web] [Added] - HMRLoadingView
Pull Request resolved: https://github.com/facebook/react-native/pull/23389

Differential Revision: D14045475

Pulled By: cpojer

fbshipit-source-id: df5c3cf3536af3b37eaf82342b6346bc25054319
2019-02-20 18:22:44 -08:00
Levi Buzolic a89fe4165c Map TextInput textContentType strings to Objective-C constants (#22611)
Summary:
This is an updated version of #22579 which uses compile conditionals to prevent `use of undeclared identifier` errors when compiling on older versions of Xcode.

--------

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue #22578 has more detail examples/explanation.
Pull Request resolved: https://github.com/facebook/react-native/pull/22611

Differential Revision: D13460949

Pulled By: cpojer

fbshipit-source-id: e6d1108422b850ebc3aea05693ed05118b77b5de
2019-02-19 23:52:40 -08:00
Eric Lewis 35b6f866f1 helpful error on canOpenURL for missing scheme (#23535)
Summary:
iOS 9 introduced a whitelist for schemes that apps are allowed to open / check against, the current behavior of React Native is to simple return `NO` when a scheme is missing from that whitelist. It would be more helpful to throw an error with a suggested fix for the problem:
```
Unable to open URL: asos://checkout, add asos to LSApplicationQueriesSchemes in Info.plist.
```

[iOS] [Changed] - canOpenURL throws when custom scheme isn't in LSApplicationQueriesSchemes.
Pull Request resolved: https://github.com/facebook/react-native/pull/23535

Differential Revision: D14143005

Pulled By: cpojer

fbshipit-source-id: 4ead5f073690e627b4a4bbe3fa5a6cb5af46b589
2019-02-19 22:16:01 -08:00
zhongwuzw f8b52151eb Fixed textInput appearance not update when text attributes changed (#23533)
Summary:
If we change the text attributes dynamically, for example, change the textColor, it not works in iOS, Android works fine.

[iOS] [fixed] - Fixed textInput appearance not update when text attributes changed
Pull Request resolved: https://github.com/facebook/react-native/pull/23533

Differential Revision: D14146700

Pulled By: cpojer

fbshipit-source-id: 4a7c84d6e7f818acb712242bea6484b177a775c6
2019-02-19 22:02:20 -08:00
jsfu f08c94bd36 fix the TextInput can't control input length when value's length > maxLength (#23545)
Summary:
I found the TextInput can't control input length when default value's length > maxLength.
for example:
1.Set the value in special cases
```
<TextInput value={'12345678'} maxLength={6}/>
```
2.Quickly press the keyboard with multiple fingers

```
// RCTBaseTextInputView.m
……
if (_maxLength) {
    NSUInteger allowedLength = _maxLength.integerValue - backedTextInputView.attributedText.string.length + range.length;
    if (text.length > allowedLength) {
……
```
when value's length > maxLength,the allowedLength not a negative number.it was transformed into a big number,because it is type NSUInteger.so the `text.length > allowedLength` always false.

[iOS][Fixed] - fix the TextInput can't control input length when value's length > maxLength
Pull Request resolved: https://github.com/facebook/react-native/pull/23545

Differential Revision: D14146581

Pulled By: cpojer

fbshipit-source-id: f53b1312ae55fad9fc10430ab94784c1a9ad4723
2019-02-19 21:41:07 -08:00
zhongwuzw f8276805ca Add ImageIO nullable check in Image module (#23544)
Summary:
Add ImageIO nullable check in Image module to prevent crash.

[iOS] [Fixed] - Add ImageIO nullable check in Image module
Pull Request resolved: https://github.com/facebook/react-native/pull/23544

Differential Revision: D14146483

Pulled By: cpojer

fbshipit-source-id: 813caebea1e24d5e282b21cc50240ec1886339d5
2019-02-19 21:22:37 -08:00
Laurin Quast 3e4d353d2c feat(permissions-android): export Rationale type and add missing properties according to docs (#23510)
Summary:
I checked the documentation over at https://facebook.github.io/react-native/docs/permissionsandroid and the documented properties `buttonPositive`, `buttonNegative` and `buttonNeutral` are not available in the flow-type definitions.

___

Also the Rationale type is not exported which makes it hard to reuse it in a library or in your own application code.

However I do not know if it is actually intended to import "internal" flow-types from `react-native` since I could not find any other type or interface being exported. So I am not 100% sure if I should have done this.

[General] [Added] - Export Rationale flow-type and add missing properties `buttonPositive`, `buttonNegative` and `buttonNeutral` to the documentation.
Pull Request resolved: https://github.com/facebook/react-native/pull/23510

Differential Revision: D14123848

Pulled By: cpojer

fbshipit-source-id: 4040590932db645da6422d680246fed1d46dbe79
2019-02-18 07:04:58 -08:00
James Munro 794da6a4e4 Remove SnapshotViewIOS from public interface (#23497)
Summary:
Part of Lean Core #23313

Removes `SnapshotViewIOS` from the public RN interface.

I think there's a wider discussion to be had here about whether `RCTTest` should be part of the public distribution or at least whether this should be split into a separate utils package. It's mainly used by the RNTester app. It seems to be little known about but there are [some references to it online](https://blog.callstack.io/testing-your-react-native-apps-abfe41903dfd).

[iOS] [Removed] - `SnapshotViewIOS` is no longer publicly exported from RN
Pull Request resolved: https://github.com/facebook/react-native/pull/23497

Differential Revision: D14123280

Pulled By: cpojer

fbshipit-source-id: badaf6cb5d2195268f0f8b429fc11d6525747708
2019-02-18 04:04:23 -08:00
zhongwuzw f95876ba8c Remove android initialAppState fallback check (#23487)
Summary:
1. We expose the `initialAppState` for Android in #19935, so we can remove the fallback check for Android.
2. Rename `RCTCurrentAppBackgroundState` to `RCTCurrentAppState`, it's a private file function, so it's safe to rename, `RCTCurrentAppState` is more suitable because we actually get app state, not app background state.

[Android] [Enhancement] - Remove android `initialAppState` fallback check.
Pull Request resolved: https://github.com/facebook/react-native/pull/23487

Differential Revision: D14121293

Pulled By: cpojer

fbshipit-source-id: fec196cef2969fe6f6f1571f4ebcafcec26266a1
2019-02-17 15:32:13 -08:00
Vishwesh Jainkuniya 9126add6b9 Add prop to configure `importantForAutofill`. (#22763)
Summary:
In API 26, autofill framework was introduced in Android.
Read more about Autofill at https://developer.android.com/guide/topics/text/autofill.

Now, if in case for some text input if developer wants to disable
autofill then he can take help from this `importantForAutoFill` prop
and pass `no` to it.

Also important of auto fill can be configured with this prop, like:
* `auto`: Let the Android System use its heuristics to determine if the view is important for autofill.
* `no`: This view isn't important for autofill.
* `noExcludeDescendants`: This view and its children aren't important for autofill.
* `yes`: This view is important for autofill.
* `yesExcludeDescendants`: This view is important for autofill, but its children aren't important for autofill.

Default value if `auto`.

Read more at: https://developer.android.com/guide/topics/text/autofill-optimize

Changelog:
----------
[Android] [Added] - Add prop to configure `importantForAutofill` in `TextInput`.
Pull Request resolved: https://github.com/facebook/react-native/pull/22763

Differential Revision: D14121242

Pulled By: cpojer

fbshipit-source-id: aa4360480dd19f6dde66f0409d26a41a6a318c94
2019-02-17 14:33:37 -08:00
Daniel Sainati 8da1f1149f deploy 0.93
Summary:
upgrades flow version

allow-large-files
bypass-lint

Reviewed By: nmote

Differential Revision: D14095305

fbshipit-source-id: 000b3b2e085f673bc443fc8bc1b3aae1b42df0e9
2019-02-15 12:04:32 -08:00
Cassio Zen f15145639d Add autoComplete prop (#21575)
Summary:
TL;DR: Setting `autoComplete` will allow the system to suggest autofill options for the `<TextInput>` component.

Android Oreo introduced the AutoFill Framework, for secure communication between an app and autofill services (e.g. Password managers). When using `<TextInput>` on Android Oreo+, the system already tries to autofill (based on heuristics), but there is no way to set configuring options or disable.

The quick solution would be to just add the same Android attributes (`autofillHints` & `importantForAutofill`) in React Native TextInput, but that doesn't bond well with the cross-platform nature of the library.

Introduces an `autoComplete` prop based on HTML's `autocomplete` attribute, mapping to Android `autofillHints` & `importantForAutofill` and serving as a proper placeholder for autofill/autocomplete in other platforms:

Also gives you the ability to disable autofill by setting autocomplete="off".
Pull Request resolved: https://github.com/facebook/react-native/pull/21575

Differential Revision: D14102949

Pulled By: hramos

fbshipit-source-id: 7601aeaca0332a1f3ce8da8020dba037b700853a
2019-02-15 09:13:05 -08:00
Till Schmidt 53b87dcfff add new config resetBeforeIteration for Animated.loop (#20561)
Summary:
Fixes #20560
Pull Request resolved: https://github.com/facebook/react-native/pull/20561

Differential Revision: D14103437

Pulled By: cpojer

fbshipit-source-id: 35f2b3426304248e1a28f6a88812f07414618ea2
2019-02-15 08:50:31 -08:00
Sivaram Prasad Pulla c9ee902485 Adding support to cancel a headless task (#20416)
Summary:
On UWP, when the app is executing a Background task, the OS can request it to cancel the task (for various reasons). If the app does not cancel its background task quickly, the OS might terminate the app.
This change adds support to cancel the headless task which can be used by native code to forward the cancellation request from the OS to the JS code.
Pull Request resolved: https://github.com/facebook/react-native/pull/20416

Differential Revision: D10052080

Pulled By: cpojer

fbshipit-source-id: 2c0322ebb45f7835739f68bdf82a7100d968c516
2019-02-15 08:28:12 -08:00
Aditya Koukuntla 3ca33320bd Enable background updates when NSLocationWhenInUseUsageDescription is set (#20911)
Summary:
Location updates are not working in background when user allows **When in use authorization**, but works when user allows **Always allow**.

In Geolocation/RCTLocationObserver.m, setAllowsBackgroundLocationUpdates are set only for **Always allow** case, but native iOS allows us to setAllowsBackgroundLocationUpdates even for **When in use authorization**.

Solution:
setAllowsBackgroundLocationUpdates is now set for both cases.

[iOS] [Fixed] RCTLocationObserver - Enable background location updates when NSLocationWhenInUseUsageDescription is set
Pull Request resolved: https://github.com/facebook/react-native/pull/20911

Differential Revision: D13891852

Pulled By: cpojer

fbshipit-source-id: 5aae8dc12a147e7bed688807f34466b0f5a69344
2019-02-15 08:13:05 -08:00
zhongwuzw bd67254af1 fix typo in comments (#23478)
Summary:
Nit, just fix typo.

[iOS] [Fixed] - Fix typo in comments
Pull Request resolved: https://github.com/facebook/react-native/pull/23478

Differential Revision: D14101659

Pulled By: cpojer

fbshipit-source-id: b3d2bf25971c31a5fa3c411fbdfe761075dc4cfa
2019-02-15 07:18:30 -08:00
Amir Sharif 50fc666aad Add support for regex in YellowBox warnings
Summary: We want to use a Regex for potentially more complicated string warnings. This will allow ignoring dynamic rules that include ID fields for example.

Differential Revision: D14079118

fbshipit-source-id: aff01c6b6eedc77cd91638988700c093dcda0488
2019-02-14 16:39:34 -08:00
Dawid 0fe26db679 Add deprecation warning for ImageEditor (#23452)
Summary:
Add a deprecation warning for the [ImageEditor](https://facebook.github.io/react-native/docs/imageeditor) module as part of #23313.

[General] [Deprecated] - Deprecated [ImageEditor](https://facebook.github.io/react-native/docs/imageeditor) as it has now been moved to [react-native-community/image-editor](https://github.com/react-native-community/react-native-image-editor)
Pull Request resolved: https://github.com/facebook/react-native/pull/23452

Differential Revision: D14082792

Pulled By: cpojer

fbshipit-source-id: 2315b4518ce20a0ec4e97f421960e4ab923ba21d
2019-02-14 06:18:29 -08:00
Christoph Nakazawa caf85d403a Remove VibrationIOS
Summary: This module has been deprecated for two years. There is `Vibration`, backed by the same native module, with cross platform support.

Reviewed By: rickhanlonii

Differential Revision: D14080979

fbshipit-source-id: 7bf60cfdca9517c6858b3c7f8a2b16eab0ce8e80
2019-02-14 05:41:53 -08:00
Christoph Nakazawa a5ae7f57f1 Remove deprecation messages.
Summary: These modules have been deprecated for at least one release or more. By landing this diff now, they will be fully removed from 0.60 (to be released in ~April).

Reviewed By: rickhanlonii

Differential Revision: D14080869

fbshipit-source-id: cf39cc1782eec1dd09750d20b55c76f580320f4d
2019-02-14 05:41:53 -08:00
Josh Carver 4c400a10c2 Make ImagePickerIOS.openCameraDialog work with video (fixes #17989) (#19170)
Summary:
Fixes #17989

Previously, `ImagePickerIOS.openCameraDialog` would not render a `Video` option when the camera screen opened. If you passed `ImagePickerIOS.openCameraDialog({ videoMode: true }, ...)` the app would crash with an error complaining about the proper mediaType(s) not being set (see issue: #17989  for full details).

This is a 2 line change that sets the mediaTypes properly, so now users can capture videos in addition to photos.
Pull Request resolved: https://github.com/facebook/react-native/pull/19170

Differential Revision: D14068078

Pulled By: hramos

fbshipit-source-id: d04a3d267ca83ea58e88c880a85ac34ddd4744c8
2019-02-13 13:27:18 -08:00
Christoph Nakazawa c6d8f6048a Properly gate platform specific code in Alert
Summary:
In the past, Alert and AlertIOS were separate modules and both were shipped on Android even though only Alert can be used there. We unified the two modules but it meant that the code for both was still shipped on both platforms.

This diff changes it so that platform specific code is gated in a `Platform.OS` block, which means that the unnecessary code per platform is being stripped out. I'm not looking to win a beauty contest with the code in this module - we have barely touched it in years and I don't think we will touch it anytime soon, so I just merged the sub-classes (which only had static methods anyway) directly into the main class. I'm aware I could make two separate files with platform extensions but that ends up being more code here and it seems straightforward enough to me.

Reviewed By: TheSavior

Differential Revision: D14057404

fbshipit-source-id: 1ae1d227a39d76de9779b3db62960cca46e9b75c
2019-02-13 04:24:12 -08:00
Rafael Lincoln 36e026ee89 Add a deprecation warning when importing PushNotificationIOS (#23396)
Summary:
Added a deprecation warning for the `PushNotificationIOS`, module as part of #23313.

[General] [Deprecated] - PushNotificationIOS [was moved to community repo](https://github.com/react-native-community/react-native-push-notification-ios)
Pull Request resolved: https://github.com/facebook/react-native/pull/23396

Differential Revision: D14055656

Pulled By: cpojer

fbshipit-source-id: fc371340aa4d8ac82fee2a3dc6f6c796ae98dde4
2019-02-12 13:47:25 -08:00
Emily Janzer 7652e31d8c Pass through track color values for true/false to native component
Summary:
There's a bug in the OSS Switch component where the track color value is reset to the default value when the switch is toggled. It looks like the Java class resets the track color value in `setOn` (which fires in a press event): https://fburl.com/vmugfzja but these values aren't actually initialized from JS - in Switch.js we only pass through the current track color: https://fburl.com/vytekd0o.

The React component already has an API for defining both true/false track colors. However, we should also make sure not to reset these values for people using the old API of `tintColor`/`onTintColor`, so I'm changing it to only reset the value when both of those props are null.

Reviewed By: mdvacca

Differential Revision: D14035007

fbshipit-source-id: 12d968076bd47d54deedbfc15b12ff3cd77e2fd0
2019-02-12 10:47:58 -08:00
Peter Argany 2d86d38e75 Make AnimatedMock instantly complete spring and timing animations
Summary:
Some MP E2E tests started failing when I introduced AnimatedMock (D13811035) with this error:

> message: Timeout exception: Message: element located by locator {"id":"mp_your_items_tab_button"} is not visible

The test relied on the button to animate in, which AnimatedMock disabled. The fix is to complete animations instantly in AnimatedMock. This diff implements that for spring and timing.

Reviewed By: cpojer

Differential Revision: D14036172

fbshipit-source-id: 18a422ce8ef6de05ff9224c94214524511a76949
2019-02-12 10:40:23 -08:00