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


Java UiScrollable.setAsVerticalList方法代码示例

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


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

示例1: turnOnAccessibilityPermission

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
public static void turnOnAccessibilityPermission() throws UiObjectNotFoundException {
    UiScrollable texterScreen = new UiScrollable(LauncherHelper.LAUNCHER_CONTAINER);
    texterScreen.setAsVerticalList();

    UiObject permission = new UiObject(
            new UiSelector().text("Off"));

    permission.click();

    UiScrollable permissionScreen = new UiScrollable(LauncherHelper.LAUNCHER_CONTAINER);
    permissionScreen.setAsVerticalList();

    UiObject permissionButton = new UiObject(
            new UiSelector().text("OK"));

    permissionButton.click();
}
 
开发者ID:bhubie,项目名称:Expander,代码行数:18,代码来源:TestUtils.java

示例2: scrollToAndClickAccessibilitySettingForApp

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
public static void scrollToAndClickAccessibilitySettingForApp() throws UiObjectNotFoundException {

        mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());

        UiScrollable accessibilityScreen = new UiScrollable(LauncherHelper.LAUNCHER_CONTAINER);
        accessibilityScreen.setAsVerticalList();
        accessibilityScreen.scrollTextIntoView(APPLICATION_NAME);

        UiObject expanderApp = new UiObject(
                new UiSelector().text(APPLICATION_NAME));


            expanderApp.click();

    }
 
开发者ID:bhubie,项目名称:Expander,代码行数:16,代码来源:TestUtils.java

示例3: turnOffAccessibliyPermission

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
public static void turnOffAccessibliyPermission() throws UiObjectNotFoundException {
    UiScrollable texterScreen = new UiScrollable(LauncherHelper.LAUNCHER_CONTAINER);
    texterScreen.setAsVerticalList();

    UiObject permission = new UiObject(
            new UiSelector().text("On"));

    permission.click();

    UiObject permissionButton = new UiObject(
            new UiSelector().text("OK"));

    permissionButton.click();

}
 
开发者ID:bhubie,项目名称:Expander,代码行数:16,代码来源:TestUtils.java

示例4: flingBackward

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
/**
 * 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.
 *
 * @param obj        the selector of the scrollable object
 * @param isVertical vertical or horizontal
 * @return true if scrolled, and false if can't scroll anymore
 * @throws android.support.test.uiautomator.UiObjectNotFoundException
 */
