react-native-fit-image
Advanced tools
Comparing version 1.4.4 to 1.4.5
@@ -12,8 +12,6 @@ Object.defineProperty(exports,"__esModule",{value:true});var _jsxFileName='src/FitImage.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _react=require('react');var _react2=_interopRequireDefault(_react); | ||
indicatorColor:_react.PropTypes.string, | ||
indicatorSize:_react.PropTypes.oneOfType( | ||
[ | ||
indicatorSize:_react.PropTypes.oneOfType([ | ||
_react.PropTypes.oneOf(['small','large']), | ||
_react.PropTypes.number]), | ||
originalHeight:_react.PropTypes.number, | ||
@@ -51,2 +49,4 @@ originalWidth:_react.PropTypes.number}); | ||
_this.isFirstLoad=true; | ||
_this.state={ | ||
@@ -65,2 +65,4 @@ height:0, | ||
_this.getStyle=_this.getStyle.bind(_this); | ||
_this.onLoad=_this.onLoad.bind(_this); | ||
_this.onLoadStart=_this.onLoadStart.bind(_this); | ||
_this.renderChildren=_this.renderChildren.bind(_this); | ||
@@ -76,6 +78,17 @@ _this.resize=_this.resize.bind(_this); | ||
_reactNative.Image.getSize(this.props.source.uri,function(originalWidth,originalHeight){ | ||
_this2.setStateSize(originalWidth,originalHeight);});}},{key:'getHeight',value:function getHeight( | ||
_this2.setStateSize(originalWidth,originalHeight);});}},{key:'onLoad',value:function onLoad() | ||
{ | ||
this.setState({isLoading:false});}},{key:'onLoadStart',value:function onLoadStart() | ||
{ | ||
if(this.isFirstLoad){ | ||
this.setState({isLoading:true}); | ||
this.isFirstLoad=false;}}},{key:'getHeight',value:function getHeight( | ||
layoutWidth){ | ||
@@ -135,3 +148,3 @@ if(this.style&&this.style.height){ | ||
color:this.props.indicatorColor, | ||
size:this.props.indicatorSize,__source:{fileName:_jsxFileName,lineNumber:129}}));} | ||
size:this.props.indicatorSize,__source:{fileName:_jsxFileName,lineNumber:142}}));} | ||
@@ -144,3 +157,3 @@ | ||
{var _this3=this; | ||
{ | ||
return ( | ||
@@ -150,4 +163,4 @@ _react2.default.createElement(_reactNative.Image,_extends({}, | ||
onLayout:this.resize, | ||
onLoad:function onLoad(){_this3.setState({isLoading:false});}, | ||
onLoadStart:function onLoadStart(){_this3.setState({isLoading:true});}, | ||
onLoad:this.onLoad, | ||
onLoadStart:this.onLoadStart, | ||
source:this.props.source, | ||
@@ -158,3 +171,3 @@ style:[ | ||
{height:this.state.height}, | ||
styles.container],__source:{fileName:_jsxFileName,lineNumber:141}}), | ||
styles.container],__source:{fileName:_jsxFileName,lineNumber:154}}), | ||
@@ -161,0 +174,0 @@ |
{ | ||
"name": "react-native-fit-image", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"description": "Responsive image component to fit perfectly itself.", | ||
@@ -5,0 +5,0 @@ "main": "dist/FitImage.js", |
@@ -26,3 +26,3 @@ # React Native Fit Image [](https://badge.fury.io/js/react-native-fit-image) | ||
<FitImage | ||
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }} | ||
source={{ uri: 'https://facebook.github.io/react/img/logo_og.png' }} | ||
style={styles.fitImage} | ||
@@ -36,3 +36,3 @@ /> | ||
indicatorSize="large" // (small | large) or integer | ||
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }} | ||
source={{ uri: 'https://facebook.github.io/react/img/logo_og.png' }} | ||
style={styles.fitImage} | ||
@@ -43,3 +43,3 @@ /> | ||
<FitImage | ||
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }} | ||
source={{ uri: 'https://facebook.github.io/react/img/logo_og.png' }} | ||
originalWidth={400} | ||
@@ -53,3 +53,3 @@ originalHeight={400} | ||
resizeMode="contain" | ||
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }} | ||
source={{ uri: 'https://facebook.github.io/react/img/logo_og.png' }} | ||
/> | ||
@@ -59,3 +59,3 @@ | ||
<FitImage | ||
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }} | ||
source={{ uri: 'https://facebook.github.io/react/img/logo_og.png' }} | ||
style={styles.fitImageWithSize} | ||
@@ -62,0 +62,0 @@ /> |
10902
149