A UiObject
is a representation of a view. It is
not in any way directly bound to a view as an object reference. A UiObject
contains information to help it locate a matching view at runtime based on the
UiSelector
properties specified in
its constructor. Once you create an instance of a UiObject, it can be reused for
different views that match the selector criteria.
Summary
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FINGER_TOUCH_HALF_WIDTH | ||||||||||
int | SWIPE_MARGIN_LIMIT | ||||||||||
long | WAIT_FOR_EVENT_TMEOUT |
This constant is deprecated.
use setScrollAcknowledgmentTimeout(long)
|
|||||||||
long | WAIT_FOR_SELECTOR_POLL | ||||||||||
long | WAIT_FOR_SELECTOR_TIMEOUT |
This constant is deprecated.
use setWaitForSelectorTimeout(long)
|
|||||||||
long | WAIT_FOR_WINDOW_TMEOUT |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a UiObject to represent a view that matches the specified
selector criteria.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clears the existing text contents in an editable field.
| |||||||||||
Performs a click at the center of the visible bounds of the UI element represented
by this UiObject.
| |||||||||||
Performs a click at the center of the visible bounds of the UI element represented
by this UiObject and waits for window transitions.
| |||||||||||
Waits for window transitions that would typically take longer than the
usual default timeouts.
| |||||||||||
Clicks the bottom and right corner of the UI element
| |||||||||||
Clicks the top and left corner of the UI element
| |||||||||||
Drags this object to a destination UiObject.
| |||||||||||
Drags this object to arbitrary coordinates.
| |||||||||||
Check if view exists.
| |||||||||||
Returns the view's
bounds property. | |||||||||||
Creates a new UiObject for a child view that is under the present UiObject.
| |||||||||||
Counts the child views immediately under the present UiObject.
| |||||||||||
Retrieves the
className property of the UI element. | |||||||||||
Reads the
content_desc property of the UI element | |||||||||||
Creates a new UiObject for a sibling view or a child of the sibling view,
relative to the present UiObject.
| |||||||||||
Reads the view's
package property | |||||||||||
Debugging helper.
| |||||||||||
Reads the
text property of the UI element | |||||||||||
Returns the visible bounds of the view.
| |||||||||||
Checks if the UI element's
checkable property is currently true. | |||||||||||
Check if the UI element's
checked property is currently true | |||||||||||
Checks if the UI element's
clickable property is currently true. | |||||||||||
Checks if the UI element's
enabled property is currently true. | |||||||||||
Check if the UI element's
focusable property is currently true. | |||||||||||
Check if the UI element's
focused property is currently true | |||||||||||
Check if the view's
long-clickable property is currently true | |||||||||||
Check if the view's
scrollable property is currently true | |||||||||||
Checks if the UI element's
selected property is currently true. | |||||||||||
Long clicks the center of the visible bounds of the UI element
| |||||||||||
Long clicks bottom and right corner of the UI element
| |||||||||||
Long clicks on the top and left corner of the UI element
| |||||||||||
Performs a multi-touch gesture.
| |||||||||||
Generates a two-pointer gesture with arbitrary starting and ending points.
| |||||||||||
Performs a two-pointer gesture, where each pointer moves diagonally
toward the other, from the edges to the center of this UiObject .
| |||||||||||
Performs a two-pointer gesture, where each pointer moves diagonally
opposite across the other, from the center out towards the edges of the
this UiObject.
| |||||||||||
Sets the text in an editable field, after clearing the field's content.
| |||||||||||
Performs the swipe down action on the UiObject.
| |||||||||||
Performs the swipe left action on the UiObject.
| |||||||||||
Performs the swipe right action on the UiObject.
| |||||||||||
Performs the swipe up action on the UiObject.
| |||||||||||
Waits a specified length of time for a view to become visible.
| |||||||||||
Waits a specified length of time for a view to become undetectable.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Finds a matching UI element in the accessibility hierarchy, by
using the selector for this UiObject.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|