Returns a matcher that verifies that the drawer (with gravity START) is closed. Matches only
when the drawer is fully closed. Use isOpen() instead of not(isClosed())) when
you wish to check that the drawer is fully open.
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) instead of not(isClosed())) when you wish to check that the drawer is fully open.
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) instead of not(isOpen())
when you wish to check that the drawer is fully closed.
Returns a matcher that verifies that the drawer (with gravity START) is open. Matches only when
the drawer is fully open. Use isClosed() instead of not(isOpen()) when you
wish to check that the drawer is fully closed.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DrawerMatchers\n\nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nDrawerMatchers\n==============\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\n\nfinal\n\nclass\nDrawerMatchers\n`\n\n\n`\n\nextends `[Object](https://developer.android.com/reference/java/lang/Object.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------------------------------------|\n| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||\n| ↳ | android.support.test.espresso.contrib.DrawerMatchers |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nHamcrest matchers for a [DrawerLayout](/reference/android/support/v4/widget/DrawerLayout).\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static Matcher\u003c`[View](https://developer.android.com/reference/android/view/View.html)`\u003e` | ` `[isClosed](/reference/android/support/test/espresso/contrib/DrawerMatchers#isClosed())`() ` Returns a matcher that verifies that the drawer (with gravity START) is closed. |\n| ` static Matcher\u003c`[View](https://developer.android.com/reference/android/view/View.html)`\u003e` | ` `[isClosed](/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. |\n| ` static Matcher\u003c`[View](https://developer.android.com/reference/android/view/View.html)`\u003e` | ` `[isOpen](/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. |\n| ` static Matcher\u003c`[View](https://developer.android.com/reference/android/view/View.html)`\u003e` | ` `[isOpen](/reference/android/support/test/espresso/contrib/DrawerMatchers#isOpen())`() ` Returns a matcher that verifies that the drawer (with gravity START) is open. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| 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)`\u003c?\u003e` | ` 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() ` | ||\n\nPublic methods\n--------------\n\n### isClosed\n\n```\nMatcher\u003cView\u003e isClosed ()\n```\n\nReturns a matcher that verifies that the drawer (with gravity START) is closed. Matches only\nwhen the drawer is fully closed. Use [isOpen()](/reference/android/support/test/espresso/contrib/DrawerMatchers#isOpen()) instead of `not(isClosed()))` when\nyou wish to check that the drawer is fully open.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------------------|--------|\n| `Matcher\u003c`[View](https://developer.android.com/reference/android/view/View.html)`\u003e` | \u003cbr /\u003e |\n\n### isClosed\n\n```\nMatcher\u003cView\u003e isClosed (int gravity)\n```\n\nReturns a matcher that verifies that the drawer with the specified gravity is closed. Matches\nonly when the drawer is fully closed. Use [isOpen(int)](/reference/android/support/test/espresso/contrib/DrawerMatchers#isOpen(int)) instead of `not(isClosed()))` when you wish to check that the drawer is fully open.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|--------------|\n| `gravity` | `int` \u003cbr /\u003e |\n\n| Returns ||\n|-------------------------------------------------------------------------------------|--------|\n| `Matcher\u003c`[View](https://developer.android.com/reference/android/view/View.html)`\u003e` | \u003cbr /\u003e |\n\n### isOpen\n\n```\nMatcher\u003cView\u003e isOpen (int gravity)\n```\n\nReturns a matcher that verifies that the drawer with the specified gravity is open. Matches\nonly when the drawer is fully open. Use [isClosed(int)](/reference/android/support/test/espresso/contrib/DrawerMatchers#isClosed(int)) instead of `not(isOpen())`\nwhen you wish to check that the drawer is fully closed.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|--------------|\n| `gravity` | `int` \u003cbr /\u003e |\n\n| Returns ||\n|-------------------------------------------------------------------------------------|--------|\n| `Matcher\u003c`[View](https://developer.android.com/reference/android/view/View.html)`\u003e` | \u003cbr /\u003e |\n\n### isOpen\n\n```\nMatcher\u003cView\u003e isOpen ()\n```\n\nReturns a matcher that verifies that the drawer (with gravity START) is open. Matches only when\nthe drawer is fully open. Use [isClosed()](/reference/android/support/test/espresso/contrib/DrawerMatchers#isClosed()) instead of `not(isOpen())` when you\nwish to check that the drawer is fully closed.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------------------|--------|\n| `Matcher\u003c`[View](https://developer.android.com/reference/android/view/View.html)`\u003e` | \u003cbr /\u003e |\n\n-\n\n Interfaces\n ----------\n\n - [RecyclerViewActions.PositionableRecyclerViewAction](/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction)\n-\n\n Classes\n -------\n\n - [AccessibilityChecks](/reference/android/support/test/espresso/contrib/AccessibilityChecks)\n - [ActivityResultMatchers](/reference/android/support/test/espresso/contrib/ActivityResultMatchers)\n - [DrawerActions](/reference/android/support/test/espresso/contrib/DrawerActions)\n - [DrawerMatchers](/reference/android/support/test/espresso/contrib/DrawerMatchers)\n - [NavigationViewActions](/reference/android/support/test/espresso/contrib/NavigationViewActions)\n - [PickerActions](/reference/android/support/test/espresso/contrib/PickerActions)\n - [RecyclerViewActions](/reference/android/support/test/espresso/contrib/RecyclerViewActions)\n - [ViewPagerActions](/reference/android/support/test/espresso/contrib/ViewPagerActions)"]]