You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In SwipeRecognizer distance is calculated like this:
lastDistance = Math.abs(touch.getPageX() - x);
So, it is absolute value of difference between current position and position at swipe start.
My usecase:
Swipe direction is LEFT_TO_RIGHT. When I start swipeing to the right, SwipeMoveEvents are fired with distance increasing. I use that value to set left property of list item. Now, if I start moving back to the left and pass point where swipe started, because distance is calculated as absolute value, it looks like I'm moving to the right (see image below).
So, at the moment we can have SwipeMoveEvent fired with same distance value from two different positions.
What do you think, is it ok for distance to be negative then?
The text was updated successfully, but these errors were encountered:
In
SwipeRecognizer
distance is calculated like this:So, it is absolute value of difference between current position and position at swipe start.
My usecase:
Swipe direction is
LEFT_TO_RIGHT
. When I start swipeing to the right, SwipeMoveEvents are fired with distance increasing. I use that value to setleft
property of list item. Now, if I start moving back to the left and pass point where swipe started, because distance is calculated as absolute value, it looks like I'm moving to the right (see image below).So, at the moment we can have SwipeMoveEvent fired with same distance value from two different positions.
What do you think, is it ok for distance to be negative then?
The text was updated successfully, but these errors were encountered: