This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { requireNativeComponent, View } from 'react-native'; | |
| import ReboundRenderer from './ReboundRenderer'; | |
| const RNTableViewChildren = requireNativeComponent('RNTableViewChildren', null); | |
| const ROWS_FOR_RECYCLING = 20; | |
| export default class RecyclingListView extends Component { | |
| constructor(props) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var React = require('React'); | |
| var ReboundRenderer = React.createClass({ | |
| propTypes: { | |
| boundTo: React.PropTypes.number.isRequired, | |
| render: React.PropTypes.func.isRequired, | |
| }, | |
| shouldComponentUpdate: function(nextProps): boolean { | |
| return nextProps.boundTo !== this.props.boundTo; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Example extends Component { | |
| render() { | |
| return ( | |
| <View style={styles.container}> | |
| <Swipeable> | |
| <Card title='The Winds of Winter' /> | |
| </Swipeable> | |
| <Swipeable> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { PanResponder, View, Dimensions } from 'react-native'; | |
| const dragOffsetForTransparency = 0.8 * Dimensions.get('window').width; | |
| export default class Swipeable extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| containerOpacity: 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { PanResponder, View, Dimensions } from 'react-native'; | |
| const dragOffsetForTransparency = 0.8 * Dimensions.get('window').width; | |
| export default class Swipeable extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.panResponder = PanResponder.create({ | |
| onStartShouldSetPanResponder: (evt, gestureState) => true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import "RNSwipeableManager.h" | |
| #import "RNSwipeable.h" | |
| @implementation RNSwipeableManager | |
| RCT_EXPORT_MODULE() | |
| - (UIView *)view { | |
| return [[RNSwipeable alloc] init]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import "RNSwipeable.h" | |
| @interface RNSwipeable() | |
| @property (nonatomic, assign) CGPoint initialCenter; | |
| @property (nonatomic, assign) CGFloat dragOffsetForTransparency; | |
| @end | |
| @implementation RNSwipeable | |
| - (instancetype)init { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { requireNativeComponent } from 'react-native'; | |
| const RNSwipeable = requireNativeComponent('RNSwipeable', null); | |
| export default class Swipeable extends Component { | |
| render() { | |
| return ( | |
| <RNSwipeable> | |
| {this.props.children} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { PanResponder, Animated, View, Dimensions } from 'react-native'; | |
| const dragOffsetForTransparency = 0.8 * Dimensions.get('window').width; | |
| export default class Swipeable extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| containerTranslateX: new Animated.Value(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const _getContentOffset = Invoke.call(scrollComponent, 'contentOffset'); | |
| const {x, y} = await Invoke.execute(_getContentOffset); |