2015-02-19 20:10:52 -08:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-03-23 13:35:08 -07:00
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-02-19 20:10:52 -08:00
|
|
|
*
|
2015-03-26 10:06:50 -07:00
|
|
|
* @flow
|
2018-01-14 19:32:26 -08:00
|
|
|
* @format
|
2015-02-19 20:10:52 -08:00
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
2018-09-27 17:20:13 -07:00
|
|
|
const DeprecatedColorPropType = require('DeprecatedColorPropType');
|
2018-05-10 15:44:52 -07:00
|
|
|
const LayoutPropTypes = require('LayoutPropTypes');
|
|
|
|
const ReactPropTypes = require('prop-types');
|
2018-09-27 19:31:28 -07:00
|
|
|
const DeprecatedShadowPropTypesIOS = require('DeprecatedShadowPropTypesIOS');
|
2018-09-27 16:12:47 -07:00
|
|
|
const DeprecatedTransformPropTypes = require('DeprecatedTransformPropTypes');
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2018-05-10 15:44:52 -07:00
|
|
|
const ImageStylePropTypes = {
|
2015-03-20 16:41:31 -07:00
|
|
|
...LayoutPropTypes,
|
2018-09-27 19:31:28 -07:00
|
|
|
...DeprecatedShadowPropTypesIOS,
|
2018-09-27 16:12:47 -07:00
|
|
|
...DeprecatedTransformPropTypes,
|
2018-09-28 00:48:05 -07:00
|
|
|
resizeMode: ReactPropTypes.oneOf([
|
|
|
|
'center',
|
|
|
|
'contain',
|
|
|
|
'cover',
|
|
|
|
'repeat',
|
|
|
|
'stretch',
|
|
|
|
]),
|
2015-12-14 18:56:32 -08:00
|
|
|
backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']),
|
2018-09-27 17:20:13 -07:00
|
|
|
backgroundColor: DeprecatedColorPropType,
|
|
|
|
borderColor: DeprecatedColorPropType,
|
2015-03-20 16:41:31 -07:00
|
|
|
borderWidth: ReactPropTypes.number,
|
|
|
|
borderRadius: ReactPropTypes.number,
|
2015-07-27 10:49:43 -07:00
|
|
|
overflow: ReactPropTypes.oneOf(['visible', 'hidden']),
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2016-04-06 09:20:39 -07:00
|
|
|
/**
|
2016-01-24 13:59:36 -08:00
|
|
|
* Changes the color of all the non-transparent pixels to the tintColor.
|
|
|
|
*/
|
2018-09-27 17:20:13 -07:00
|
|
|
tintColor: DeprecatedColorPropType,
|
2015-03-20 16:41:31 -07:00
|
|
|
opacity: ReactPropTypes.number,
|
2016-01-24 13:59:36 -08:00
|
|
|
/**
|
|
|
|
* When the image has rounded corners, specifying an overlayColor will
|
|
|
|
* cause the remaining space in the corners to be filled with a solid color.
|
|
|
|
* This is useful in cases which are not supported by the Android
|
|
|
|
* implementation of rounded corners:
|
|
|
|
* - Certain resize modes, such as 'contain'
|
|
|
|
* - Animated GIFs
|
2016-04-06 09:20:39 -07:00
|
|
|
*
|
2016-01-24 13:59:36 -08:00
|
|
|
* A typical way to use this prop is with images displayed on a solid
|
|
|
|
* background and setting the `overlayColor` to the same color
|
|
|
|
* as the background.
|
|
|
|
*
|
|
|
|
* For details of how this works under the hood, see
|
|
|
|
* http://frescolib.org/docs/rounded-corners-and-circles.html
|
|
|
|
*
|
|
|
|
* @platform android
|
2018-01-14 19:32:26 -08:00
|
|
|
*/
|
2016-01-24 13:59:36 -08:00
|
|
|
overlayColor: ReactPropTypes.string,
|
2016-04-13 07:41:36 -07:00
|
|
|
|
|
|
|
// Android-Specific styles
|
|
|
|
borderTopLeftRadius: ReactPropTypes.number,
|
|
|
|
borderTopRightRadius: ReactPropTypes.number,
|
|
|
|
borderBottomLeftRadius: ReactPropTypes.number,
|
|
|
|
borderBottomRightRadius: ReactPropTypes.number,
|
2015-03-20 16:41:31 -07:00
|
|
|
};
|
2015-02-19 20:10:52 -08:00
|
|
|
|
|
|
|
module.exports = ImageStylePropTypes;
|