Comments (10)
Hi, I've tried setting sensitivity to 1 but it's not working for me on an android device. The touch event is incredibly difficult to trigger and requires me to press the list item a few times quickly to work.
It works perfectly on an iOS device.
The following is my renderRow code:
<Swipeout
scroll={event => this._allowScroll(event)}
sensitivity={1}
autoClose={true}
right={swipeoutButtons}>
<TouchableOpacity
style={styles.transaction}
key={rowData.id}
onPress={() => { this._goToScreen(rowData) }}>
<View style={styles.listItemContainer}
{...}
</View>
</TouchableOpacity>
</Swipeout>
react-native 0.40.0
Samsung Galaxy S6
Android 6.0.1
Anyone knows what I might have done wrong?
from react-native-swipeout.
@dancormier: would it make sense to add an onPress to the Swipeout component?
from react-native-swipeout.
The Swipeout onOpen function appears to be *** super *** sensitive on Android.
Is there any configuration for sensitivity?
I have to press a ListView row 4 or 5 times. I have to press very deliberate and straight and perpendicular to the tablet.
See:
#78
Using:
Android 6.0
Nexus 7 tablet
"react": "15.0.2",
"react-native": "^0.26.2",
[email protected]
from react-native-swipeout.
Using adb logacat, I can see that the _handlePanResponderGrant function gets called almost every time the ListView row is touched. Unless you press straight and quick ( not very easy ).
This seems to prevent the ListView row's onPress method being called. I assume until the gesture has ended?
https://github.com/dancormier/react-native-swipeout/blob/master/index.js
_handlePanResponderGrant: function(e: Object, gestureState: Object) {
console.log('_handlePanResponderGrant:', gestureState);
if(this.props.onOpen){
this.props.onOpen(this.props.sectionID, this.props.rowID);
}
this.refs.swipeoutContent.measure((ox, oy, width, height) => {
this.setState({
btnWidth: (width/5),
btnsLeftWidth: this.props.left ? (width/5)*this.props.left.length : 0,
btnsRightWidth: this.props.right ? (width/5)*this.props.right.length : 0,
swiping: true,
timeStart: (new Date()).getTime(),
});
});
},
Perhaps there is someway to de-bounce or de-sensitive PanResponder to make it not detect a PAN gesture so easily? Set a deltaX or deltaY threshold?
I cannot find anything in the react-native PanResponder documentation.
06-07 15:48:55.681 11603 12179 I ReactNativeJS: '_handlePanResponderGrant:', { stateID: 0.45550999348051846,
06-07 15:48:55.681 11603 12179 I ReactNativeJS: moveX: 482.1539611816406,
06-07 15:48:55.681 11603 12179 I ReactNativeJS: moveY: 87,
06-07 15:48:55.681 11603 12179 I ReactNativeJS: x0: 482.1539611816406,
06-07 15:48:55.681 11603 12179 I ReactNativeJS: y0: 87,
06-07 15:48:55.681 11603 12179 I ReactNativeJS: dx: 0,
06-07 15:48:55.681 11603 12179 I ReactNativeJS: dy: 0,
06-07 15:48:55.681 11603 12179 I ReactNativeJS: vx: -9.19479990933698e-7,
06-07 15:48:55.681 11603 12179 I ReactNativeJS: vy: 1.608545913133419e-7,
06-07 15:48:55.681 11603 12179 I ReactNativeJS: numberActiveTouches: 1,
https://facebook.github.io/react-native/docs/panresponder.html
from react-native-swipeout.
set sensitivity to 1, it works for me
from react-native-swipeout.
@chkchk Thank you!
I searched this repo for "sensitivity".
I see it being used but not referenced. How can sensitivity be doing anything?
I will give it a try anyway.
https://github.com/dancormier/react-native-swipeout
Props
Prop | Type | Optional | Default | Description |
---|---|---|---|---|
autoClose | bool | Yes | false | auto close on button press |
backgroundColor | string | Yes | '#dbddde' | |
close | bool | Yes | close swipeout | |
left | array | Yes | [] | swipeout buttons on left |
onOpen | func | Yes | ||
right | array | Yes | [] | swipeout buttons on right |
scroll | func | Yes | prevent parent scroll | |
style | style | Yes | style of the container | |
sensitivity | number | Yes | 0 | change the sensitivity of gesture |
from react-native-swipeout.
thanks @chkchk works for me too
from react-native-swipeout.
It works for me too nicely! Thanks
from react-native-swipeout.
Still hard to trigger onPress event of TouchableOpacity after set sensitivity to 1.
react-native 0.43.3
iPhone 6s
from react-native-swipeout.
I just published extension of Swipeout to make it works like Android behavior on Android.
Try this.
https://www.npmjs.com/package/react-native-swipeout-longpressforandroid
from react-native-swipeout.
Related Issues (20)
- Will setNativeProps works for external libraries as well?
- Out of memory error in Swipeout
- Tiny white space between buttons on IOS
- Touchable Opacity Not working after adding swipeout HOT 6
- How to change text dynamically HOT 2
- Calling setState with scroll scrollEnabled argument prevents the swipeoutButtons from opening HOT 1
- stuck problem when swipe
- openLeft/openRight not working HOT 2
- Wrong type exported.
- how to set fontsize HOT 1
- Expo doesn't like react-native-swipeout HOT 1
- Swipe disabled when using TouchableWithoutFeedback HOT 5
- 子条目点击事件和滑动事件怎么解决冲突 HOT 1
- the View in Swipeout can't swipe while swipe it HOT 1
- Swipe Left doesn't push the item it just covers it. HOT 12
- Suggestion to move to @react-native-community HOT 4
- Can I maintain this repository ? HOT 3
- Unsafe Component Warning HOT 2
- How can i change the animation speed of closing/opening animation?
- Is there any prop to autoclose the swipeout when I open another
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-swipeout.