From f634a0fc2388a34774d9e7dceb0890535c6f7a29 Mon Sep 17 00:00:00 2001 From: Jimmy Mayoukou Date: Mon, 1 Aug 2016 00:49:14 -0700 Subject: [PATCH] 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 https://github.com/facebook/react-native/pull/7355 Differential Revision: D3648559 fbshipit-source-id: a4397938d14c11ded909d6bf4652a4b0fcebed3b --- Libraries/Image/Image.android.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index cafd1f22a..b4d8a8c4b 100644 --- a/Libraries/Image/Image.android.js +++ b/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: {