-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add x,y coordinate support for swipe action #2432
Conversation
Implemented on iOS. Is this iOS only for now or will @d4vidi add impl for Android as well? |
I can get to it soon, should be fairly ez to set up |
Great, thanks! @d4vidi |
@d4vidi, @LeoNatan, need your advice regarding the swiped amount. Look at the difference between the current iOS and Android implementations. This happens because I calculate on Android the end coordinate not relative to the screen, but relative to the element itself. I have done that not really on purpose, just I was trying to follow the logic in the current Android implementation, and ended up in the place where I am. So, iOS and Android behavior here differs. What would be more correct behavior, what do you think? |
That's how it was on iOS too, but according to feedback, it had to be in screen coords. CC @viktorijasujetaite |
@LeoNatan, thanks. I've been suspecting something like that. 😳 |
How was it before your changes? The Espresso swipe…? |
If you need to write your own logic for the start and end points, you can copy the logic from the iOS side. The logic should be the same. |
detox/android/detox/src/test/java/com/wix/detox/espresso/scroll/SwipeHelperSpec.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/DetoxAction.java
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/DetoxAction.java
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/test/java/com/wix/detox/espresso/scroll/SwipeHelperSpec.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
Well @noomorph I'm sort of done reviewing this, for now - seems there's a lot to go over for now, so let's reiterate this when the time is right |
detox/android/detox/src/main/java/com/wix/detox/espresso/DetoxAction.java
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Show resolved
Hide resolved
detox/android/detox/src/test/java/com/wix/detox/espresso/scroll/SwiperHelperSpec.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/test/java/com/wix/detox/espresso/scroll/SwiperHelperSpec.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/test/java/com/wix/detox/espresso/scroll/SwiperHelperSpec.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/test/java/com/wix/detox/espresso/scroll/SwiperHelperSpec.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/utils/AgnosticPoint2D.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/utils/AgnosticPoint2D.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/scroll/SwipeHelper.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/main/java/com/wix/detox/espresso/utils/AgnosticPoint2D.kt
Outdated
Show resolved
Hide resolved
detox/android/detox/src/test/java/com/wix/detox/espresso/scroll/SwiperHelperSpec.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noomorph amazing work overall! I hope you don't mind me nitpicking here and there 😂 Anyways it's mostly naming that bothered me in my way of understanding the code, so most comments are in that area. Other than that seem pretty good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! It's great to see how eventually you've used the generic algebric constructs to calculate both the absolute and normalized starting point, and better yet - the ending point.
8de7aa6
to
6d0e5ef
Compare
swipe(direction, speed, percentage)
#2428 and the solution has been agreed upon with maintainers.fast=true/false, startPointX/Y=NaN/something, offset=NaN/0/0.5/1
testsDescription:
Signature:
Usage: