# DrawerMatchers

Artifact: [androidx.test.espresso:espresso-contrib](https://developer.android.com/jetpack/androidx/releases/test-espresso) [View Source](https://cs.android.com/search?q=file:androidx/test/espresso/contrib/DrawerMatchers.java+class:androidx.test.espresso.contrib.DrawerMatchers)

*** ** * ** ***


```
public final class DrawerMatchers
```

<br />

*** ** * ** ***

Hamcrest matchers for a `https://developer.android.com/reference/androidx/drawerlayout/widget/DrawerLayout`.

## Summary

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

## Public methods

### isClosed

```
public static 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 `https://developer.android.com/reference/androidx/test/espresso/contrib/DrawerMatchers#isOpen()` instead of `not(isClosed()))` when you wish to check that the drawer is fully open.

### isClosed

```
public static 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 `https://developer.android.com/reference/androidx/test/espresso/contrib/DrawerMatchers#isOpen(int)` instead of `
not(isClosed()))` when you wish to check that the drawer is fully open.

### isOpen

```
public static 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 `https://developer.android.com/reference/androidx/test/espresso/contrib/DrawerMatchers#isClosed()` instead of `not(isOpen())` when you wish to check that the drawer is fully closed.

### isOpen

```
public static 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 `https://developer.android.com/reference/androidx/test/espresso/contrib/DrawerMatchers#isClosed(int)` instead of `not(isOpen())` when you wish to check that the drawer is fully closed.