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

1033 Коммитов

Автор SHA1 Сообщение Дата
Adam Comella bcf48e74ae Include image dimensions & url in Image's onLoad callback
Summary:
This is similar to the iOS feature that was implemented by 84f68c338a.

**Test plan (required)**

Verified that the image dimensions are included in the `onLoad` callback in a test app. Also, this change is used in my team's app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9608

Differential Revision: D3797659

Pulled By: foghina

fbshipit-source-id: ea83a907bf6b0b61d9bc1e90fc7c64b7132db81f
2016-09-01 02:44:00 -07:00
Alexander Oprisnik c0de1a7011 Only initialize FrescoModule once
Summary:
Fresco should only be initialized once. Re-initializing causes a few problems (https://github.com/facebook/react-native/issues/8677) and we don't need to do it.
If a Fresco configuration needs to change, you can just restart the application or add delegates for parts that can change and manually update them instead.

Reviewed By: astreet

Differential Revision: D3790908

fbshipit-source-id: 9df4c3be15ca49433120abd7ba1a4f5ae2a3f1c1
2016-08-31 14:58:44 -07:00
Adam Comella 6897f40af7 Fix sizing of absolutely positioned nodes inside overflow:hidden parent
Summary:
When an absolutely positioned node appeared inside an overflow:hidden
parent, we were limiting its height. This is inconsistent with how
layout behaves on the web.
Closes https://github.com/facebook/css-layout/pull/218

Reviewed By: lucasr

Differential Revision: D3797285

Pulled By: emilsjolander

fbshipit-source-id: 98f98e77aa26edce86b9882c1cac284799b69a27
2016-08-31 08:13:41 -07:00
Adam Comella 06e52f8e8c Fix bug in timer clean up
Summary:
One of the impacts of this bug is that Java is firing timer
completion events into JavaScript for timers that should have
been deleted. JavaScript filters these out so it doesn't impact
the app developer. However, Java is completing more timers
than necessary.

When cleaning up a timer, we were accidentally deleting the
whole set of timers for that context. Instead, we should
just delete that timer from its context.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9361

Differential Revision: D3797573

fbshipit-source-id: c30ed600af741601f2babdfc61da9aac549cbadb
2016-08-31 07:28:39 -07:00
Felix Oghina 69c889815e Expose image cache interrogation to JS
Summary: Add a static `Image.queryCache` function that can query multiple URLs at once. The result is a map where each URL that is in cache is mapped to the cache type (memory/disk). URLs that are not cached do not appear in the result.

Reviewed By: lexs

Differential Revision: D3791333

fbshipit-source-id: b183015d97423f0c095bf891f035dac2e23d8d11
2016-08-31 05:13:39 -07:00
Felix Oghina d3282e3bb1 Clean up fresco cache clearing code
Summary: I noticed we're doing too much manual work here, when Fresco has a nice handy shortcut for clearing all caches.

Reviewed By: kirwan

Differential Revision: D3791356

fbshipit-source-id: 4a55d0280e9483267741ae75383b50ca0b74c5c6
2016-08-31 03:13:32 -07:00
Scott Buckfelder 16f76d4407 SKETCH Add performance tracking for rendering
Differential Revision: D3709400

fbshipit-source-id: a006b60feb3fc5cb55cc2e6f08275fcc8de1d3e1
2016-08-30 14:28:37 -07:00
Adam Comella fd3484481a Fix race condition in EventDispatcher
Summary:
`mRCTEventEmitter` is used by 2 different threads. It's assigned on the UI thread and it's accessed on the JavaScript thread. Currently, it can be the case that the UI thread assigns `mRCTEventEmitter` and later the JS thread accesses it but still sees null.

This change fixes the issue by marking the `mRCTEventEmitter` variable as `volatile` to ensure that both threads see the same value for `mRCTEventEmitter`.

**Test plan (required)**

This change is currently used in my team's app. We're no longer seeing a crash in `EventDispatcher`.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9655

Differential Revision: D3790888

Pulled By: andreicoman11

fbshipit-source-id: 68cdbc74faffb36dc2bca8ad3d4a78929badbe9c
2016-08-30 04:14:45 -07:00
Emil Sjolander 899adf5343 Expose flexGrow, flexShrink, and flexBasis properties
Reviewed By: javache, astreet

Differential Revision: D3785140

fbshipit-source-id: a735602c53da72e3bce69ba30936c4ed25d76b88
2016-08-30 03:13:39 -07:00
Andrew Y. Chen 22de6550d6 Add onContentSizeChange prop to WebView
Summary: Added support for WebViews to take in an onContentSizeChange prop, which will return a native event that contains the width and height of the html content in the WebView. Also moved the ContentSizeChangeEvent from the recyclerview dir to the uimanager/events dir

Reviewed By: andreicoman11

Differential Revision: D3775399

fbshipit-source-id: 19a0579f8345e5853cc7311b80f1f1393c77ab58
2016-08-29 12:28:52 -07:00
Kevin Gozali 35e7a266db allow finding the rootTag of any reactTag inside UIManager
Summary: added API to in UIManager to find the rootTag/View of any reactTag based on its layout (shadow views) hierarchy (not to be used by JS)

Reviewed By: javache

Differential Revision: D3750410

fbshipit-source-id: 68611e39930d53ece478f25245ddc7f7838daaa6
2016-08-28 22:58:28 -07:00
Adam Comella e6de198a4b Fix gradle clean task
Summary:
Running the command `./gradlew clean` resulted in the following error:

```
./node_modules/react-native/ReactAndroid/src/main/jni//xreact/jni/Android.mk:42: *** Android NDK: Aborting.    .  Stop.
Android NDK: ./node_modules/react-native/ReactAndroid/src/main/jni//xreact/jni/Android.mk: Cannot find module with tag 'cxxreact' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
```

The problem was that `REACT_COMMON_DIR` wasn't defined.

**Test plan (required)**

Running `./gradlew clean` now works.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9607

Differential Revision: D3780364

fbshipit-source-id: 2b45d538413f7ee2cf0b36a1fa33287f0b1bf23f
2016-08-26 17:13:44 -07:00
Lucas Rocha 1eddd01063 Make Spacing.release() public
Differential Revision: D3763593

fbshipit-source-id: 27436c0dbd292b38cfc98f4cfb8e2d12787b85d6
2016-08-26 04:13:45 -07:00
Emil Sjolander 2a859eb7e3 Revert changes causing layout failures
Differential Revision: D3776987

fbshipit-source-id: 06bd154a36f895782f45511cd8cf49cc6d7cbe7d
2016-08-26 03:13:41 -07:00
Emil Sjolander 06ee832928 Generate tests for flex properties
Differential Revision: D3771513

fbshipit-source-id: 1b5edc7a28bb26217e8a6d10d1829d9031c3ae2e
2016-08-25 15:44:23 -07:00
king6cong 56dd520824 fix typo
Summary: Closes https://github.com/facebook/react-native/pull/9588

Differential Revision: D3771663

Pulled By: hramos

fbshipit-source-id: 7f2aaef44c2d168484f91040ec24cfe0b65c07e3
2016-08-25 10:43:32 -07:00
Andrei Coman 5cb8b97f3c Reverted commit D3751097
Summary:
Setting the line height with the help of Android-provided StaticLayout is incorrect. A
simple example app will display the following when `setLineSpacing(50.f, 0.f)`
is set: {F62987699}. You'll notice that the height of the first line is a few
pixels shorter than the other lines.
So we use a custom LineHeightSpan instead, which needs to be applied to the text
itself, and no height-related attributes need to be set on the TextView itself.

Reviewed By: lexs

Differential Revision: D3751097

fbshipit-source-id: 6c5a8d01a6dca4ff6eef9c3aadd1b550054432d2
2016-08-25 02:43:43 -07:00
Andrei Coman 483953dab3 Fix Text incorrect line height
Summary:
Setting the line height with the help of Android-provided StaticLayout is incorrect. A
simple example app will display the following when `setLineSpacing(50.f, 0.f)`
is set: {F62987699}. You'll notice that the height of the first line is a few
pixels shorter than the other lines.
So we use a custom LineHeightSpan instead, which needs to be applied to the text
itself, and no height-related attributes need to be set on the TextView itself.

Reviewed By: lexs

Differential Revision: D3751097

fbshipit-source-id: c3574a1080efec26436a5c61afbff89afa8679e7
2016-08-24 11:13:38 -07:00
Alexander Blom b4999fca0d Don't clear queue in ProxyExecutor
Reviewed By: mhorowitz

Differential Revision: D3757216

fbshipit-source-id: 5adda2dcdfb438b65fe668c52e0d2e35705eed9f
2016-08-24 03:43:44 -07:00
Aaron Chiu 288934398b remove all @ReactModule runtime annotation processing
Summary: Runtime annotation processing uses reflection which is slow. We'll use build time annotation processing instead and create at build time static ModuleInfo classes which have "name", "canOverrideExistingModule", "supportsWebWorkers", "needsEagerInit".

Reviewed By: lexs

Differential Revision: D3752243

fbshipit-source-id: 3518c6f38087d8799a61410864007041389c0e15
2016-08-23 18:58:55 -07:00
Chris Hopman 1557325e4a Use -std=c++1y for lambda capture initializers
Reviewed By: mhorowitz

Differential Revision: D3761975

fbshipit-source-id: 5500fd25864282409eb49737eef4f703cadadf70
2016-08-23 18:58:55 -07:00
Chris Hopman 9a5d3bacb9 Remove terrible ReadableNativeArray::getMap() hack
Reviewed By: mhorowitz

Differential Revision: D3753952

fbshipit-source-id: c8ea693d3a24adad9f907ad28b811cf69ab9e68d
2016-08-23 17:13:38 -07:00
Emil Sjolander e63a7ea7bd Implement flex properties in java version as well
Reviewed By: lucasr

Differential Revision: D3753231

fbshipit-source-id: ea41d887cd99d1f03d2bc876a2fd7141dbe48320
2016-08-23 04:43:32 -07:00
Konstantin Raev b59fde817f Fixes paths to robolectric when they are downloaded from maven into buck-out
Reviewed By: mmmulani

Differential Revision: D3751888

fbshipit-source-id: 2a70e8655f3c6e6dcc2de17e85289d9db18a2699
2016-08-22 11:13:39 -07:00
Alexander Blom 38a14ffc32 Make RN background drawable respect bounds
Reviewed By: astreet

Differential Revision: D3655395

fbshipit-source-id: c8c1b953337a3c5dfa0d905bc3d774db6b3f8271
2016-08-22 03:28:36 -07:00
Aaron Chiu 924187eb9a add more Systrace to native module / view manager constants
Reviewed By: lexs

Differential Revision: D3739966

fbshipit-source-id: 4ba31aade00852132e528f96252197b823bb58a3
2016-08-19 11:58:53 -07:00
Alexander Blom e4d5dcb15b Always log exception in DevSupportManager
Reviewed By: andreicoman11

Differential Revision: D3741763

fbshipit-source-id: b4cc32e4d237955ec4a67af323024acd0d19106a
2016-08-19 07:13:45 -07:00
Felix Oghina 2a7f4be8f8 native decay animation
Summary: Add support for `useNativeDriver: true` to `Animated.decay`. Add example in Native Animated Example UIExplorer app.

Reviewed By: ritzau

Differential Revision: D3690127

fbshipit-source-id: eaa5e61293ed174191cec72255ea2677dbaa1757
2016-08-19 07:13:45 -07:00
Felix Oghina 37ab1c8844 Remove dependency on launcher from instrumentation tests
Reviewed By: bestander

Differential Revision: D3736847

fbshipit-source-id: d39a227fe8753f3766521fd23440933adba9e8c7
2016-08-19 06:58:43 -07:00
Michal Lowicki af14a5b489 Enable build file sandboxing in fbobjc
Reviewed By: darknoon

Differential Revision: D3655364

fbshipit-source-id: 0c7d37860d358a0768fe788b589e701964063092
2016-08-19 05:28:30 -07:00
Jennifer Wang 4b6af5fa63 Add wrapper class for async storage
Reviewed By: wsanville

Differential Revision: D3654554

fbshipit-source-id: bc21da4b5c46228136cc80592f84206d2deb541e
2016-08-18 10:43:32 -07:00
Emil Sjolander 805d06087b Fix border color
Summary: Border colors broke with recent change to default values in csslayout Spacing. This is a quick fix until we move react-native borders away from using Spacing.java which is a hack in the first place.

Reviewed By: lexs

Differential Revision: D3735435

fbshipit-source-id: 747c85798cb02e1a5139de038eb26b64ac4c5bf3
2016-08-18 10:28:38 -07:00
Emil Sjolander fd34c6d567 Move default spacing out of csslayout
Reviewed By: foghina

Differential Revision: D3709574

fbshipit-source-id: 6e0277bd97407a5c642d742f93ca2ac70d7307da
2016-08-18 03:28:34 -07:00
Don Yu a2a8d7f5da Fix onItemSelected firing for ReactPicker on initial layout.
Reviewed By: AaaChiuuu

Differential Revision: D3732557

fbshipit-source-id: ed031dbf205996dab8cb0555af972e6f26c0d202
2016-08-17 22:13:45 -07:00
Lukas Piatkowski 0b88dbf1a0 DevMenu option to control Sampling Profiler's sample interval
Differential Revision: D3722898

fbshipit-source-id: 7bf1528b26a1ac6ed81943144ca433a211cf7b35
2016-08-17 08:28:48 -07:00
Lukas Piatkowski fe1a39a8f2 DevMenu option to start the Sampling Profiler on init
Differential Revision: D3722550

fbshipit-source-id: 5a805753b4893a167df8bcf95c0e05ed22a15283
2016-08-17 08:28:48 -07:00
Andrei Coman db1b0e9be9 Reverted commit D3668840
Reviewed By: bestander

Differential Revision: D3668840

fbshipit-source-id: 553600a06c6a97c3a653815ba6fe61aaa1dad937
2016-08-17 02:58:30 -07:00
Connor McEwen 6df41d5184 Change Android Permission Module to use promises
Summary:
This is a follow-up to #9292 satya164
Closes https://github.com/facebook/react-native/pull/9325

Differential Revision: D3723568

fbshipit-source-id: d553a70bde53ed5d7c1f5f544c85c5c5935e3ca4
2016-08-16 12:58:39 -07:00
Emil Sjolander fc5bed8693 Support 64 bit platforms
Reviewed By: davidaurelio

Differential Revision: D3722479

fbshipit-source-id: c132f24c92c8476b328713861ad30670a43040c4
2016-08-16 08:58:53 -07:00
Felix Oghina af2bb20893 make main component name nullable
Summary: Sometimes the main component name is not known at activity construction time and depends on e.g. reading shared preferences. To support this use case, make `(Fragment)ReactActivity#getMainComponentName()` nullable and return `null` by default. In this case, the app will not be loaded in `onCreate` by default and the user has to call `loadApp` manually once the component name is known.

Reviewed By: andreicoman11

Differential Revision: D3722517

fbshipit-source-id: 062eed158798606e4160f1c142b23fd98ca618c8
2016-08-16 07:43:31 -07:00
Emil Sjolander 30847b2b35 Fix parameter order
Differential Revision: D3722391

fbshipit-source-id: 9adaf7b80d7bad93887a122c10eb06159a5189c2
2016-08-16 05:58:34 -07:00
Sriram Ramasubramanian dcef202aab Pass in the locale identifier from Android
Reviewed By: AaaChiuuu, achen1

Differential Revision: D3668583

fbshipit-source-id: f34b6e24d9ff4fa044d24f4133c9c85564a3f00f
2016-08-15 18:28:40 -07:00
Felix Oghina 5ee70415bc add oss-based fb activity and host classes
Reviewed By: andreicoman11

Differential Revision: D3655436

fbshipit-source-id: 3ca6535cd819171867c79f5e9801d9013676a80f
2016-08-15 09:43:40 -07:00
Emil Sjolander f7a22bc33c Use single function for margin, position, padding, and border
Reviewed By: lucasr

Differential Revision: D3715201

fbshipit-source-id: ea81ed426f0f7853bb542355c01fc16ae4360238
2016-08-15 09:28:41 -07:00
Mani Ghasemlou 8095707938 store borderColor in a non lossy way
Summary:
Fix for issue #3652 -

Converting from `int` to `float` is lossy for very large numbers, so storing `borderColor` as a single `Spacing` object (which uses `float`) was not working for certain colors.

So, this pull request splits `borderColor` into alpha and RGB components, and stores each of these as their own respective `Spacing` objects.

*Test Plan*

Check out cosmith sample code here that triggers the bug: https://rnplay.org/apps/l1bw2A

What currently looks like this:

<img width="548" alt="screen shot 2016-08-13 at 6 22 28 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645965/9346f05e-6183-11e6-8d40-3e458b08fd9a.png">

Should look like this (with my fix applied):

<img width="543" alt="screen shot 2016-08-13 at 6 20 08 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645968/9c26d1d0-6183-11e6-8759-75a5e99f498a.png">
Closes https://github.com/facebook/react-native/pull/9380

Differential Revision: D3716707

Pulled By: foghina

fbshipit-source-id: 1164378112e2a58d43c8f5fc671c2efdb64b412b
2016-08-15 09:13:28 -07:00
Felix Oghina fbd2e13910 Add Activity to onActivityResult listener interface
Summary:
The Android lifecycle is weird: turns out `onActivityResult` is called before `onResume`. This means `getCurrentActivity()` could return the wrong instance, or `null` if the activity was destroyed. To give developers access to the Activity receiving the result (which is also about to become the current activity), pass it as an argumento the listener.

Fixes github issue #8694.

Reviewed By: donyu

Differential Revision: D3704141

fbshipit-source-id: e7e00ccc28114f97415e5beab8c9b10cb1e530be
2016-08-13 08:44:12 -07:00
Don Yu d16c676262 Remove unused okhttp dependency from cxxbridge module
Summary: This dependency on okhttp is unused. Removing this to lower the method-count increase from including the core RN modules.

Reviewed By: AaaChiuuu

Differential Revision: D3711870

fbshipit-source-id: 54b92edb4a55140b33cc74a5e9270650ced56ab9
2016-08-12 16:28:28 -07:00
Aaron Chiu 705daabbb1 Reverted commit D3334273
Reviewed By: astreet

Differential Revision: D3334273

fbshipit-source-id: a3849604ea89db74900850c294685e7da9aeeacc
2016-08-12 15:58:31 -07:00
Emil Sjolander c2a41e42f2 Expose alignContent to java
Reviewed By: IanChilds

Differential Revision: D3709071

fbshipit-source-id: 421d75924ecc12d6d0975e342f3862cf5592f65f
2016-08-12 04:28:34 -07:00
Aaron Chiu c64213653e Convert modules to use @ReactModule instead of getName()
Reviewed By: astreet

Differential Revision: D3334273

fbshipit-source-id: a33bf72c5c184844885ef3ef610a05d9c102c8ea
2016-08-11 15:58:43 -07:00