Commit Graph

13030 Commits

Author SHA1 Message Date
Valentin Shergin c623455845 Abstract classes for ShadowNode and Props
Summary: Foundation clases for Fabric designed to be "const-first".

Reviewed By: fkgozali

Differential Revision: D7230672

fbshipit-source-id: 433acd35a7958d5d577358b0a306923f970e573f
2018-03-18 19:17:39 -07:00
Valentin Shergin d16772a31e Sealable: fixed semantic; atomic type for the flag variable
Summary:
* Fixed semantic: all kinds of derivative instances lose `sealed` flag (which is expected);
 * Using atomic<bool> for `sealed_` ivar.

Reviewed By: fkgozali

Differential Revision: D7230674

fbshipit-source-id: abe786610c20a45a0fabb9068120e24adeeeac7f
2018-03-18 19:17:39 -07:00
Kevin Gozali 1c53471911 iOS OSS: fixed RNTester - missing RCTInputAccessoryShadowView.* in .xcodeproj
Reviewed By: yungsters

Differential Revision: D7317380

fbshipit-source-id: 0a40d62c70cd3c3a875e5a418f4b77fecb0417b1
2018-03-17 22:01:15 -07:00
Hunkyo Jung 541485c7fe Add inverted prop in SectionListExample
Summary:
This PR adds an option to pass`inverted` prop to SectionListExample in RNTester. FlatListExample already has this option but it's not available in SectionListExample.

Run RNTester app on device or simulator and select SectionListExample. Depending on switching `inverted` option, you can see either inverted list or not.

[GENERAL][ENHANCEMENT][RNTeater] - Add inverted prop to SectionListExample
Closes https://github.com/facebook/react-native/pull/18370

Differential Revision: D7317168

Pulled By: hramos

fbshipit-source-id: c6c212c705e686281f23954775cc3465cce3c8df
2018-03-17 20:23:22 -07:00
Héctor Ramos 6f588b31be Fix Android job
Summary:
Yarn is not used in the Android step, not directly

Test Plan
Circle

Release Notes

[GENERAL][MINOR][.circleci] - Fix Android CI job
Closes https://github.com/facebook/react-native/pull/18421

Differential Revision: D7314158

Pulled By: hramos

fbshipit-source-id: ad40346b6a1c1f63a1b952fd05cbe9398d9c59a1
2018-03-16 18:56:08 -07:00
Jamie Lynch c2fd54fcb2 Enable obfuscation in ProGuard rules by default
Summary:
This PR enables obfuscation in ProGuard by default when creating a new project, and documents how developers can turn obfuscation off if they desire.

The ProGuard phase is currently disabled by default. If a developer wanted to enable ProGuard, the first thing they would see is the following line in their build.gradle file: `def enableProguardInReleaseBuilds = false`

It's really easy to assume that enabling this flag will setup code shrinking and obfuscation, as this is the default behaviour for a completely native Android Studio project, or when running ProGuard from the command line directly.

However, the generated ProGuard rules override the default behaviour. Without visually inspecting the rules file, searching for a mapping file, or analyzing the Dex file classes, this isn't immediately obvious, as the APK will be smaller, and gradle will show the Proguard task as completing.

Personally I find this confusing and really wasn't expecting for obfuscation to be disabled - most Android Error Reporting services allow deobfuscation of stacktraces via mapping files.

1. Create a new project using `react-native init MyProject`
2. Observe that `-dontobfuscate` is commented out

[ANDROID] [MINOR] [ProGuard] - Enables obfuscation by default in newly created projects
Closes https://github.com/facebook/react-native/pull/17754

Differential Revision: D7251680

Pulled By: hramos

fbshipit-source-id: cf9ca7753640643377a51daa4fa9065516197340
2018-03-16 18:56:08 -07:00
miguelsm 353c070be9 Add a way to dismiss PopupMenu elements
Summary:
In native Android apps, like the YouTube app, context menus are closed when the device orientation changes.

