类android.support.test.espresso.action.GeneralSwipeAction源码实例Demo

下面列出了怎么用android.support.test.espresso.action.GeneralSwipeAction的API类实例代码及写法,或者点击链接到github查看源代码。

/**
 * Fully customisable Swipe action for any need
 *
 * @param duration length of time a custom swipe should last for, in milliseconds.
 * @param from     for example [GeneralLocation.CENTER]
 * @param to       for example [GeneralLocation.BOTTOM_CENTER]
 */
public ViewAction swipeCustom(int duration, GeneralLocation from, GeneralLocation to) {
    CustomSwipe.CUSTOM.setSwipeDuration(duration);
    return actionWithAssertions(new GeneralSwipeAction(
            CustomSwipe.CUSTOM,
            translate(from, 0f, 0f),
            to,
            Press.FINGER)
    );
}
 
源代码2 项目: SwipeCoordinator   文件: ViewActions.java
static ViewAction swipeRightNotReachingThreshold(Context context) {
  final float x = getWidthScreen(context) * 0.3f;
  return new GeneralSwipeAction(Swipe.SLOW, GeneralLocation.TOP_LEFT, new CoordinatesProvider() {
    @Override public float[] calculateCoordinates(View view) {
      return new float[] {x, 0f};
    }
  }, Press.FINGER);
}
 
源代码3 项目: SwipeCoordinator   文件: ViewActions.java
static ViewAction swipeRightReachingThreshold(Context context) {
  final float x = getWidthScreen(context) * 0.8f;
  return new GeneralSwipeAction(Swipe.SLOW, GeneralLocation.TOP_LEFT, new CoordinatesProvider() {
    @Override public float[] calculateCoordinates(View view) {
      return new float[] {x, 0f};
    }
  }, Press.FINGER);
}
 
源代码4 项目: SwipeCoordinator   文件: ViewActions.java
static ViewAction swipeDownNotReachingThreshold(Context context) {
  final float y = getHeightScreen(context) * 0.3f;
  return new GeneralSwipeAction(Swipe.SLOW, GeneralLocation.TOP_LEFT, new CoordinatesProvider() {
    @Override public float[] calculateCoordinates(View view) {
      return new float[] {0f, y};
    }
  }, Press.FINGER);
}
 
源代码5 项目: SwipeCoordinator   文件: ViewActions.java
static ViewAction swipeDownReachingThreshold(Context context) {
  final float y = getHeightScreen(context) * 0.8f;
  return new GeneralSwipeAction(Swipe.SLOW, GeneralLocation.TOP_LEFT, new CoordinatesProvider() {
    @Override public float[] calculateCoordinates(View view) {
      return new float[] {0f, y};
    }
  }, Press.FINGER);
}
 
源代码6 项目: mobile-android-samples   文件: MapActivityTest.java
private static ViewAction swipe() {

        CoordinatesProvider start = GeneralLocation.TOP_CENTER;
        CoordinatesProvider end = GeneralLocation.BOTTOM_CENTER;
        return new GeneralSwipeAction(Swipe.SLOW, start, end, Press.FINGER);
    }
 
源代码7 项目: PrettyBundle   文件: ExtViewActions.java
public static ViewAction swipeTop() {
    return new GeneralSwipeAction(Swipe.FAST, GeneralLocation.BOTTOM_CENTER, GeneralLocation.TOP_CENTER, Press.FINGER);
}
 
源代码8 项目: PrettyBundle   文件: ExtViewActions.java
public static ViewAction swipeBottom() {
    return new GeneralSwipeAction(Swipe.FAST, GeneralLocation.TOP_CENTER, GeneralLocation.BOTTOM_CENTER, Press.FINGER);
}
 
源代码9 项目: agera   文件: MainActivityTest.java
private static ViewAction swipeDown() {
  return new GeneralSwipeAction(Swipe.FAST, GeneralLocation.TOP_CENTER,
      GeneralLocation.BOTTOM_CENTER, Press.FINGER);
}
 
源代码10 项目: agera   文件: MainActivityTest.java
private static ViewAction swipeDown() {
  return new GeneralSwipeAction(Swipe.FAST, GeneralLocation.TOP_CENTER,
      GeneralLocation.BOTTOM_CENTER, Press.FINGER);
}
 
源代码11 项目: u2020-mvp   文件: ViewActions.java
public static ViewAction swipeTop() {
    return new GeneralSwipeAction(Swipe.FAST, GeneralLocation.BOTTOM_CENTER, GeneralLocation.TOP_CENTER, Press.FINGER);
}
 
源代码12 项目: u2020-mvp   文件: ViewActions.java
public static ViewAction swipeBottom() {
    return new GeneralSwipeAction(Swipe.FAST, GeneralLocation.TOP_CENTER, GeneralLocation.BOTTOM_CENTER, Press.FINGER);
}
 
源代码13 项目: espresso-macchiato   文件: EspDrawer.java
/**
 * Open the drawer.
 *
 * @since Espresso Macchiato 0.1
 */
public void open() {
    findDrawerLayout().perform(ViewActions.actionWithAssertions(new GeneralSwipeAction(Swipe.FAST, GeneralLocation.CENTER_LEFT, GeneralLocation.CENTER_RIGHT, Press.FINGER)));
}
 
源代码14 项目: espresso-macchiato   文件: EspDrawer.java
/**
 * Close the drawer.
 *
 * @since Espresso Macchiato 0.1
 */
public void close() {
    findDrawerLayout().perform(ViewActions.actionWithAssertions(new GeneralSwipeAction(Swipe.FAST, GeneralLocation.CENTER_RIGHT, GeneralLocation.CENTER_LEFT, Press.FINGER)));
}
 
 类所在包
 同包方法