Skip to content

Commit

Permalink
Removed custom PanResponder setup. Does not seem to affect ImageViewe…
Browse files Browse the repository at this point in the history
…r, perhaps becauser we have no children tap events we need to worry about. Fixed animationOutTiming constant.
  • Loading branch information
cameronvoell committed Aug 26, 2019
1 parent ec59c56 commit 9d3bbab
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions packages/components/src/mobile/image-viewer/index.native.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { View, PanResponder, Dimensions, ImageBackground, Image } from 'react-native';
import { View, Dimensions, ImageBackground, Image } from 'react-native';
import Modal from 'react-native-modal';

/**
Expand Down Expand Up @@ -72,25 +72,14 @@ class ImageViewer extends Component {
url = '',
} = this.props;

const panResponder = PanResponder.create( {
onMoveShouldSetPanResponder: ( evt, gestureState ) => {
// Activates swipe down over child Touchables if the swipe is long enough.
// With this we can adjust sensibility on the swipe vs tap gestures.
if ( gestureState.dy > 3 ) {
gestureState.dy = 0;
return true;
}
},
} );

return (
<Modal
isVisible={ isVisible }
style={ styles.modal }
animationIn={ 'fadeIn' }
animationInTiming={ 1000 }
animationOut={ 'fadeOut' }
animationOutTiming={ 1 }
animationOutTiming={ 250 }
backdropTransitionInTiming={ 50 }
backdropTransitionOutTiming={ 50 }
backdropOpacity={ 1 }
Expand All @@ -99,8 +88,6 @@ class ImageViewer extends Component {
onBackButtonPress={ this.props.onClose }
onSwipe={ this.props.onClose }
swipeDirection={ 'down' }
onMoveShouldSetResponder={ panResponder.panHandlers.onMoveShouldSetResponder }
onMoveShouldSetResponderCapture={ panResponder.panHandlers.onMoveShouldSetResponderCapture }
onAccessibilityEscape={ this.props.onClose }
>
<View style={ styles.content }>
Expand Down

0 comments on commit 9d3bbab

Please sign in to comment.