Skip to content

Most visited

Recently visited

navigation

DrawerActions

public final class DrawerActions
extends Object

java.lang.Object
   ↳ android.support.test.espresso.contrib.DrawerActions


Espresso actions for using a DrawerLayout.

See also:

Summary

Public methods

static ViewAction close(int gravity)

Creates an action which closes the DrawerLayout with the gravity.

static ViewAction close()

Creates an action which closes the DrawerLayout with gravity START.

static void closeDrawer(int drawerLayoutId, int gravity)

This method is deprecated. Use open(int) with perform after matching a view. This method will be removed in the next release.

static void closeDrawer(int drawerLayoutId)

This method is deprecated. Use close() with perform after matching a view. This method will be removed in the next release.

static ViewAction open(int gravity)

Creates an action which opens the DrawerLayout drawer with the gravity.

static ViewAction open()

Creates an action which opens the DrawerLayout drawer with gravity START.

static void openDrawer(int drawerLayoutId)

This method is deprecated. Use open() with perform after matching a view. This method will be removed in the next release.

static void openDrawer(int drawerLayoutId, int gravity)

This method is deprecated. Use open(int) with perform after matching a view. This method will be removed in the next release.

Inherited methods

From class java.lang.Object

Public methods

close

ViewAction close (int gravity)

Creates an action which closes the DrawerLayout with the gravity. This method blocks until the drawer is fully closed. No operation if the drawer is already closed.

Parameters
gravity int
Returns
ViewAction

close

ViewAction close ()

Creates an action which closes the DrawerLayout with gravity START. This method blocks until the drawer is fully closed. No operation if the drawer is already closed.

Returns
ViewAction

closeDrawer

void closeDrawer (int drawerLayoutId, 
                int gravity)

This method is deprecated.
Use open(int) with perform after matching a view. This method will be removed in the next release.

Parameters
drawerLayoutId int
gravity int

closeDrawer

void closeDrawer (int drawerLayoutId)

This method is deprecated.
Use close() with perform after matching a view. This method will be removed in the next release.

Parameters
drawerLayoutId int

open

ViewAction open (int gravity)

Creates an action which opens the DrawerLayout drawer with the gravity. This method blocks until the drawer is fully open. No operation if the drawer is already open.

Parameters
gravity int
Returns
ViewAction

open

ViewAction open ()

Creates an action which opens the DrawerLayout drawer with gravity START. This method blocks until the drawer is fully open. No operation if the drawer is already open.

Returns
ViewAction

openDrawer

void openDrawer (int drawerLayoutId)

This method is deprecated.
Use open() with perform after matching a view. This method will be removed in the next release.

Parameters
drawerLayoutId int

openDrawer

void openDrawer (int drawerLayoutId, 
                int gravity)

This method is deprecated.
Use open(int) with perform after matching a view. This method will be removed in the next release.

Parameters
drawerLayoutId int
gravity int
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.