Permalink
Browse files

Add missing resizeMode prop on Image Android

Summary:
It seems like the `resizeMode` propType was missing from `Image.android.js`, this PR adds it.
I caught by trying to use `Image.propTypes.resizeMode` on Android, and getting a warning because it was `undefined`.

It's not supposed to break anything, maybe pop a few warnings but not much more.

**Test Plan:**
- Launched UIExplorer
Closes #7355

Differential Revision: D3648559

fbshipit-source-id: a4397938d14c11ded909d6bf4652a4b0fcebed3b
  • Loading branch information...
1 parent 8ad748a commit f634a0fc2388a34774d9e7dceb0890535c6f7a29 @Bhullnatik Bhullnatik committed with Facebook Github Bot Aug 1, 2016
Showing with 16 additions and 0 deletions.
  1. +16 −0 Libraries/Image/Image.android.js
@@ -130,6 +130,22 @@ var Image = React.createClass({
* Used to locate this view in end-to-end tests.
*/
testID: PropTypes.string,
+ /**
+ * Determines how to resize the image when the frame doesn't match the raw
+ * image dimensions.
+ *
+ * 'cover': Scale the image uniformly (maintain the image's aspect ratio)
+ * so that both dimensions (width and height) of the image will be equal
+ * to or larger than the corresponding dimension of the view (minus padding).
+ *
+ * 'contain': Scale the image uniformly (maintain the image's aspect ratio)
+ * so that both dimensions (width and height) of the image will be equal to
+ * or less than the corresponding dimension of the view (minus padding).
+ *
+ * 'stretch': Scale width and height independently, This may change the
+ * aspect ratio of the src.
+ */
+ resizeMode: PropTypes.oneOf(['cover', 'contain', 'stretch']),
},
statics: {

0 comments on commit f634a0f

Please sign in to comment.