I find that in android.test.TouchUtils there is a drag method, I try it, but onfling() seems not react to this action. I also try robotium's scrollToSide(int), not working either. Any suggestions that how I can achieve this in my test case?
drag(float fromX, float toX, float fromY, float toY, int stepCount) in Robotium does work too, where as swipe and scrollToSide don't seem to work.
Using android.support.v4.view.ViewPager, following code works for me:
solo.drag(300,0,100,100,1);
I believe you could use MotionEvent class and it's obtain() method to simulate all kinds of swipe/touch gestures. Here's the first tutorial I found on this, it should get you started: http://softteco.blogspot.com/2011/02/touch-hold-swipe-release-gesture.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With