page.title=UiScrollable parent.title=uiautomator parent.link=index.html @jd:body
A UiCollection
that supports searching for items in scrollable layout elements. This class can
be used with horizontally or vertically scrollable controls.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.android.uiautomator.core.UiObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Performs a backwards fling action with the default number of fling
steps (5).
| |||||||||||
Performs a forward fling with the default number of fling steps (5).
| |||||||||||
Performs a fling gesture to reach the beginning of a scrollable layout element.
| |||||||||||
Performs a fling gesture to reach the end of a scrollable layout element.
| |||||||||||
Searches for a child element in the present scrollable container.
| |||||||||||
Searches for a child element in the present scrollable container.
| |||||||||||
Searches for a child element in the present scrollable container that
matches the selector you provided.
| |||||||||||
Searches for a child element in the present scrollable container.
| |||||||||||
Searches for a child element in the present scrollable
container.
| |||||||||||
Gets the maximum number of scrolls allowed when performing a
scroll action in search of a child element.
| |||||||||||
Returns the percentage of a widget's size that's considered as a no-touch
zone when swiping.
| |||||||||||
Performs a backward scroll.
| |||||||||||
Performs a backward scroll with the default number of scroll steps (55).
| |||||||||||
Performs a forward scroll action on the scrollable layout element until
the content-description is found, or until swipe attempts have been exhausted.
| |||||||||||
Performs a forward scroll with the default number of scroll steps (55).
| |||||||||||
Performs a forward scroll.
| |||||||||||
Perform a scroll forward action to move through the scrollable layout
element until a visible item that matches the selector is found.
| |||||||||||
Perform a forward scroll action to move through the scrollable layout element until
a visible item that matches the
UiObject is found. | |||||||||||
Performs a forward scroll action on the scrollable layout element until
the text you provided is visible, or until swipe attempts have been exhausted.
| |||||||||||
Scrolls to the beginning of a scrollable layout element.
| |||||||||||
Scrolls to the beginning of a scrollable layout element.
| |||||||||||
Scrolls to the end of a scrollable layout element.
| |||||||||||
Scrolls to the end of a scrollable layout element.
| |||||||||||
Set the direction of swipes to be horizontal when performing scroll actions.
| |||||||||||
Set the direction of swipes to be vertical when performing scroll actions.
| |||||||||||
Sets the maximum number of scrolls allowed when performing a
scroll action in search of a child element.
| |||||||||||
Sets the percentage of a widget's size that's considered as no-touch
zone when swiping.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Used privately when performing swipe searches to decide if an element has become
visible or not.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.android.uiautomator.core.UiCollection
| |||||||||||
From class
com.android.uiautomator.core.UiObject
| |||||||||||
From class
java.lang.Object
|
Constructor.
container | a UiSelector selector to identify the scrollable
layout element. |
---|
Performs a backwards fling action with the default number of fling steps (5). If the swipe direction is set to vertical, then the swipe will be performed from top to bottom. If the swipe direction is set to horizontal, then the swipes will be performed from left to right. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
UiObjectNotFoundException |
---|
Performs a forward fling with the default number of fling steps (5). If the swipe direction is set to vertical, then the swipes will be performed from bottom to top. If the swipe direction is set to horizontal, then the swipes will be performed from right to left. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
UiObjectNotFoundException |
---|
Performs a fling gesture to reach the beginning of a scrollable layout element. The beginning can be at the top-most edge in the case of vertical controls, or the left-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
UiObjectNotFoundException |
---|
Performs a fling gesture to reach the end of a scrollable layout element. The end can be at the bottom-most edge in the case of vertical controls, or the right-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
UiObjectNotFoundException |
---|
Searches for a child element in the present scrollable container. The search first looks for a child element that matches the selector you provided, then looks for the content-description in its children elements. If both search conditions are fulfilled, the method returns a {@ link UiObject} representing the element matching the selector (not the child element in its subhierarchy containing the content-description).
childPattern | UiSelector for a child in a scollable layout element |
---|---|
text | Content-description to find in the children of
the childPattern match (may be a partial match) |
allowScrollSearch | set to true if scrolling is allowed |
UiObject
representing the child element that matches the search conditionsUiObjectNotFoundException |
---|
Searches for a child element in the present scrollable container.
The search first looks for a child element that matches the selector
you provided, then looks for the content-description in its children elements.
If both search conditions are fulfilled, the method returns a {@ link UiObject}
representing the element matching the selector (not the child element in its
subhierarchy containing the content-description). By default, this method performs a
scroll search.
See getChildByDescription(UiSelector, String, boolean)
childPattern | UiSelector for a child in a scollable layout element |
---|---|
text | Content-description to find in the children of
the childPattern match |
UiObject
representing the child element that matches the search conditionsUiObjectNotFoundException |
---|
Searches for a child element in the present scrollable container that matches the selector you provided. The search is performed without scrolling and only on visible elements.
childPattern | UiSelector for a child in a scollable layout element |
---|---|
instance | int number representing the occurance of
a childPattern match |
UiObject
representing the child element that matches the search conditionsUiObjectNotFoundException |
---|
Searches for a child element in the present scrollable container. The search first looks for a child element that matches the selector you provided, then looks for the text in its children elements. If both search conditions are fulfilled, the method returns a {@ link UiObject} representing the element matching the selector (not the child element in its subhierarchy containing the text).
childPattern | UiSelector selector for a child in a scrollable layout element |
---|---|
text | String to find in the children of the childPattern match |
allowScrollSearch | set to true if scrolling is allowed |
UiObject
representing the child element that matches the search conditionsUiObjectNotFoundException |
---|
Searches for a child element in the present scrollable
container. The search first looks for a child element that matches the
selector you provided, then looks for the text in its children elements.
If both search conditions are fulfilled, the method returns a {@ link UiObject}
representing the element matching the selector (not the child element in its
subhierarchy containing the text). By default, this method performs a
scroll search.
See getChildByText(UiSelector, String, boolean)
childPattern | UiSelector selector for a child in a scrollable layout element |
---|---|
text | String to find in the children of the childPattern match |
UiObject
representing the child element that matches the search conditionsUiObjectNotFoundException |
---|
Gets the maximum number of scrolls allowed when performing a
scroll action in search of a child element.
See getChildByDescription(UiSelector, String)
and
getChildByText(UiSelector, String)
.
Returns the percentage of a widget's size that's considered as a no-touch zone when swiping. The no-touch zone is set as a percentage of a widget's total width or height, denoting a margin around the swipable area of the widget. Swipes must start and end inside this margin. This is important when the widget being swiped may not respond to the swipe if started at a point too near to the edge. The default is 10% from either edge.
Performs a backward scroll. If the swipe direction is set to vertical, then the swipes will be performed from top to bottom. If the swipe direction is set to horizontal, then the swipes will be performed from left to right. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
steps | number of steps. Use this to control the speed of the scroll action. |
---|
UiObjectNotFoundException |
---|
Performs a backward scroll with the default number of scroll steps (55). If the swipe direction is set to vertical, then the swipes will be performed from top to bottom. If the swipe direction is set to horizontal, then the swipes will be performed from left to right. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
UiObjectNotFoundException |
---|
Performs a forward scroll action on the scrollable layout element until
the content-description is found, or until swipe attempts have been exhausted.
See setMaxSearchSwipes(int)
text | content-description to find within the contents of this scrollable layout element. |
---|
UiObjectNotFoundException |
---|
Performs a forward scroll with the default number of scroll steps (55). If the swipe direction is set to vertical, then the swipes will be performed from bottom to top. If the swipe direction is set to horizontal, then the swipes will be performed from right to left. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
UiObjectNotFoundException |
---|
Performs a forward scroll. If the swipe direction is set to vertical, then the swipes will be performed from bottom to top. If the swipe direction is set to horizontal, then the swipes will be performed from right to left. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
steps | number of steps. Use this to control the speed of the scroll action |
---|
UiObjectNotFoundException |
---|
Perform a scroll forward action to move through the scrollable layout
element until a visible item that matches the selector is found.
See scrollDescriptionIntoView(String)
and scrollTextIntoView(String)
.
selector | UiSelector selector |
---|
UiObjectNotFoundException |
---|
Perform a forward scroll action to move through the scrollable layout element until
a visible item that matches the UiObject
is found.
obj | UiObject |
---|
UiObjectNotFoundException |
---|
Performs a forward scroll action on the scrollable layout element until
the text you provided is visible, or until swipe attempts have been exhausted.
See setMaxSearchSwipes(int)
text | test to look for |
---|
UiObjectNotFoundException |
---|
Scrolls to the beginning of a scrollable layout element. The beginning can be at the top-most edge in the case of vertical controls, or the left-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
UiObjectNotFoundException |
---|
Scrolls to the beginning of a scrollable layout element. The beginning can be at the top-most edge in the case of vertical controls, or the left-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
steps | use steps to control the speed, so that it may be a scroll, or fling |
---|
UiObjectNotFoundException |
---|
Scrolls to the end of a scrollable layout element. The end can be at the bottom-most edge in the case of vertical controls, or the right-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
steps | use steps to control the speed, so that it may be a scroll, or fling |
---|
UiObjectNotFoundException |
---|
Scrolls to the end of a scrollable layout element. The end can be at the bottom-most edge in the case of vertical controls, or the right-most edge for horizontal controls. Make sure to take into account devices configured with right-to-left languages like Arabic and Hebrew.
UiObjectNotFoundException |
---|
Set the direction of swipes to be horizontal when performing scroll actions.
Set the direction of swipes to be vertical when performing scroll actions.
Sets the maximum number of scrolls allowed when performing a
scroll action in search of a child element.
See getChildByDescription(UiSelector, String)
and
getChildByText(UiSelector, String)
.
swipes | the number of search swipes to perform until giving up |
---|
Sets the percentage of a widget's size that's considered as no-touch zone when swiping. The no-touch zone is set as percentage of a widget's total width or height, denoting a margin around the swipable area of the widget. Swipes must always start and end inside this margin. This is important when the widget being swiped may not respond to the swipe if started at a point too near to the edge. The default is 10% from either edge.
swipeDeadZonePercentage | is a value between 0 and 1 |
---|
Used privately when performing swipe searches to decide if an element has become visible or not.