@Deprecated public class UiScrollable extends UiCollection
UiCollection
and provides support for searching
for items in scrollable layout elements. This class can be used with
horizontally or vertically scrollable controls.FINGER_TOUCH_HALF_WIDTH, SWIPE_MARGIN_LIMIT, WAIT_FOR_EVENT_TMEOUT, WAIT_FOR_SELECTOR_POLL, WAIT_FOR_SELECTOR_TIMEOUT, WAIT_FOR_WINDOW_TMEOUT
Constructor and Description |
---|
UiScrollable(UiSelector container)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
ensureFullyVisible(UiObject childObject)
Deprecated.
Scrolls forward until the UiObject is fully visible in the scrollable container.
|
protected boolean |
exists(UiSelector selector)
Deprecated.
Used privately when performing swipe searches to decide if an element has become
visible or not.
|
boolean |
flingBackward()
Deprecated.
Performs a backwards fling action with the default number of fling
steps (5).
|
boolean |
flingForward()
Deprecated.
Performs a forward fling with the default number of fling steps (5).
|
boolean |
flingToBeginning(int maxSwipes)
Deprecated.
Performs a fling gesture to reach the beginning of a scrollable layout element.
|
boolean |
flingToEnd(int maxSwipes)
Deprecated.
Performs a fling gesture to reach the end of a scrollable layout element.
|
UiObject |
getChildByDescription(UiSelector childPattern,
String text)
Deprecated.
Searches for a child element in the present scrollable container.
|
UiObject |
getChildByDescription(UiSelector childPattern,
String text,
boolean allowScrollSearch)
Deprecated.
Searches for a child element in the present scrollable container.
|
UiObject |
getChildByInstance(UiSelector childPattern,
int instance)
Deprecated.
Searches for a child element in the present scrollable container that
matches the selector you provided.
|
UiObject |
getChildByText(UiSelector childPattern,
String text)
Deprecated.
Searches for a child element in the present scrollable
container.
|
UiObject |
getChildByText(UiSelector childPattern,
String text,
boolean allowScrollSearch)
Deprecated.
Searches for a child element in the present scrollable container.
|
int |
getMaxSearchSwipes()
Deprecated.
Gets the maximum number of scrolls allowed when performing a
scroll action in search of a child element.
|
double |
getSwipeDeadZonePercentage()
Deprecated.
Returns the percentage of a widget's size that's considered as a no-touch
zone when swiping.
|
boolean |
scrollBackward()
Deprecated.
Performs a backward scroll with the default number of scroll steps (55).
|
boolean |
scrollBackward(int steps)
Deprecated.
Performs a backward scroll.
|
boolean |
scrollDescriptionIntoView(String text)
Deprecated.
Performs a forward scroll action on the scrollable layout element until
the content-description is found, or until swipe attempts have been exhausted.
|
boolean |
scrollForward()
Deprecated.
Performs a forward scroll with the default number of scroll steps (55).
|
boolean |
scrollForward(int steps)
Deprecated.
Performs a forward scroll.
|
boolean |
scrollIntoView(UiObject obj)
Deprecated.
Perform a forward scroll action to move through the scrollable layout element until
a visible item that matches the
UiObject is found. |
boolean |
scrollIntoView(UiSelector selector)
Deprecated.
Perform a scroll forward action to move through the scrollable layout
element until a visible item that matches the selector is found.
|
boolean |
scrollTextIntoView(String text)
Deprecated.
Performs a forward scroll action on the scrollable layout element until
the text you provided is visible, or until swipe attempts have been exhausted.
|
boolean |
scrollToBeginning(int maxSwipes)
Deprecated.
Scrolls to the beginning of a scrollable layout element.
|
boolean |
scrollToBeginning(int maxSwipes,
int steps)
Deprecated.
Scrolls to the beginning of a scrollable layout element.
|
boolean |
scrollToEnd(int maxSwipes)
Deprecated.
Scrolls to the end of a scrollable layout element.
|
boolean |
scrollToEnd(int maxSwipes,
int steps)
Deprecated.
Scrolls to the end of a scrollable layout element.
|
UiScrollable |
setAsHorizontalList()
Deprecated.
Set the direction of swipes to be horizontal when performing scroll actions.
|
UiScrollable |
setAsVerticalList()
Deprecated.
Set the direction of swipes to be vertical when performing scroll actions.
|
UiScrollable |
setMaxSearchSwipes(int swipes)
Deprecated.
Sets the maximum number of scrolls allowed when performing a
scroll action in search of a child element.
|
UiScrollable |
setSwipeDeadZonePercentage(double swipeDeadZonePercentage)
Deprecated.
Sets the percentage of a widget's size that's considered as no-touch
zone when swiping.
|
getChildCount
clearTextField, click, clickAndWaitForNewWindow, clickAndWaitForNewWindow, clickBottomRight, clickTopLeft, dragTo, dragTo, exists, findAccessibilityNodeInfo, getBounds, getChild, getChildCount, getClassName, getContentDescription, getFromParent, getPackageName, getSelector, getText, getVisibleBounds, isCheckable, isChecked, isClickable, isEnabled, isFocusable, isFocused, isLongClickable, isScrollable, isSelected, longClick, longClickBottomRight, longClickTopLeft, performMultiPointerGesture, performTwoPointerGesture, pinchIn, pinchOut, setText, swipeDown, swipeLeft, swipeRight, swipeUp, waitForExists, waitUntilGone
public UiScrollable(UiSelector container)
container
- a UiSelector
selector to identify the scrollable
layout element.public UiScrollable setAsVerticalList()
public UiScrollable setAsHorizontalList()
protected boolean exists(UiSelector selector)
selector
- public UiObject getChildByDescription(UiSelector childPattern, String text) throws UiObjectNotFoundException
getChildByDescription(UiSelector, String, boolean)
getChildByDescription
in class UiCollection
childPattern
- UiSelector
for a child in a scollable layout elementtext
- Content-description to find in the children of
the childPattern
matchUiObject
representing the child element that matches the search conditionsUiObjectNotFoundException
public UiObject getChildByDescription(UiSelector childPattern, String text, boolean allowScrollSearch) throws UiObjectNotFoundException
childPattern
- UiSelector
for a child in a scollable layout elementtext
- Content-description to find in the children of
the childPattern
match (may be a partial match)allowScrollSearch
- set to true if scrolling is allowedUiObject
representing the child element that matches the search conditionsUiObjectNotFoundException
public UiObject getChildByInstance(UiSelector childPattern, int instance) throws UiObjectNotFoundException
getChildByInstance
in class UiCollection
childPattern
- UiSelector
for a child in a scollable layout elementinstance
- int number representing the occurance of
a childPattern
matchUiObject
representing the child element that matches the search conditionsUiObjectNotFoundException
public UiObject getChildByText(UiSelector childPattern, String text) throws UiObjectNotFoundException
getChildByText(UiSelector, String, boolean)
getChildByText
in class UiCollection
childPattern
- UiSelector
selector for a child in a scrollable layout elementtext
- String to find in the children of the childPattern
matchUiObject
representing the child element that matches the search conditionsUiObjectNotFoundException
public UiObject getChildByText(UiSelector childPattern, String text, boolean allowScrollSearch) throws UiObjectNotFoundException
childPattern
- UiSelector
selector for a child in a scrollable layout elementtext
- String to find in the children of the childPattern
matchallowScrollSearch
- set to true if scrolling is allowedUiObject
representing the child element that matches the search conditionsUiObjectNotFoundException
public boolean scrollDescriptionIntoView(String text) throws UiObjectNotFoundException
setMaxSearchSwipes(int)
text
- content-description to find within the contents of this scrollable layout element.UiObjectNotFoundException
public boolean scrollIntoView(UiObject obj) throws UiObjectNotFoundException
UiObject
is found.obj
- UiObject
UiObjectNotFoundException
public boolean scrollIntoView(UiSelector selector) throws UiObjectNotFoundException
scrollDescriptionIntoView(String)
and scrollTextIntoView(String)
.selector
- UiSelector
selectorUiObjectNotFoundException
public boolean ensureFullyVisible(UiObject childObject) throws UiObjectNotFoundException
childObject
- UiObject
representing the child elementUiObjectNotFoundException
public boolean scrollTextIntoView(String text) throws UiObjectNotFoundException
setMaxSearchSwipes(int)
text
- test to look forUiObjectNotFoundException
public UiScrollable setMaxSearchSwipes(int swipes)
getChildByDescription(UiSelector, String)
and
getChildByText(UiSelector, String)
.swipes
- the number of search swipes to perform until giving uppublic int getMaxSearchSwipes()
getChildByDescription(UiSelector, String)
and
getChildByText(UiSelector, String)
.public boolean flingForward() throws UiObjectNotFoundException
UiObjectNotFoundException
public boolean scrollForward() throws UiObjectNotFoundException
UiObjectNotFoundException
public boolean scrollForward(int steps) throws UiObjectNotFoundException
steps
- number of steps. Use this to control the speed of the scroll actionUiObjectNotFoundException
public boolean flingBackward() throws UiObjectNotFoundException
UiObjectNotFoundException
public boolean scrollBackward() throws UiObjectNotFoundException
UiObjectNotFoundException
public boolean scrollBackward(int steps) throws UiObjectNotFoundException
steps
- number of steps. Use this to control the speed of the scroll action.UiObjectNotFoundException
public boolean scrollToBeginning(int maxSwipes, int steps) throws UiObjectNotFoundException
steps
- use steps to control the speed, so that it may be a scroll, or flingUiObjectNotFoundException
public boolean scrollToBeginning(int maxSwipes) throws UiObjectNotFoundException
maxSwipes
- UiObjectNotFoundException
public boolean flingToBeginning(int maxSwipes) throws UiObjectNotFoundException
maxSwipes
- UiObjectNotFoundException
public boolean scrollToEnd(int maxSwipes, int steps) throws UiObjectNotFoundException
steps
- use steps to control the speed, so that it may be a scroll, or flingUiObjectNotFoundException
public boolean scrollToEnd(int maxSwipes) throws UiObjectNotFoundException
maxSwipes
- UiObjectNotFoundException
public boolean flingToEnd(int maxSwipes) throws UiObjectNotFoundException
maxSwipes
- UiObjectNotFoundException
public double getSwipeDeadZonePercentage()
public UiScrollable setSwipeDeadZonePercentage(double swipeDeadZonePercentage)
swipeDeadZonePercentage
- is a value between 0 and 1