namjae / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

Scroller.drag incorrect fromX/fromY/toX/toY usage #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I know the code for drag() is taken from TouchUtils, but it's probably easier 
to fix it here. Notice how the x and y used for the motion event are "fromX, y" 
rather than "fromX,fromY" or "toX,toY".

Current code:
http://github.com/jayway/robotium/blob/master/robotium-solo/src/main/java/com/ja
yway/android/robotium/solo/Scroller.java#L67
http://github.com/jayway/robotium/blob/master/robotium-solo/src/main/java/com/ja
yway/android/robotium/solo/Scroller.java#L86

 public void drag(float fromX, float toX, float fromY, float toY,
int stepCount) {
...
eventTime,MotionEvent.ACTION_DOWN, fromX, y, 0);
...
event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP,fromX, y, 
0);
}

Correct code:
eventTime,MotionEvent.ACTION_DOWN, fromX, fromY, 0);
...
event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP,toX, toY, 
0);

Original issue reported on code.google.com by androidc...@gmail.com on 12 Jun 2010 at 4:50

GoogleCodeExporter commented 9 years ago
This will be fixed in the next release. Thanks for pointing it out.

Original comment by renasr...@gmail.com on 13 Jun 2010 at 3:30

GoogleCodeExporter commented 9 years ago
Included in Robotium 1.6.0

Original comment by renasr...@gmail.com on 21 Jun 2010 at 8:18