当前位置: 首页>>代码示例>>Java>>正文


Java UiScrollable.scrollToEnd方法代码示例

本文整理汇总了Java中com.android.uiautomator.core.UiScrollable.scrollToEnd方法的典型用法代码示例。如果您正苦于以下问题:Java UiScrollable.scrollToEnd方法的具体用法?Java UiScrollable.scrollToEnd怎么用?Java UiScrollable.scrollToEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.uiautomator.core.UiScrollable的用法示例。


在下文中一共展示了UiScrollable.scrollToEnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testDownloadInfoDescription

import com.android.uiautomator.core.UiScrollable; //导入方法依赖的package包/类
/**
 * Tests whether the download info screen contains a non-empty description
 * TextView
 * 
 * @throws RemoteException
 * @throws UiObjectNotFoundException
 */
public void testDownloadInfoDescription() throws RemoteException,
		UiObjectNotFoundException {
	openDownloadInfoScreen();

	// scroll down
	UiScrollable scrollview = new UiScrollable(
			new UiSelector().className("android.widget.ScrollView"));
	scrollview.scrollToEnd(20);

	UiObject description = new UiObject(
			new UiSelector().description("Video description"));

	assertTrue("Description view doesn't exist", description.exists());
	assertTrue("Description view isn't enabled", description.isEnabled());
	assertEquals("Description view isn't a TextView",
			"android.widget.TextView", description.getClassName());
	assertFalse("Description is empty string", description.getText()
			.equals(""));
}
 
开发者ID:Tribler,项目名称:tribler-android,代码行数:27,代码来源:DownloadInfoUiTest.java

示例2: testVideoInfoDescription

import com.android.uiautomator.core.UiScrollable; //导入方法依赖的package包/类
/**
 * Tests whether the video info screen contains a non-empty description
 * TextView
 * 
 * @throws RemoteException
 * @throws UiObjectNotFoundException
 */
public void testVideoInfoDescription() throws RemoteException,
		UiObjectNotFoundException {
	openVideoInfoScreen();

	// scroll down
	UiScrollable scrollview = new UiScrollable(
			new UiSelector().className("android.widget.ScrollView"));
	scrollview.scrollToEnd(20);

	UiObject description = new UiObject(
			new UiSelector().description("Video description"));

	assertTrue("Description view doesn't exist", description.exists());
	assertTrue("Description view isn't enabled", description.isEnabled());
	assertEquals("Description view isn't a TextView",
			"android.widget.TextView", description.getClassName());
	assertFalse("Description is empty string", description.getText()
			.equals(""));
}
 
开发者ID:Tribler,项目名称:tribler-android,代码行数:27,代码来源:VideoInfoUiTest.java

示例3: handle

import com.android.uiautomator.core.UiScrollable; //导入方法依赖的package包/类
@Override
public Object handle(Object[] args) throws Exception {
    ScrollDirection scrollDirection = (ScrollDirection) args[0];
    UiElementPropertiesContainer propertiesContainer = (UiElementPropertiesContainer) args[1];
    UiSelector selector = UiSelectorParser.convertSelector(propertiesContainer);

    Integer maxSwipes = (Integer) args[2];
    Integer maxSteps = (Integer) args[3];
    Boolean isVertical = (Boolean) args[4];

    UiScrollable scrollableView = new UiScrollable(selector);

    if (!isVertical) {
        scrollableView.setAsHorizontalList();
    }

    Boolean response = false;

    if (maxSteps != 0) {
        switch (scrollDirection) {
            case SCROLL_TO_BEGINNING:
                response = scrollableView.scrollToBeginning(maxSwipes, maxSteps);
                break;
            case SCROLL_TO_END:
                response = scrollableView.scrollToEnd(maxSwipes, maxSteps);
                break;
            case SCROLL_BACKWARD:
                response = scrollableView.scrollBackward(maxSteps);
                break;
            case SCROLL_FORWARD:
                response = scrollableView.scrollForward(maxSteps);
                break;
            default:
                break;
        }
    } else {
        switch (scrollDirection) {
            case SCROLL_TO_BEGINNING:
                response = scrollableView.scrollToBeginning(maxSwipes);
                break;
            case SCROLL_TO_END:
                response = scrollableView.scrollToEnd(maxSwipes);
                break;
            case SCROLL_BACKWARD:
                response = scrollableView.scrollBackward();
                break;
            case SCROLL_FORWARD:
                response = scrollableView.scrollForward();
                break;
            default:
                break;
        }
    }

    return response;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-uiautomator-bridge,代码行数:57,代码来源:ScrollableViewDirectionScroller.java


注:本文中的com.android.uiautomator.core.UiScrollable.scrollToEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。