# ActionBarDrawerToggle

Artifact: [androidx.appcompat:appcompat](https://developer.android.com/jetpack/androidx/releases/appcompat) [View Source](https://cs.android.com/search?q=file:androidx/appcompat/app/ActionBarDrawerToggle.java+class:androidx.appcompat.app.ActionBarDrawerToggle) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

*** ** * ** ***


```
class ActionBarDrawerToggle : DrawerLayout.DrawerListener
```

<br />

*** ** * ** ***

This class provides a handy way to tie together the functionality of `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout` and the framework `ActionBar` to implement the recommended design for navigation drawers.

To use `ActionBarDrawerToggle`, create one in your Activity and call through to the following methods corresponding to your Activity callbacks:

- `https://developer.android.com/reference/android/app/Activity.html#onConfigurationChanged(android.content.res.Configuration)`
- `https://developer.android.com/reference/android/app/Activity.html#onOptionsItemSelected(android.view.MenuItem)`

Call `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#syncState()` from your `Activity`'s `https://developer.android.com/reference/android/app/Activity.html#onPostCreate(android.os.Bundle)` to synchronize the indicator with the state of the linked DrawerLayout after `onRestoreInstanceState` has occurred.

`ActionBarDrawerToggle` can be used directly as a `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener`, or if you are already providing your own listener, call through to each of the listener methods from your own.

You can customize the the animated toggle by defining the drawerArrowStyle in your ActionBar theme.

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle.Delegate` |
| `interface https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle.DelegateProvider` Allows an implementing Activity to return an `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle.Delegate` to use with ActionBarDrawerToggle. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#ActionBarDrawerToggle(android.app.Activity,androidx.drawerlayout.widget.DrawerLayout,int,int)( activity: https://developer.android.com/reference/android/app/Activity.html!, drawerLayout: https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout!, openDrawerContentDescRes: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, closeDrawerContentDescRes: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Construct a new ActionBarDrawerToggle. |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#ActionBarDrawerToggle(android.app.Activity,androidx.drawerlayout.widget.DrawerLayout,androidx.appcompat.widget.Toolbar,int,int)( activity: https://developer.android.com/reference/android/app/Activity.html!, drawerLayout: https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout!, toolbar: https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar!, openDrawerContentDescRes: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, closeDrawerContentDescRes: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Construct a new ActionBarDrawerToggle with a Toolbar. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/graphics/drawable/DrawerArrowDrawable` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#getDrawerArrowDrawable()()` |
| `https://developer.android.com/reference/android/view/View.OnClickListener.html!` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#getToolbarNavigationClickListener()()` Returns the fallback listener for Navigation icon click events. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#isDrawerIndicatorEnabled()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#isDrawerSlideAnimationEnabled()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#onConfigurationChanged(android.content.res.Configuration)(newConfig: https://developer.android.com/reference/android/content/res/Configuration.html!)` This method should always be called by your `Activity`'s `https://developer.android.com/reference/android/app/Activity.html#onConfigurationChanged(android.content.res.Configuration)` method. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#onDrawerClosed(android.view.View)(drawerView: https://developer.android.com/reference/android/view/View.html!)` `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener` callback method. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#onDrawerOpened(android.view.View)(drawerView: https://developer.android.com/reference/android/view/View.html!)` `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener` callback method. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#onDrawerSlide(android.view.View,float)(drawerView: https://developer.android.com/reference/android/view/View.html!, slideOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener` callback method. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#onDrawerStateChanged(int)(newState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener` callback method. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#onOptionsItemSelected(android.view.MenuItem)(item: https://developer.android.com/reference/android/view/MenuItem.html!)` This method should be called by your `Activity`'s `https://developer.android.com/reference/android/app/Activity.html#onOptionsItemSelected(android.view.MenuItem)` method. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setDrawerArrowDrawable(androidx.appcompat.graphics.drawable.DrawerArrowDrawable)(drawable: https://developer.android.com/reference/kotlin/androidx/appcompat/graphics/drawable/DrawerArrowDrawable)` Sets the DrawerArrowDrawable that should be shown by this ActionBarDrawerToggle. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setDrawerIndicatorEnabled(boolean)(enable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Enable or disable the drawer indicator. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setDrawerSlideAnimationEnabled(boolean)(enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Specifies whether the drawer arrow should animate when the drawer position changes. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setHomeAsUpIndicator(android.graphics.drawable.Drawable)(indicator: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!)` Set the up indicator to display when the drawer indicator is not enabled. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setHomeAsUpIndicator(int)(resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set the up indicator to display when the drawer indicator is not enabled. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setToolbarNavigationClickListener(android.view.View.OnClickListener)( onToolbarNavigationClickListener: https://developer.android.com/reference/android/view/View.OnClickListener.html! )` When DrawerToggle is constructed with a Toolbar, it sets the click listener on the Navigation icon. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#syncState()()` Synchronize the state of the drawer indicator/affordance with the linked DrawerLayout. |

## Public constructors

### ActionBarDrawerToggle

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
ActionBarDrawerToggle(
    activity: Activity!,
    drawerLayout: DrawerLayout!,
    openDrawerContentDescRes: @StringRes Int,
    closeDrawerContentDescRes: @StringRes Int
)
```

Construct a new ActionBarDrawerToggle.

The given `https://developer.android.com/reference/android/app/Activity.html` will be linked to the specified `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout` and its Actionbar's Up button will be set to a custom drawable.

This drawable shows a Hamburger icon when drawer is closed and an arrow when drawer is open. It animates between these two states as the drawer opens.

String resources must be provided to describe the open/close drawer actions for accessibility services.

| Parameters |
|---|---|
| `activity: https://developer.android.com/reference/android/app/Activity.html!` | The Activity hosting the drawer. Should have an ActionBar. |
| `drawerLayout: https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout!` | The DrawerLayout to link to the given Activity's ActionBar |
| `openDrawerContentDescRes: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A String resource to describe the "open drawer" action for accessibility |
| `closeDrawerContentDescRes: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A String resource to describe the "close drawer" action for accessibility |

### ActionBarDrawerToggle

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
ActionBarDrawerToggle(
    activity: Activity!,
    drawerLayout: DrawerLayout!,
    toolbar: Toolbar!,
    openDrawerContentDescRes: @StringRes Int,
    closeDrawerContentDescRes: @StringRes Int
)
```

Construct a new ActionBarDrawerToggle with a Toolbar.

The given `https://developer.android.com/reference/android/app/Activity.html` will be linked to the specified `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout` and the Toolbar's navigation icon will be set to a custom drawable. Using this constructor will set Toolbar's navigation click listener to toggle the drawer when it is clicked.

This drawable shows a Hamburger icon when drawer is closed and an arrow when drawer is open. It animates between these two states as the drawer opens.

String resources must be provided to describe the open/close drawer actions for accessibility services.

Please use `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#ActionBarDrawerToggle(android.app.Activity,androidx.drawerlayout.widget.DrawerLayout,int,int)` if you are setting the Toolbar as the ActionBar of your activity.

| Parameters |
|---|---|
| `activity: https://developer.android.com/reference/android/app/Activity.html!` | The Activity hosting the drawer. |
| `drawerLayout: https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout!` | The DrawerLayout to link to the given Activity's ActionBar |
| `toolbar: https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar!` | The toolbar to use if you have an independent Toolbar. |
| `openDrawerContentDescRes: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A String resource to describe the "open drawer" action for accessibility |
| `closeDrawerContentDescRes: @https://developer.android.com/reference/kotlin/androidx/annotation/StringRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A String resource to describe the "close drawer" action for accessibility |

## Public functions

### getDrawerArrowDrawable

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun getDrawerArrowDrawable(): DrawerArrowDrawable
```

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/graphics/drawable/DrawerArrowDrawable` | DrawerArrowDrawable that is currently shown by the ActionBarDrawerToggle. |

### getToolbarNavigationClickListener

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun getToolbarNavigationClickListener(): View.OnClickListener!
```

Returns the fallback listener for Navigation icon click events.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/view/View.OnClickListener.html!` | The click listener which receives Navigation click events from Toolbar when drawer indicator is disabled. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setToolbarNavigationClickListener(android.view.View.OnClickListener)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setDrawerIndicatorEnabled(boolean)` |   |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#isDrawerIndicatorEnabled()` |   |

### isDrawerIndicatorEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun isDrawerIndicatorEnabled(): Boolean
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if the enhanced drawer indicator is enabled, false otherwise |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setDrawerIndicatorEnabled(boolean)` |   |

### isDrawerSlideAnimationEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun isDrawerSlideAnimationEnabled(): Boolean
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether the drawer slide animation is enabled |

### onConfigurationChanged

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun onConfigurationChanged(newConfig: Configuration!): Unit
```

This method should always be called by your `Activity`'s `https://developer.android.com/reference/android/app/Activity.html#onConfigurationChanged(android.content.res.Configuration)` method.

| Parameters |
|---|---|
| `newConfig: https://developer.android.com/reference/android/content/res/Configuration.html!` | The new configuration |

### onDrawerClosed

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun onDrawerClosed(drawerView: View!): Unit
```

`https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener` callback method. If you do not use your ActionBarDrawerToggle instance directly as your DrawerLayout's listener, you should call through to this method from your own listener object.

| Parameters |
|---|---|
| `drawerView: https://developer.android.com/reference/android/view/View.html!` | Drawer view that is now closed |

### onDrawerOpened

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun onDrawerOpened(drawerView: View!): Unit
```

`https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener` callback method. If you do not use your ActionBarDrawerToggle instance directly as your DrawerLayout's listener, you should call through to this method from your own listener object.

| Parameters |
|---|---|
| `drawerView: https://developer.android.com/reference/android/view/View.html!` | Drawer view that is now open |

### onDrawerSlide

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun onDrawerSlide(drawerView: View!, slideOffset: Float): Unit
```

`https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener` callback method. If you do not use your ActionBarDrawerToggle instance directly as your DrawerLayout's listener, you should call through to this method from your own listener object.

| Parameters |
|---|---|
| `drawerView: https://developer.android.com/reference/android/view/View.html!` | The child view that was moved |
| `slideOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The new offset of this drawer within its range, from 0-1 |

### onDrawerStateChanged

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun onDrawerStateChanged(newState: Int): Unit
```

`https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener` callback method. If you do not use your ActionBarDrawerToggle instance directly as your DrawerLayout's listener, you should call through to this method from your own listener object.

| Parameters |
|---|---|
| `newState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The new drawer motion state |

### onOptionsItemSelected

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun onOptionsItemSelected(item: MenuItem!): Boolean
```

This method should be called by your `Activity`'s `https://developer.android.com/reference/android/app/Activity.html#onOptionsItemSelected(android.view.MenuItem)` method. If it returns true, your `onOptionsItemSelected` method should return true and skip further processing.

| Parameters |
|---|---|
| `item: https://developer.android.com/reference/android/view/MenuItem.html!` | the MenuItem instance representing the selected menu item |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if the event was handled and further processing should not occur |

### setDrawerArrowDrawable

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun setDrawerArrowDrawable(drawable: DrawerArrowDrawable): Unit
```

Sets the DrawerArrowDrawable that should be shown by this ActionBarDrawerToggle.

| Parameters |
|---|---|
| `drawable: https://developer.android.com/reference/kotlin/androidx/appcompat/graphics/drawable/DrawerArrowDrawable` | DrawerArrowDrawable that should be shown by this ActionBarDrawerToggle |

### setDrawerIndicatorEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun setDrawerIndicatorEnabled(enable: Boolean): Unit
```

Enable or disable the drawer indicator. The indicator defaults to enabled.

When the indicator is disabled, the `ActionBar` will revert to displaying the home-as-up indicator provided by the `Activity`'s theme in the `android.R.attr.homeAsUpIndicator` attribute instead of the animated drawer glyph.

| Parameters |
|---|---|
| `enable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true to enable, false to disable |

### setDrawerSlideAnimationEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun setDrawerSlideAnimationEnabled(enabled: Boolean): Unit
```

Specifies whether the drawer arrow should animate when the drawer position changes.

| Parameters |
|---|---|
| `enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | if this is `true` then the animation will run, else it will be skipped |

### setHomeAsUpIndicator

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun setHomeAsUpIndicator(indicator: Drawable!): Unit
```

Set the up indicator to display when the drawer indicator is not enabled.

If you pass `null` to this method, the default drawable from the theme will be used.

| Parameters |
|---|---|
| `indicator: https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` | A drawable to use for the up indicator, or null to use the theme's default |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setDrawerIndicatorEnabled(boolean)` |   |

### setHomeAsUpIndicator

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun setHomeAsUpIndicator(resId: Int): Unit
```

Set the up indicator to display when the drawer indicator is not enabled.

If you pass 0 to this method, the default drawable from the theme will be used.

| Parameters |
|---|---|
| `resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Resource ID of a drawable to use for the up indicator, or 0 to use the theme's default |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setDrawerIndicatorEnabled(boolean)` |   |

### setToolbarNavigationClickListener

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun setToolbarNavigationClickListener(
    onToolbarNavigationClickListener: View.OnClickListener!
): Unit
```

When DrawerToggle is constructed with a Toolbar, it sets the click listener on the Navigation icon. If you want to listen for clicks on the Navigation icon when DrawerToggle is disabled (`https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setDrawerIndicatorEnabled(boolean)`, you should call this method with your listener and DrawerToggle will forward click events to that listener when drawer indicator is disabled.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBarDrawerToggle#setDrawerIndicatorEnabled(boolean)` |   |

### syncState

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun syncState(): Unit
```

Synchronize the state of the drawer indicator/affordance with the linked DrawerLayout.

This should be called from your `Activity`'s `https://developer.android.com/reference/android/app/Activity.html#onPostCreate(android.os.Bundle)` method to synchronize after the DrawerLayout's instance state has been restored, and any other time when the state may have diverged in such a way that the ActionBarDrawerToggle was not notified. (For example, if you stop forwarding appropriate drawer events for a period of time.)