ViewPagerActions

public final class ViewPagerActions
extends Object

java.lang.Object
   ↳ androidx.test.espresso.contrib.ViewPagerActions


Espresso actions for interacting with a ViewPager.

Summary

Public methods

static ViewAction clickBetweenTwoTitles(String title1, String title2)

Clicks between two titles in a ViewPager title strip

static ViewAction scrollLeft(boolean smoothScroll)

Moves ViewPager to the left by one page.

static ViewAction scrollLeft()

Moves ViewPager to the left be one page.

static ViewAction scrollRight()

Moves ViewPager to the right be one page.

static ViewAction scrollRight(boolean smoothScroll)

Moves ViewPager to the right by one page.

static ViewAction scrollToFirst(boolean smoothScroll)

Moves ViewPager to the first page.

static ViewAction scrollToFirst()

Moves ViewPager to the first page.

static ViewAction scrollToLast(boolean smoothScroll)

Moves ViewPager to the last page.

static ViewAction scrollToLast()

Moves ViewPager to the last page.

static ViewAction scrollToPage(int page)

Moves ViewPager to a specific page.

static ViewAction scrollToPage(int page, boolean smoothScroll)

Moves ViewPager to specific page.

Inherited methods

Public methods

clickBetweenTwoTitles

public static ViewAction clickBetweenTwoTitles (String title1, 
                String title2)

Clicks between two titles in a ViewPager title strip

Parameters
title1 String

title2 String

Returns
ViewAction

scrollLeft

public static ViewAction scrollLeft (boolean smoothScroll)

Moves ViewPager to the left by one page.

Parameters
smoothScroll boolean

Returns
ViewAction

scrollLeft

public static ViewAction scrollLeft ()

Moves ViewPager to the left be one page.

Returns
ViewAction

scrollRight

public static ViewAction scrollRight ()

Moves ViewPager to the right be one page.

Returns
ViewAction

scrollRight

public static ViewAction scrollRight (boolean smoothScroll)

Moves ViewPager to the right by one page.

Parameters
smoothScroll boolean

Returns
ViewAction

scrollToFirst

public static ViewAction scrollToFirst (boolean smoothScroll)

Moves ViewPager to the first page.

Parameters
smoothScroll boolean

Returns
ViewAction

scrollToFirst

public static ViewAction scrollToFirst ()

Moves ViewPager to the first page.

Returns
ViewAction

scrollToLast

public static ViewAction scrollToLast (boolean smoothScroll)

Moves ViewPager to the last page.

Parameters
smoothScroll boolean

Returns
ViewAction

scrollToLast

public static ViewAction scrollToLast ()

Moves ViewPager to the last page.

Returns
ViewAction

scrollToPage

public static ViewAction scrollToPage (int page)

Moves ViewPager to a specific page.

Parameters
page int

Returns
ViewAction

scrollToPage

public static ViewAction scrollToPage (int page, 
                boolean smoothScroll)

Moves ViewPager to specific page.

Parameters
page int

smoothScroll boolean

Returns
ViewAction