In React Native apps instead, when having a [PopupMenu](https://developer.android.com/reference/android/widget/PopupMenu.html) open and rotating the device, the PopupMenu is not dismissed and appears in a wrong position on the screen.

This PR exposes a `dismissPopupMenu` method to allow the application to dismiss any open PopupMenu:

```(javascript)
UIManager.dismissPopupMenu()
```
Closes https://github.com/facebook/react-native/pull/15636

Differential Revision: D6837663

Pulled By: hramos

fbshipit-source-id: 7b0f4f04341129ad45c703a50897e17d93651974
2018-03-16 17:22:05 -07:00
Héctor Ramos 6426735e82 Simplify templates
Summary:
Trivial PR.

[GENERAL][MINOR][.circleci/, bots/] - Simplify GitHub templates
Closes https://github.com/facebook/react-native/pull/18418

Differential Revision: D7311869

Pulled By: hramos

fbshipit-source-id: b87599c53938406d585d711492aacbdde2fcb02a
2018-03-16 17:22:05 -07:00
Héctor Ramos 6f6084db69 Explicitly set path to yarn
Summary:
Due to issues with Circle's Docker images ([link](https://twitter.com/circleci/status/974694807091073024)), jobs are failing with an error "yarn not found".

Test Plan
Run on Circle

Release Notes
[GENERAL][MINOR][.circleci] - Fix Circle issue
Closes https://github.com/facebook/react-native/pull/18419

Differential Revision: D7312052

Pulled By: hramos

fbshipit-source-id: 2768b9c69046a2f80518430024d3e7afbbd7de65
2018-03-16 17:22:05 -07:00
Tadeu Valentt 076b1cea35 Prevent show a hidden status bar when opening modals, fix #7474
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Closes the old #7474, keeping the status bar hidden when displaying a modal
or dialog, this is accomplished by verifying if the activity status bar is hidden or not.

Added a test to [RNTester](https://github.com/facebook/react-native/tree/master/RNTester), so it can be tested from there:

1. Run [RNTester](https://github.com/facebook/react-native/tree/master/RNTester) project
2. Go to <StatusBar> tests
3. Set `hidden: true` in the *StatusBar hidden* samples
4. Set `modal visible: true` and see the result

Here are some gifs to help see the results:
![fail](https://user-images.githubusercontent.com/1649955/36345378-f443ad7e-1407-11e8-850d-d6317fb34da4.gif)
![success](https://user-images.githubusercontent.com/1649955/36345392-1c590b56-1408-11e8-9244-a2e828f579ab.gif)

none

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[ GENERAL  ]   [ BUGFIX      ]   [ [StatusBar] - Prevent show a hidden status bar when opening modals
 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[ GENERAL  ]   [ BUGFIX      ]   [StatusBar] - Prevent show a hidden status bar when opening modals
Closes https://github.com/facebook/react-native/pull/18004

Differential Revision: D7307564

Pulled By: hramos

fbshipit-source-id: 47e481ead78204865811ddf2ef3d27da77ad8b8f
2018-03-16 16:46:42 -07:00
Thibault Malbranche dbd47592a1 Local cli/android/normalize project name
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Scoped packages are starting to be the new thing, and gradle does not work properly with '/' in the project name, so this PR links them and replaces '/' by '_' . This only affects android.

I added tests in the 2 impacted functions + a test file for the normalizer function

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

-->
[CLI] [BUGFIX] [local-cli/link/link.js] - On android, Scoped packages will now get the '/' replaced with '_' to ensure gradle works nicely.  ⚠️ However if you previously linked scoped packages, they will get linked again. ⚠️
Closes https://github.com/facebook/react-native/pull/18275

Differential Revision: D7305227

Pulled By: hramos

fbshipit-source-id: 1c95563e884175529692948b29407a7733c44353
2018-03-16 11:26:01 -07:00
Rafael Oleza b02b1670d6 Bump metro@0.30.2
Reviewed By: BYK

Differential Revision: D7292431

fbshipit-source-id: 2d81e502e060ecd278977b838e0ef2db7e13b0e3
2018-03-15 18:58:45 -07:00
Héctor Ramos f376fe3232 Remove @xplat cell syntax in open source
Differential Revision: D7292243

fbshipit-source-id: f1c162be8bc90669481f04de8aa71f3d9dbece36
2018-03-15 16:47:26 -07:00
Pritesh Nandgaonkar 9102ff94e7 Moved YGFloatOptional from C struct to C++ struct
Reviewed By: emilsjolander

Differential Revision: D7288555

fbshipit-source-id: f61cc92c8fd0d48d2fc1f4d0e6fcef155f19ff8a
2018-03-15 12:41:16 -07:00
Pritesh Nandgaonkar ce92b8592b Fixed a typo and added a test case
Reviewed By: emilsjolander

Differential Revision: D7289221

fbshipit-source-id: 48ee9ccfac4adee51d515a366b5a11790f7236fc
2018-03-15 12:41:16 -07:00
Peter Argany 139d554c48 Replace js Dimensions with shadow view in InputAccessoryViewExample
Reviewed By: mmmulani

Differential Revision: D7196168

fbshipit-source-id: 031ed5ab24d1075f775ec71e5b78d32e03fe8f6f
2018-03-15 10:14:15 -07:00
Dmitry Zakharov 8e85bf84e8 Gatekeeper for Native Extensions
Reviewed By: danzimm, johnislarry

Differential Revision: D6965463

fbshipit-source-id: 28bcfbff980abfda3c63d7016ccf05beb1d178eb
2018-03-15 09:27:40 -07:00
Dmitry Zakharov c989ea8728 Extract NativeExtensionsProvider definition
Reviewed By: danzimm

Differential Revision: D6964355

fbshipit-source-id: e20dfa99bd9d8784a5f31a313302104d6dc33652
2018-03-15 09:27:40 -07:00
Pritesh Nandgaonkar da2d410122 Fix getters and setters if min and max Dimension
Reviewed By: emilsjolander

Differential Revision: D7274807

fbshipit-source-id: 7c1a4c19e8d0552b089a410c3330392cb26a6a47
2018-03-15 07:23:13 -07:00
Pritesh Nandgaonkar 040642dba3 Fix setter and getter of margin, position, border and padding
Reviewed By: emilsjolander

Differential Revision: D7274115

fbshipit-source-id: 942a91e6562ef789ae79102a828f397889468fa7
2018-03-15 07:23:13 -07:00
Peter van der Zee 6b1dc71740 Refactor resolvePlugins out to prepare for babel 7
Reviewed By: BYK

Differential Revision: D7287074

fbshipit-source-id: ec703f7292b63b679dbad055a6e43ac907729bfe
2018-03-15 07:23:13 -07:00
Brian Vaughn 22004db819 React sync for revisions ad9544f...ced176e
Reviewed By: sebmarkbage

Differential Revision: D7281277

fbshipit-source-id: 75a638114cf2a65a5c973dbdf218f6d3ba042cc4
2018-03-14 23:30:53 -07:00
Andrew Chen (Eng) d678058402 Add Fabric integration test
Reviewed By: fkgozali

Differential Revision: D7207630

fbshipit-source-id: 69cc10d7d45031eec9f3d934b981a5e4bb62a0ef
2018-03-14 16:27:05 -07:00
Andrew Chen (Eng) 304db5cb65 Add MIT license to Fabric
Reviewed By: fkgozali

Differential Revision: D7278262

fbshipit-source-id: 39f4c73b8f693162eb037125bf64fecc7eb0cf8b
2018-03-14 15:50:13 -07:00
Khaer Ansori c595509048 Add number-pad keyboardType
Summary:
On Android there's no number-pad but numeric instead, for my use-case I need number only (without decimal and sign, for PIN input)

I write it so there's no breaking change for those already using the `TextInput` Component

None

[ANDROID][ENHANCEMENT][Component] Add number-pad keyboardType
Closes https://github.com/facebook/react-native/pull/18350

Reviewed By: achen1

Differential Revision: D7269721

Pulled By: mdvacca

fbshipit-source-id: 82571dce948e0cf2e4354dc46c69198ec69ba65a
2018-03-14 14:48:10 -07:00
Eli White 28c9c68cfa Adding documentation to new StyleSheet Flow Types
Summary: Adding some explanation and examples of when to use these types.

Reviewed By: yungsters

Differential Revision: D7270185

fbshipit-source-id: c82f061ffb77e33133a59d268a08f7a95fd02fb6
2018-03-14 14:41:32 -07:00
Eli White 8bac869f5d Create Flow Props for Image
Reviewed By: yungsters

Differential Revision: D7270057

fbshipit-source-id: 1ecac28e4060fe0e85a4f0698406f8986ae16caf
2018-03-14 14:12:31 -07:00
Eli White 67656991b3 Move Image PropTypes to a new file
Reviewed By: yungsters

Differential Revision: D7270058

fbshipit-source-id: 91ad7700b7e89c393c6977bfd82494d2febda4a4
2018-03-14 14:12:31 -07:00
Alejandro Paredes Alva 7ce943ef3b Adds _lineHeight = NAN; to RCTTextAttributes
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

On iOS, when the parent Text contains the `lineHeight` style prop, and the children are also Text components they don't inherit the lineHeight prop.

This is for **iOS** only.
Create a react-native project with React Native 0.54.0 or 0.54.1 and change the app to:
```js
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
        <Text style={{ fontWeight: 'bold', lineHeight: 40 }}>
          <Text style={{ color: 'orange' }}>I am bold and orange, </Text>
          <Text style={{ color: 'red' }}>I am bold and red, </Text>
          <Text style={{ color: 'blue' }}>I am bold and blue, </Text>
          <Text style={{ color: 'purple' }}>I am bold and purple, </Text>
          <Text style={{ color: 'yellow' }}>I am bold and yellow, </Text>
          <Text style={{ color: 'pink' }}>I am bold and pink</Text>
        </Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    backgroundColor: 'black',
    flex: 1,
    justifyContent: 'center',
    padding: 50,
  },
});
```
It displays:
![iphone - 2018-03-12 at 21 51 53](https://user-images.githubusercontent.com/480605/37308941-b56f082e-263f-11e8-9c23-892f77077169.png)

But should look like:
![iphone - 2018-03-12 at 21 48 15](https://user-images.githubusercontent.com/480605/37308784-4efaddf2-263f-11e8-992b-ee0b6bb9a97b.png)

New &lt;Text> iOS https://github.com/facebook/react-native/commit/2716f53

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[IOS] [MINOR] [Text] - Inherit lineheight
Closes https://github.com/facebook/react-native/pull/18340

Differential Revision: D7276655

Pulled By: shergin

fbshipit-source-id: 0fe26536bb74da77be8405911fc699a622bc0b2f
2018-03-14 13:41:37 -07:00
Andrew Chen (Eng) 3a2bdf5c50 Move Fabric JSC bindings to oss
Reviewed By: mdvacca

Differential Revision: D7205065

fbshipit-source-id: 5876cb3e08ee96e39b80e6b377c60600f404ca21
2018-03-14 12:02:14 -07:00
Eric Czarny bec97dc243 Expose native show message method in header
Reviewed By: mmmulani

Differential Revision: D7201691

fbshipit-source-id: b5f74351a9be7e6e9a7fc7145a09ba9854efc002
2018-03-14 11:17:12 -07:00
Héctor Ramos 4f8328bf2f React sync for revisions ab4280b...ad9544f
Reviewed By: bvaughn

Differential Revision: D7256390

fbshipit-source-id: 9fe1324da93cb8f4a7f478e1037944774b9b95ff
2018-03-14 09:02:31 -07:00
Rafael Oleza a01ae8b68a Bump metro@0.30.1
Reviewed By: BYK

Differential Revision: D7259632

fbshipit-source-id: ef713d35a953cd829d6a8684d2fa9cfa30e69ac4
2018-03-14 08:48:52 -07:00
Pritesh Nandgaonkar 321b107685 Expose layout diffing flag to java
Reviewed By: emilsjolander

Differential Revision: D7272067

fbshipit-source-id: e67e82eb057e4c7124904c715f9dca4dcfea21ea
2018-03-14 08:48:52 -07:00
Pritesh Nandgaonkar f3ef8f8510 Remove the use of YGUndefined for flex-basis
Reviewed By: emilsjolander

Differential Revision: D7243924

fbshipit-source-id: 2bfaca1a5e3da40d5292a273cabf705f59c9d666
2018-03-14 04:34:04 -07:00
Pritesh Nandgaonkar e3af1508c8 Change the type of flexShrink to YGFloatOptional
Reviewed By: emilsjolander

Differential Revision: D7232171

fbshipit-source-id: 3111119d3d74a7035c01132bff61b30cf44e120a
2018-03-14 04:34:04 -07:00
Pritesh Nandgaonkar 3274e9fa51 Change the type of flexGrow to YGFloatOptional
Reviewed By: emilsjolander

Differential Revision: D7215355

fbshipit-source-id: 1298ee332551d44e4d070169a1e4103d005c4f43
2018-03-14 04:34:04 -07:00
Pritesh Nandgaonkar 5b3d59598a Change the type of flex to YGFloatOptional
Reviewed By: emilsjolander

Differential Revision: D7211327

fbshipit-source-id: 0d979b6ba00317317b98bbc6e63979c7f1feb2da
2018-03-14 04:34:04 -07:00
Pritesh Nandgaonkar 9f7e70363a Changed the return type of YGResolveValue
Reviewed By: emilsjolander

Differential Revision: D7195099

fbshipit-source-id: 72c4163cd08691cf6e40df05394cc52e83b0de14
2018-03-14 04:34:03 -07:00
Pritesh Nandgaonkar af4a36337d Remove the usage of YGUndefined in the default values of Border in YGStyle
Reviewed By: emilsjolander

Differential Revision: D7195115

fbshipit-source-id: e635cf55ac94d8a90caef6cafce281579da2cbfc
2018-03-14 04:34:02 -07:00
Sahil Ohri 8466db0fd3 Revert #17927
Summary:
This change is a revert of [#17927](https://github.com/facebook/react-native/pull/17927) pull-request.
The pull-request caused an issue with the keyboard covering the text field at the bottom of the scroll view.

Reviewed By: shergin

Differential Revision: D7246609

fbshipit-source-id: 149f825274c4fa79ab593f1bae3602667d16ddee
2018-03-13 19:27:33 -07:00
Janic Duplessis db061ea8c7 Don't wrap ListEmptyComponent in an extra view
Summary:
A common UI pattern for list empty states is some text/images centered inside the visible part of the list. This is pretty hard to do currently because we wrap ListEmptyComponent with an extra view with no way to style it so we cannot just use `flex: 1` to make it fill the available space.

- Added an example of ListEmptyComponent in the FlatList example in RNTester

Before (no way to make ListEmptyComponent fill the space):
<img width="377" alt="screen shot 2018-03-05 at 5 24 15 pm" src="https://user-images.githubusercontent.com/2677334/37003152-129db3ac-209a-11e8-9600-110f10d57144.png">

After:
<img width="377" alt="screen shot 2018-03-05 at 5 09 20 pm" src="https://user-images.githubusercontent.com/2677334/37002809-e6971178-2098-11e8-8cf7-74bfb2f6a992.png">

- Tested some edge cases like returning null from the ListEmptyComponent

- Tested in an app that uses FlatList + ListEmptyComponent

[GENERAL] [MINOR] [VirtualizedList] - Don't wrap ListEmptyComponent in an extra view
Closes https://github.com/facebook/react-native/pull/18206

Differential Revision: D7266274

Pulled By: sahrens

fbshipit-source-id: 4636d2418474a4c86ac63e5e18a9afc391a518c5
2018-03-13 18:11:31 -07:00
Ram N 9737774b96 Fix crash in Sapienz bot for Interpolator type
Reviewed By: mdvacca

Differential Revision: D7252818

fbshipit-source-id: 30c585a2e6f6c2d7a7e7013c26c6228d8ef29aa6
2018-03-13 18:11:31 -07:00
Naris Siamwalla 41acb0a75b Fix clang-6 compile error (virtual destructor)
Reviewed By: smeenai

Differential Revision: D7264312

fbshipit-source-id: f0567452127ceba6cfa13d05bb2a00a5af7aac05
2018-03-13 16:41:05 -07:00
Teddy Martin ca898f4367 Add docs for Swift usage to RCTBridgeModule.h
Summary:
Clarifies how to get a reference to RCTBridge from a Swift RCTBridgeModule.

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

In writing native modules for Swift, I have run into issues where the documentation applies only to Objective-C and does not supply adequate information for how one might accomplish something in Swift.

This is a good example, where the `synthesize` method simply does not apply to Swift code.

[IOS][ENHANCEMENT][Base/RCTBridgeModule.h] Add documentation for Swift usage.
<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/18231

Differential Revision: D7262850

Pulled By: hramos

fbshipit-source-id: c6babb3edd786be8571eb49258d594f2fb99141d
2018-03-13 15:22:01 -07:00
Peter Argany c136c54ff0 Refactor RCTInputAccessoryView view hierarchy and names
Reviewed By: shergin

Differential Revision: D7196162

fbshipit-source-id: 07a5c13d4cdb876f5a632d7d53859eab5e235f49
2018-03-13 11:25:12 -07:00
Héctor Ramos aa323d4aa9 Use MIT license
Summary: Closes https://github.com/facebook/react-native/pull/18352

Differential Revision: D7257144

Pulled By: hramos

fbshipit-source-id: 477ff82f74cfa3fd0681c9522cc5199a60b24921
2018-03-13 10:32:13 -07:00
Héctor Ramos 7a1c618de6 Change newly imported file to MIT license
Summary:
The project at large switched to MIT last month. A PR that was opened prior to the change was merged, this PR updates the file to use the correct license.

None, trivial PR

[ANDROID] [MINOR] [Image] Update license
Closes https://github.com/facebook/react-native/pull/18343

Differential Revision: D7252836

Pulled By: hramos

fbshipit-source-id: b7c207c782f4bf19c12d121e86f394e52326a5ab
2018-03-12 20:26:43 -07:00
Eli White ab92c00245 Convert Text to ES6 Class
Summary: Utilizing ES6 Classes instead of createReactClass lets us actually enforce the way Text is used via Flow.

Reviewed By: fkgozali

Differential Revision: D7227755

fbshipit-source-id: 8e8285f9ebb3783a0dc4837c37c163178910ff9f
2018-03-12 18:06:28 -07:00
Moti Zilberman 0459e4ffaa Support Image resizeMode=repeat on Android
Summary:
`<Image resizeMode="repeat" />` for Android, matching the iOS implementation (#7968). (Non-goal: changing the component's API for finer-grained control / feature parity with CSS - this would be nice in the future)

As requested in e.g. #14158.

Given https://github.com/facebook/fresco/issues/1575, and lacking the context to follow the specific recommendations in https://github.com/facebook/fresco/issues/1575#issuecomment-267004303, I've opted for a minimal change within RN itself.

It's likely that performance can be improved by offloading this work to Fresco in some clever way; but I'm assuming that the present naive approach is still an improvement over a userland implementation with `onLayout` and multiple `<Image>` instances.

- Picking up on a TODO note in the existing code, I implemented `MultiPostprocessor` to allow arbitrary chaining of Fresco-compatible postprocessors inside `ReactImageView`.
- Rather than extensively refactor `ImageResizeMode`, `ReactImageManager` and `ReactImageView`, I mostly preserved the existing API that maps `resizeMode` values to [`ScaleType`](http://frescolib.org/javadoc/reference/com/facebook/drawee/drawable/ScalingUtils.ScaleType.html) instances, and simply added a second mapping, to [`TileMode`](https://developer.android.com/reference/android/graphics/Shader.TileMode.html).
- To match the iOS rendering exactly for oversized images, I found that scaling with a custom `ScaleType` was required - a kind of combination of `CENTER_INSIDE` and `FIT_START` which Fresco doesn't provide - so I implemented that as `ScaleTypeStartInside`. (This is, frankly, questionable as the default behaviour on iOS to begin with - but I am aiming for parity here)
- `resizeMode="repeat"` is therefore unpacked by the view manager to the effect of:
  ```js
     view.setScaleType(ScaleTypeStartInside.INSTANCE);
     view.setTileMode(Shader.TileMode.REPEAT);
   ```
  And the added postprocessing in the view (in case of a non-`CLAMP` tile mode) consists of waiting for layout, allocating a destination bitmap and painting the source bitmap with the requested tile mode and scale type.

Note that as in https://github.com/facebook/react-native/pull/17398#issue-285235247, I have neither updated nor tested the "Flat" UI implementation - everything compiles but I've taken [this comment](https://github.com/facebook/react-native/issues/12770#issuecomment-294052694) to mean there's no point in trying to wade through it on my own right now; I'm happy to tackle it if given some pointers.

Also, I'm happy to address any code style issues or other feedback; I'm new to this codebase and a very infrequent Android/Java coder.

Tested by enabling the relevant case in RNTester on Android.

| iOS | Android |
|-|-|
| <img src=https://user-images.githubusercontent.com/2246565/34461897-4e12008e-ee2f-11e7-8581-1dc0cc8f2779.png width=300>| <img src=https://user-images.githubusercontent.com/2246565/34461894-40b2c8ec-ee2f-11e7-8a8f-96704f3c8caa.png width=300> |

Docs update: https://github.com/facebook/react-native-website/pull/106

[ANDROID] [FEATURE] [Image] - Implement resizeMode=repeat
Closes https://github.com/facebook/react-native/pull/17404

Reviewed By: achen1

Differential Revision: D7070329

Pulled By: mdvacca

fbshipit-source-id: 6a72fcbdcc7c7c2daf293dc1d8b6728f54ad0249
2018-03-12 16:14:18 -07:00