@Override
public boolean flingBackward(Selector obj, boolean isVertical) throws UiObjectNotFoundException {
    UiScrollable scrollable = new UiScrollable(obj.toUiSelector());
    if (isVertical) scrollable.setAsVerticalList();
    else scrollable.setAsHorizontalList();
    return scrollable.flingBackward();
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:16,代码来源:AutomatorServiceImpl.java

示例5: flingForward

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
/**
 * 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.
 *
 * @param obj        the selector of the scrollable object
 * @param isVertical vertical or horizontal
 * @return true if scrolled, and false if can't scroll anymore
 * @throws android.support.test.uiautomator.UiObjectNotFoundException
 */
@Override
public boolean flingForward(Selector obj, boolean isVertical) throws UiObjectNotFoundException {
    UiScrollable scrollable = new UiScrollable(obj.toUiSelector());
    if (isVertical) scrollable.setAsVerticalList();
    else scrollable.setAsHorizontalList();
    return scrollable.flingForward();
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:16,代码来源:AutomatorServiceImpl.java

示例6: flingToBeginning

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
/**
 * 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.
 *
 * @param obj        the selector of the scrollable object
 * @param isVertical vertical or horizontal
 * @param maxSwipes  max swipes to achieve beginning.
 * @return true on scrolled, else false
 * @throws android.support.test.uiautomator.UiObjectNotFoundException
 */
@Override
public boolean flingToBeginning(Selector obj, boolean isVertical, int maxSwipes) throws UiObjectNotFoundException {
    UiScrollable scrollable = new UiScrollable(obj.toUiSelector());
    if (isVertical) scrollable.setAsVerticalList();
    else scrollable.setAsHorizontalList();
    return scrollable.flingToBeginning(maxSwipes);
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:17,代码来源:AutomatorServiceImpl.java

示例7: flingToEnd

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
/**
 * 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.
 *
 * @param obj        the selector of the scrollable object
 * @param isVertical vertical or horizontal
 * @param maxSwipes  max swipes to achieve end.
 * @return true on scrolled, else false
 * @throws android.support.test.uiautomator.UiObjectNotFoundException
 */
@Override
public boolean flingToEnd(Selector obj, boolean isVertical, int maxSwipes) throws UiObjectNotFoundException {
    UiScrollable scrollable = new UiScrollable(obj.toUiSelector());
    if (isVertical) scrollable.setAsVerticalList();
    else scrollable.setAsHorizontalList();
    return scrollable.flingToEnd(maxSwipes);
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:17,代码来源:AutomatorServiceImpl.java

示例8: scrollBackward

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
/**
 * 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.
 *
 * @param obj        the selector of the scrollable object
 * @param isVertical vertical or horizontal
 * @param steps      number of steps. Use this to control the speed of the scroll action.
 * @return true if scrolled, false if can't scroll anymore
 * @throws android.support.test.uiautomator.UiObjectNotFoundException
 */
@Override
public boolean scrollBackward(Selector obj, boolean isVertical, int steps) throws UiObjectNotFoundException {
    UiScrollable scrollable = new UiScrollable(obj.toUiSelector());
    if (isVertical) scrollable.setAsVerticalList();
    else scrollable.setAsHorizontalList();
    return scrollable.scrollBackward(steps);
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:17,代码来源:AutomatorServiceImpl.java

示例9: scrollForward

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
/**
 * 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.
 *
 * @param obj        the selector of the scrollable object
 * @param isVertical vertical or horizontal
 * @param steps      number of steps. Use this to control the speed of the scroll action.
 * @return true on scrolled, else false
 * @throws android.support.test.uiautomator.UiObjectNotFoundException
 */
@Override
public boolean scrollForward(Selector obj, boolean isVertical, int steps) throws UiObjectNotFoundException {
    UiScrollable scrollable = new UiScrollable(obj.toUiSelector());
    if (isVertical) scrollable.setAsVerticalList();
    else scrollable.setAsHorizontalList();
    return scrollable.scrollForward(steps);
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:17,代码来源:AutomatorServiceImpl.java

示例10: scrollToBeginning

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
/**
 * 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.
 *
 * @param obj        the selector of the scrollable object
 * @param isVertical vertical or horizontal
 * @param maxSwipes  max swipes to be performed.
 * @param steps      use steps to control the speed, so that it may be a scroll, or fling
 * @return true on scrolled else false
 * @throws android.support.test.uiautomator.UiObjectNotFoundException
 */
@Override
public boolean scrollToBeginning(Selector obj, boolean isVertical, int maxSwipes, int steps) throws UiObjectNotFoundException {
    UiScrollable scrollable = new UiScrollable(obj.toUiSelector());
    if (isVertical) scrollable.setAsVerticalList();
    else scrollable.setAsHorizontalList();
    return scrollable.scrollToBeginning(maxSwipes, steps);
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:18,代码来源:AutomatorServiceImpl.java

示例11: scrollToEnd

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
/**
 * 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.
 *
 * @param obj        the selector of the scrollable object
 * @param isVertical vertical or horizontal
 * @param maxSwipes  max swipes to be performed.
 * @param steps      use steps to control the speed, so that it may be a scroll, or fling
 * @return true on scrolled, else false
 * @throws android.support.test.uiautomator.UiObjectNotFoundException
 */
@Override
public boolean scrollToEnd(Selector obj, boolean isVertical, int maxSwipes, int steps) throws UiObjectNotFoundException {
    UiScrollable scrollable = new UiScrollable(obj.toUiSelector());
    if (isVertical) scrollable.setAsVerticalList();
    else scrollable.setAsHorizontalList();
    return scrollable.scrollToEnd(maxSwipes, steps);
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:18,代码来源:AutomatorServiceImpl.java

示例12: scrollTo

import android.support.test.uiautomator.UiScrollable; //导入方法依赖的package包/类
/**
 * Perform a scroll forward action to move through the scrollable layout element until a visible item that matches the selector is found.
 *
 * @param obj        the selector of the scrollable object
 * @param targetObj  the item matches the selector to be found.
 * @param isVertical vertical or horizontal
 * @return true on scrolled, else false
 * @throws android.support.test.uiautomator.UiObjectNotFoundException
 */
@Override
public boolean scrollTo(Selector obj, Selector targetObj, boolean isVertical) throws UiObjectNotFoundException {
    UiScrollable scrollable = new UiScrollable(obj.toUiSelector());
    if (isVertical) scrollable.setAsVerticalList();
    else scrollable.setAsHorizontalList();
    return scrollable.scrollIntoView(targetObj.toUiSelector());
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:17,代码来源:AutomatorServiceImpl.java


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