# DrawerMatchers

Summary:[Methods](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#)  

# DrawerMatchers

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
DrawerMatchers
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.test.espresso.contrib.DrawerMatchers |

<br />

*** ** * ** ***

Hamcrest matchers for a[DrawerLayout](https://developer.android.com/reference/android/support/v4/widget/DrawerLayout).

## Summary

|                                                                                                                                                      ### Public methods                                                                                                                                                      ||
|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | ` `[isClosed](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#isClosed())`() ` Returns a matcher that verifies that the drawer (with gravity START) is closed.                     |
| ` static Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | ` `[isClosed](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#isClosed(int))`(int gravity) ` Returns a matcher that verifies that the drawer with the specified gravity is closed. |
| ` static Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | ` `[isOpen](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#isOpen(int))`(int gravity) ` Returns a matcher that verifies that the drawer with the specified gravity is open.       |
| ` static Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | ` `[isOpen](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#isOpen())`() ` Returns a matcher that verifies that the drawer (with gravity START) is open.                           |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||

## Public methods

### isClosed

```
Matcher<View> isClosed ()
```

Returns a matcher that verifies that the drawer (with gravity START) is closed. Matches only when the drawer is fully closed. Use[isOpen()](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#isOpen())instead of`not(isClosed()))`when you wish to check that the drawer is fully open.

<br />

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| `Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | <br /> |

### isClosed

```
Matcher<View> isClosed (int gravity)
```

Returns a matcher that verifies that the drawer with the specified gravity is closed. Matches only when the drawer is fully closed. Use[isOpen(int)](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#isOpen(int))instead of`not(isClosed()))`when you wish to check that the drawer is fully open.

<br />

|       Parameters        ||
|-----------|--------------|
| `gravity` | `int` <br /> |

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| `Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | <br /> |

### isOpen

```
Matcher<View> isOpen (int gravity)
```

Returns a matcher that verifies that the drawer with the specified gravity is open. Matches only when the drawer is fully open. Use[isClosed(int)](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#isClosed(int))instead of`not(isOpen())`when you wish to check that the drawer is fully closed.

<br />

|       Parameters        ||
|-----------|--------------|
| `gravity` | `int` <br /> |

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| `Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | <br /> |

### isOpen

```
Matcher<View> isOpen ()
```

Returns a matcher that verifies that the drawer (with gravity START) is open. Matches only when the drawer is fully open. Use[isClosed()](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers#isClosed())instead of`not(isOpen())`when you wish to check that the drawer is fully closed.

<br />

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| `Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | <br /> |

-

  ## Interfaces

  - [RecyclerViewActions.PositionableRecyclerViewAction](https://developer.android.com/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction)
-

  ## Classes

  - [AccessibilityChecks](https://developer.android.com/reference/android/support/test/espresso/contrib/AccessibilityChecks)
  - [ActivityResultMatchers](https://developer.android.com/reference/android/support/test/espresso/contrib/ActivityResultMatchers)
  - [DrawerActions](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerActions)
  - [DrawerMatchers](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers)
  - [NavigationViewActions](https://developer.android.com/reference/android/support/test/espresso/contrib/NavigationViewActions)
  - [PickerActions](https://developer.android.com/reference/android/support/test/espresso/contrib/PickerActions)
  - [RecyclerViewActions](https://developer.android.com/reference/android/support/test/espresso/contrib/RecyclerViewActions)
  - [ViewPagerActions](https://developer.android.com/reference/android/support/test/espresso/contrib/ViewPagerActions)