54 Commits

Author SHA1 Message Date
Nick Lockwood
fe4b4c2d83 Optimised blending for translucent images with opaque background color + fixed cropping for images in cover/contain mode.
Summary:
@public

Our background color propagation mechanism is designed to make rendering of translucent content more efficient by pre-blending against an opaque background. Currently this only works for text however, because images are not composited into their background even if the background color is opaque.

This diff precomposites network images with their background color when the background is opaque, allowing them to take advantage of this performance optimization.

I've also added some logic to correctly crop the downloaded image when the resizeMode is "cover" or "contain" - previously it was only correct for "stretch".

Before:{F22437859}
After:{F22437862}

Test Plan: Run the UIExplorer "<ListView> - Paging" example with "color blended layers" enabled and observe that the images appear in green now, instead of red as they did before.
2015-05-22 07:19:06 -08:00
Premasagar Rose
33ac55b2bd Fix typo in image documentation
Summary:
Closes https://github.com/facebook/react-native/pull/970
Github Author: Premasagar Rose <p@dharmafly.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-18 13:01:20 -08:00
James Ide
08d30e751b [ActivityIndicator] Add the onLayout prop to the outer container view
Summary:
ActivityIndicator was forwarding all of its props except `style` to the inner native view. This meant that onLayout would report a zero-sized frame that was relative to the wrapper view instead of the parent of the ActivityIndicator.

This diff adds `onLayout` to the wrapper view instead of the native view.

In general, all components that forward props need to be audited in this manner.

Closes https://github.com/facebook/react-native/pull/1292
Github Author: James Ide <ide@jameside.com>

Test Plan: `<ActivityIndicator onLayout={...} />` reports the size of the spinner plus a position relative to its parent view.
2015-05-15 18:08:32 -08:00
Martin Konicek
92fc92835f [ReactNative] Resolve assets on Android 2015-05-13 13:24:36 -07:00
Nick Lockwood
cfeae15c1f Fixed thread safety for RCTImageLoader 2015-05-13 13:24:36 -07:00
Nick Lockwood
5e160f168d Added support for local image to RCTImageLoader 2015-05-13 13:24:35 -07:00
Krzysztof Magiera
ff00e1496c [ReactNative] Rename ReactIOS JS module (and relatives) to ReactNative. 2015-05-13 13:24:35 -07:00
Alex Kotliarskyi
c76fb40ec4 [ReactNative] Register assets with AssetRegistry 2015-05-07 17:27:42 -08:00
Alex Kotliarskyi
d3c0029cef [ReactNative] Do not throw when Image.source is null 2015-05-06 16:16:49 -08:00
Peter Zich
d177a45bdc [ReactNative] Pull transform properties out into TransformPropTypes 2015-05-06 14:24:10 -08:00
Spencer Ahrens
48b281de76 [ReactNative] Remove padding restriction on images
Summary:
@public
Padding actually works fine on images.

Test Plan: Nested text inside an image is properly positioned with padding on the image.
2015-05-01 16:44:52 -08:00
Ben Alpert
dd56ccb9c7 [react-native] Fix capitalization of "REact" 2015-04-27 13:52:57 -08:00
Alex Kotliarskyi
970bff6132 [ReactNative] Enable resolveAssetSource for Image.android 2015-04-24 10:56:04 -08:00
Tadeu Zagallo
d293bed5ab [ReactNative] Fix analyze errors on oss 2015-04-24 08:28:35 -08:00
Alex Kotliarskyi
ffb3026419 [ReactNative] Pick correct assets depending on device scale 2015-04-22 16:39:54 -08:00
Alex Kotliarskyi
c5ea25f7fb [ReactNative] Adopt client asset managing code to server changes 2015-04-22 13:41:28 -08:00
Alex Kotliarskyi
c6ad7b85d1 [ReactNative] Use network image for new image assets 2015-04-21 12:45:36 -08:00
Martin Konicek
c0c2d4ca00 [react_native] JS files from D2009265: Fix resizeMode for images 2015-04-21 12:04:32 -08:00
Spencer Ahrens
65b6d209d9 [ReactNative] cleanup some requireNativeComponent cruft 2015-04-17 15:45:12 -08:00
Spencer Ahrens
915151c5d7 [ReactNative] verifyPropTypes against native exports 2015-04-16 18:15:36 -08:00
Kevin Gozali
e362fb2095 [ReactNative] Move image asset loading to a queue 2015-04-14 18:03:11 -08:00
Alex Akers
8a57c4e980 [React Native] RCT_EXPORT lvl.2 2015-04-08 08:34:10 -08:00
Nick Lockwood
bf4868edda Added non-class-scanning-based approach fror registering js methods 2015-04-08 05:45:20 -08:00
Tadeu Zagallo
5b3e935332 [ReactNative] Fix crash on image download 2015-04-07 03:14:40 -08:00
Philipp von Weitershausen
b9219ab07e [ReactNative][MAdMan] Add type for image source, flowify AdsManagerObjectiveTypes 2015-04-06 10:32:42 -08:00
laiso
e35521300a (Xcode) Set indent=2 in all xcodeproj files.
Summary:
These are default settings now.
I saw my Xcode be configured indent=4.

