Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade lib, use separate prop-types lib #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions library/transform/ViewTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ReactNative, {
Easing,
NativeModules
} from 'react-native';
import PropTypes from 'prop-types';

import {createResponder} from 'react-native-gesture-responder';
import Scroller from 'react-native-scroller';
Expand Down Expand Up @@ -88,10 +89,7 @@ export default class ViewTransformer extends React.Component {
onResponderGrant: this.onResponderGrant.bind(this),
onResponderRelease: this.onResponderRelease.bind(this),
onResponderTerminate: this.onResponderRelease.bind(this),
onResponderTerminationRequest: (evt, gestureState) => false, //Do not allow parent view to intercept gesture
onResponderSingleTapConfirmed: (evt, gestureState) => {
this.props.onSingleTapConfirmed && this.props.onSingleTapConfirmed();
}
onResponderTerminationRequest: (evt, gestureState) => false //Do not allow parent view to intercept gesture
});
}

Expand Down Expand Up @@ -421,36 +419,34 @@ ViewTransformer.propTypes = {
/**
* Use false to disable transform. Default is true.
*/
enableTransform: React.PropTypes.bool,
enableTransform: PropTypes.bool,

/**
* Use false to disable scaling. Default is true.
*/
enableScale: React.PropTypes.bool,
enableScale: PropTypes.bool,

/**
* Use false to disable translateX/translateY. Default is true.
*/
enableTranslate: React.PropTypes.bool,
enableTranslate: PropTypes.bool,

/**
* Default is 20
*/
maxOverScrollDistance: React.PropTypes.number,
maxOverScrollDistance: PropTypes.number,

maxScale: React.PropTypes.number,
contentAspectRatio: React.PropTypes.number,
maxScale: PropTypes.number,
contentAspectRatio: PropTypes.number,

/**
* Use true to enable resistance effect on over pulling. Default is false.
*/
enableResistance: React.PropTypes.bool,

onViewTransformed: React.PropTypes.func,
enableResistance: PropTypes.bool,

onTransformGestureReleased: React.PropTypes.func,
onViewTransformed: PropTypes.func,

onSingleTapConfirmed: React.PropTypes.func
onTransformGestureReleased: PropTypes.func
};
ViewTransformer.defaultProps = {
maxOverScrollDistance: 20,
Expand All @@ -459,4 +455,4 @@ ViewTransformer.defaultProps = {
enableTransform: true,
maxScale: 1,
enableResistance: false
};
};