react-native-swipeout
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -11,4 +11,4 @@ { | ||
"react-native": "^0.4.4", | ||
"react-native-swipeout": "^0.3.3" | ||
"react-native-swipeout": "^0.4.0" | ||
} | ||
} |
37
index.js
@@ -113,25 +113,16 @@ var React = require('react-native') | ||
if (this.state.exposed) var expose = posX+openX < openX | ||
if (timeDiff) var expose = posX < openX/10 | ||
if (this.state.swiping) { | ||
if (timeDiff) { | ||
var expose = posX < openX/10 | ||
this.tweenState('contentPos', { | ||
easing: tweenState.easingTypes.easeInOutQuad, | ||
duration: this.state.tweenDuration/2, | ||
endValue: expose ? btnsWidth : 0 | ||
}) | ||
if (expose) this.setState({ contentPos: btnsWidth, exposed: true }) | ||
else this.setState({ contentPos: 0, exposed: false }) | ||
} else { | ||
this.tweenState('contentPos', { | ||
easing: tweenState.easingTypes.easeInOutQuad, | ||
duration: this.state.tweenDuration, | ||
endValue: expose ? btnsWidth : 0 | ||
}) | ||
if (expose) this.setState({ contentPos: btnsWidth, exposed: true }) | ||
else this.setState({ contentPos: 0, exposed: false }) | ||
} | ||
this._tweenContent(expose, btnsWidth, 0) | ||
if (expose) this.setState({ contentPos: btnsWidth, exposed: true }) | ||
else this.setState({ contentPos: 0, exposed: false }) | ||
} | ||
this.setState({ swiping: false }) | ||
} | ||
, _tweenContent: function(expose, trueValue, falseValue) { | ||
this.tweenState('contentPos', { | ||
easing: tweenState.easingTypes.easeInOutQuad, | ||
duration: this.state.tweenDuration, | ||
endValue: expose ? trueValue : falseValue | ||
}) | ||
} | ||
, _rubberBandEasing: function(value, lowerLimit) { | ||
@@ -147,7 +138,3 @@ if(value < lowerLimit) { | ||
if (this.state.autoClose) { | ||
this.tweenState('contentPos', { | ||
easing: tweenState.easingTypes.easeInOutQuad, | ||
duration: this.state.tweenDuration, | ||
endValue: 0 | ||
}) | ||
this._tweenContent(false, 0, 0) | ||
this.setState({ exposed: false }) | ||
@@ -154,0 +141,0 @@ } |
{ | ||
"name": "react-native-swipeout", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "iOS-style swipeout buttons behind component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
63282
397