![2015-03-30 12 16 11 pm](https://cloud.githubusercontent.com/assets/39830/6889697/98f8b930-d6d6-11e4-81c8-d2146855d127.png)

Closes https://github.com/facebook/react-native/pull/472
Github Author: laiso <laiso@lai.so>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-01 17:14:45 -08:00
Christopher Chedeau
dee36b8e07 [ReactNative] Improve <Image> docs 2015-04-01 10:15:51 -08:00
Nick Lockwood
15eb5fde51 Fixed threading issues in RCTImageDownloader 2015-03-30 03:38:46 -08:00
Brent Vatne
89fce9aead Make bounds and scale of gif network images respond to device and styles
Summary:
@vjeux and I were discussing this in irc an discovered that network gif images did not respond how they should to width, height or flex properties. Along the way I also noticed that the scale was not changing depending on the device. This PR fixes that, so now you can do `flex: 1` on a gif image to have it stretch to the whole screen. [Minimum reproducible example here](https://gist.github.com/brentvatne/f745377b0789162a28df) - try this without and then with the changes of this PR to see.
Closes https://github.com/facebook/react-native/pull/353
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-03-27 12:01:00 -08:00
Julius Parishy
7bcb467526 Cancel contents animation before setting new contents in RCTNetworkImageView
Summary:
This is a fix for #322

When setting a new image via the imageURL property, the new image
doesn't always replace the previous one when it is finished downloading
because the image view has a previously instated layer animation
on its contents. This cancels any animation prior to setting the new
contents to fix the issue.
Closes https://github.com/facebook/react-native/pull/337
Github Author: Julius Parishy <julius>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-03-27 06:21:04 -08:00
Alex Akers
7a97043a3e [React Kit] Remove embarrassing TODOs 2015-03-26 10:33:05 -08:00
Basil Hosmer
030b264eb4 flowify a few more Libraries 2015-03-26 10:13:38 -08:00
Tadeu Zagallo
20291a02df [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
Tadeu Zagallo
bbb78df076 [React Native] Add CocoaPods spec 2015-03-25 21:53:26 -08:00
Nick Lockwood
19e328fb08 Added explicit types for all view properties 2015-03-25 21:20:24 -08:00
Christopher Chedeau
1aeb02ada3 [ReactNative] Expanded license on obj-c files 2015-03-23 13:18:29 -08:00
Christopher Chedeau
e1ef0328d9 [ReactNative] Expanded license on js files 2015-03-23 13:17:54 -08:00
Alex Akers
48cc440bd3 [React Native] Fix iOS 7 crashes b/c missing Photos.fmwk 2015-03-23 08:06:58 -08:00
Felix Kling
81d024924c [react-native] Use SpreadProperty to make react-docgen happy 2015-03-20 17:04:12 -08:00
Amjad Masad
f1746ac83e [react-packager] change all but one ix to require 2015-03-20 15:26:58 -08:00
Spencer Ahrens
9086365faf [ReactNative] Strip prefixes from NativeModules keys 2015-03-17 21:54:27 -08:00
Spencer Ahrens
d8ee4e87a1 [ReactKit] Remove NativeModulesDeprecated 2015-03-17 02:48:58 -08:00
Spencer Ahrens
b396de3cc8 [ReactNative] s/RK/RCT in OSS 2015-03-17 02:48:57 -08:00
Nick Lockwood
8799f0c487 Ported ART to new UIManager 2015-03-15 16:01:58 -08:00
Jiajie Zhu
50f77016bb [catlyst|madman] fix prop type warning 2015-03-11 14:45:41 -08:00
Tadeu Zagallo
78ec0df464 [ReactNative] OSS CameraRoll 2015-03-09 16:48:02 -08:00
Christopher Chedeau
e4093a6abb [ReactNative] Remove ImageSourcePropType 2015-03-09 09:49:30 -08:00
Christopher Chedeau
45da1f03cb [ReactNative] s/Image.sourcePropType/Image.propTypes.source/ 2015-03-09 09:49:29 -08:00
Christopher Chedeau
d8e83c882e [ReactNative] Move around and reformat comments for the documentation 2015-03-09 09:49:24 -08:00
Nick Lockwood
fb2f063ef5 Ported TabBarIOS to OSS and unified implementation 2015-03-05 17:16:19 -08:00