|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectio.selendroid.android.AndroidTouchScreen
public class AndroidTouchScreen
Implements touch capabilities of a device.
| Constructor Summary | |
|---|---|
AndroidTouchScreen(ServerInstrumentation instrumentation,
MotionSender motions)
|
|
| Method Summary | |
|---|---|
void |
doubleTap(Coordinates where)
Allows the execution of double tapon the screen, analogous to double click using a Mouse. |
void |
down(int x,
int y)
Allows the execution of the gesture 'down' on the screen. |
void |
flick(Coordinates where,
int xOffset,
int yOffset,
int speed)
Allows the execution of flick gestures starting in a location's element. |
void |
flick(int speedX,
int speedY)
Sends a flick gesture to the current view. |
float |
getBrightness()
|
void |
longPress(Coordinates where)
Allows the execution of long press gestures. |
void |
move(int x,
int y)
Allows the execution of the gesture 'move' on the screen. |
void |
performMultiPointerGesture(android.view.MotionEvent.PointerCoords[]... touches)
Performs a multi-touch gesture Takes a series of touch coordinates for at least 2 pointers. |
void |
performTwoPointerGesture(Point startPoint1,
Point startPoint2,
Point endPoint1,
Point endPoint2,
int steps)
Generates a two-pointer gesture with arbitrary starting and ending points. |
void |
scroll(Coordinates where,
int xOffset,
int yOffset)
Creates a scroll gesture that starts on a particular screen location. |
void |
scroll(int xOffset,
int yOffset)
Allows the view to be scrolled by an x and y offset. |
void |
setBrightness(float brightness)
Set the screen brightness, with a setting of 0 meaning that the screen should be turned off. |
void |
singleTap(Coordinates where)
Allows the execution of single tap on the screen, analogous to click using a Mouse. |
void |
up(int x,
int y)
Allows the execution of the gesture 'up' on the screen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AndroidTouchScreen(ServerInstrumentation instrumentation,
MotionSender motions)
| Method Detail |
|---|
public void singleTap(Coordinates where)
TouchScreen
singleTap in interface TouchScreenwhere - The location on the screen. Typically a WebElement
public void down(int x,
int y)
TouchScreen
down in interface TouchScreenx - The x coordinate relative to the viewporty - The y coordinate relative to the viewport
public void up(int x,
int y)
TouchScreen
up in interface TouchScreenx - The x coordinate relative to the viewporty - The y coordinate relative to the viewport
public void move(int x,
int y)
TouchScreen
move in interface TouchScreenx - The x coordinate relative to the viewporty - The y coordinate relative to the viewport
public void scroll(Coordinates where,
int xOffset,
int yOffset)
TouchScreen
scroll in interface TouchScreenwhere - the location where the scroll starts, usually a WebElement.xOffset - The x offset to scrollyOffset - The y offset to scrollpublic void doubleTap(Coordinates where)
TouchScreen
doubleTap in interface TouchScreenwhere - The coordinates of the element to double tappublic void longPress(Coordinates where)
TouchScreen
longPress in interface TouchScreenwhere - The coordinate of the element to long press
public void scroll(int xOffset,
int yOffset)
TouchScreen
scroll in interface TouchScreenxOffset - The horizontal offset relative to the viewportyOffset - The vertical offset relative to the viewport
public void flick(int speedX,
int speedY)
TouchScreen
flick in interface TouchScreenspeedX - The horizontal speed in pixels/secondspeedY - The vertical speed in pixels/second
public void flick(Coordinates where,
int xOffset,
int yOffset,
int speed)
TouchScreen
flick in interface TouchScreenwhere - The coordinate of the element to flick onxOffset - The x offset relative to the viewportyOffset - The y offset relative to the viewportpublic float getBrightness()
getBrightness in interface TouchScreenpublic void setBrightness(float brightness)
TouchScreen
setBrightness in interface TouchScreenbrightness - The screen brightness to use.
public void performTwoPointerGesture(Point startPoint1,
Point startPoint2,
Point endPoint1,
Point endPoint2,
int steps)
startPoint1 - start point of pointer 1startPoint2 - start point of pointer 2endPoint1 - end point of pointer 1endPoint2 - end point of pointer 2steps - the number of steps for the gesture. Steps are injected
about 5 milliseconds apart, so 100 steps may take around 0.5 seconds to complete.public void performMultiPointerGesture(android.view.MotionEvent.PointerCoords[]... touches)
MotionEvent.PointerCoords. By having the ability
to specify the touch points along the path of a pointer, the caller is able to specify
complex gestures like circles, irregular shapes etc, where each pointer may take a
different path.
To create a single point on a pointer's touch path
PointerCoords p = new PointerCoords();
p.x = stepX;
p.y = stepY;
p.pressure = 1;
p.size = 1;
touches - each array of MotionEvent.PointerCoords constitute a single pointer's touch path.
Multiple MotionEvent.PointerCoords arrays constitute multiple pointers, each with its own
path. Each MotionEvent.PointerCoords in an array constitute a point on a pointer's path.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||