Skip to content

Commit

Permalink
add android support by removing overflow: visible dependency; resolves
Browse files Browse the repository at this point in the history
  • Loading branch information
jshanson7 committed Jan 15, 2017
1 parent 65b0374 commit df124c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# React Native Swipeable [![NPM version][npm-image]][npm-url]

A powerful React Native swipe component.
A powerful React Native swipe component. Supports both iOS and Android.

![Demo](demo.gif)

Expand Down Expand Up @@ -85,9 +85,10 @@ class MyListItem extends Component {
To run [the example](https://github.com/jshanson7/react-native-swipeable/blob/master/example/swipeable-example.js):

```sh
npm run build
cd example
npm install
react-native run-ios
react-native run-ios # or run-android
```

![Example](example/example.gif)
Expand Down
15 changes: 7 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,22 +622,21 @@ export default class Swipeable extends PureComponent {
extrapolate: 'clamp'
})
}];
const containerStyle = [{transform}, styles.container, style];

return (
<Animated.View onLayout={this._handleLayout} style={containerStyle} {...this._panResponder.panHandlers} {...props}>
<View onLayout={this._handleLayout} style={[styles.container, style]} {...this._panResponder.panHandlers} {...props}>
{canSwipeRight && (
<View style={[{marginLeft: -width, width}, leftContainerStyle]}>
<Animated.View style={[{transform, marginLeft: -width, width}, leftContainerStyle]}>
{leftContent || this._renderButtons(leftButtons, true)}
</View>
</Animated.View>
)}
<View style={[styles.content, contentContainerStyle]}>{children}</View>
<Animated.View style={[{transform}, styles.content, contentContainerStyle]}>{children}</Animated.View>
{canSwipeLeft && (
<View style={[{marginRight: -width, width}, rightContainerStyle]}>
<Animated.View style={[{transform, marginRight: -width, width}, rightContainerStyle]}>
{rightContent || this._renderButtons(rightButtons, false)}
</View>
</Animated.View>
)}
</Animated.View>
</View>
);
}
}
Expand Down

0 comments on commit df124c3

Please sign in to comment.