Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function MyListItem() {
| `onRef` | function | `null` | (optional) receive swipeable component instance reference |
| `onPanAnimatedValueRef` | function | `null` | (optional) receive swipeable pan `Animated.ValueXY` reference for upstream animations |
| `bounceOnMount` | boolean | `false` | (optional) To alert the user that swiping is possible |
| `bounceOnMountDuration` | integer | 250 | (optional) Duration of the `bounceOnMount` animation |
| `disable` | boolean | `false` | (optional) Disable swiping |

### Advanced Props
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-native-swipeable-row",
"name": "react-native-swipeable-row-bouncing",
"version": "0.8.1",
"description": "A powerful React Native swipe component based on @jshanson7 package",
"main": "lib/index.js",
Expand Down Expand Up @@ -28,7 +28,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/Cederman/react-native-swipeable"
"url": "git+https://github.com/Clonescody/react-native-swipeable-row-bouncing"
},
"keywords": [
"react",
Expand Down
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default class Swipeable extends PureComponent {
swipeStartMinLeftEdgeClearance: PropTypes.number,
swipeStartMinRightEdgeClearance: PropTypes.number,
disable: PropTypes.bool,
bounceOnMountDuration: PropTypes.number,

// styles
style: ViewPropTypes.style,
Expand Down Expand Up @@ -158,6 +159,7 @@ export default class Swipeable extends PureComponent {
swipeStartMinLeftEdgeClearance: 0,
swipeStartMinRightEdgeClearance: 0,
bounceOnMount: false,
bounceOnMountDuration: 250,
disable: false,
};

Expand Down Expand Up @@ -246,10 +248,10 @@ export default class Swipeable extends PureComponent {
const {pan} = this.state;
pan.flattenOffset();

const {swipeReleaseAnimationFn, swipeReleaseAnimationConfig} = this.props;
const {swipeReleaseAnimationFn, swipeReleaseAnimationConfig, bounceOnMountDuration} = this.props;
Animated.timing(pan, {
toValue,
duration: 250,
duration: bounceOnMountDuration,
easing: Easing.elastic(0.5)
}).start(() => this.recenter(swipeReleaseAnimationFn, swipeReleaseAnimationConfig, () => onDone && onDone()));
};
Expand Down