本文整理汇总了Java中com.android.uiautomator.core.UiScrollable.setMaxSearchSwipes方法的典型用法代码示例。如果您正苦于以下问题:Java UiScrollable.setMaxSearchSwipes方法的具体用法?Java UiScrollable.setMaxSearchSwipes怎么用?Java UiScrollable.setMaxSearchSwipes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.uiautomator.core.UiScrollable
的用法示例。
在下文中一共展示了UiScrollable.setMaxSearchSwipes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clickOnText
import com.android.uiautomator.core.UiScrollable; //导入方法依赖的package包/类
public void clickOnText(String text, boolean scroll, int maxScrol)
throws UiObjectNotFoundException {
if (!scroll) {
clickOnText(text);
} else {
UiScrollable selScroll = new UiScrollable(new UiSelector());
try {
selScroll.setMaxSearchSwipes(maxScrol);
} catch (Exception e) {
//Do nothing
}
selScroll.scrollTextIntoView(text);
selScroll.waitForExists(DEFAULT_DELAY);
// Create the object
UiObject objScrollable = selScroll
.getChildByText(new UiSelector()
.className(Constants.TEXT_VIEW_CLASS), text);
if (objScrollable.exists()) {
// Click on object into the listView
objScrollable.click();
} else {
throw new UiObjectNotFoundException(
"There is no object on list or the list do not exists on window");
}
}
}
示例2: getListView
import com.android.uiautomator.core.UiScrollable; //导入方法依赖的package包/类
public static UiScrollable getListView() {
UiScrollable listItems = new UiScrollable(new UiSelector().className("android.widget.ListView"));
try {
listItems.setMaxSearchSwipes(10);
} catch (NoSuchMethodError e) {
log("setMaxSearchSwipes() not supported!!??");
}
return listItems;
}
示例3: getScrollView
import com.android.uiautomator.core.UiScrollable; //导入方法依赖的package包/类
public static UiScrollable getScrollView() {
UiScrollable scrollableLayout = new UiScrollable(new UiSelector().className("android.widget.ScrollView"));
try {
scrollableLayout.setMaxSearchSwipes(10);
} catch (NoSuchMethodError e) {
log("setMaxSearchSwipes() not supported!!??");
}
return scrollableLayout;
}