# AppBarConfiguration

Artifact: [androidx.navigation:navigation-ui](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/ui/AppBarConfiguration.kt+class:androidx.navigation.ui.AppBarConfiguration) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigation#1.0.0)

*** ** * ** ***


```
class AppBarConfiguration
```

<br />

*** ** * ** ***

Configuration options for `https://developer.android.com/reference/kotlin/androidx/navigation/ui/NavigationUI` methods that interact with implementations of the app bar pattern such as `https://developer.android.com/reference/kotlin/androidx/appcompat/widget/Toolbar`, `https://developer.android.com/reference/com/google/android/material/appbar/CollapsingToolbarLayout.html`, and `https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar`.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration.Builder` The Builder class for constructing new `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration` instances. |
| `fun interface https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration.OnNavigateUpListener` Interface for providing custom 'up' behavior beyond what is provided by `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigateUp()`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration#isTopLevelDestination(androidx.navigation.NavDestination)(destination: https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination)` Determines whether a `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination` is a top level destination in `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration`. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout?` | `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration#drawerLayout()` **This property is deprecated.** Use {@link #getOpenableLayout()}. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration.OnNavigateUpListener?` | `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration#fallbackOnNavigateUpListener()` The `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration.OnNavigateUpListener` that should be invoked if `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigateUp()` returns `false`. |
| `https://developer.android.com/reference/kotlin/androidx/customview/widget/Openable?` | `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration#openableLayout()` The `https://developer.android.com/reference/kotlin/androidx/customview/widget/Openable` layout indicating that the Navigation button should be displayed as a drawer symbol when it is not being shown as an Up button. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>` | `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration#topLevelDestinations()` The set of destinations by id considered at the top level of your information hierarchy. |

## Public functions

### isTopLevelDestination

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

```
fun isTopLevelDestination(destination: NavDestination): Boolean
```

Determines whether a `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination` is a top level destination in `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration`.

Returns true if the `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination` was added directly as a top level destination via `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration.Builder` constructors such as `AppBarConfiguration.Builder(topLevelDestinationIds: Set<Int>)`. If destination was added with a `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration.Builder` that could take in a graph, i.e. `AppBarConfiguration.Builder(NavGraph)` or`AppBarConfiguration.Builder(Menu)`, this helper will return true if the destination is the start destination of a graph (including nested graphs i.e. `https://developer.android.com/reference/android/view/MenuItem.html` that are also `https://developer.android.com/reference/kotlin/androidx/navigation/NavGraph`), or an individual `https://developer.android.com/reference/android/view/MenuItem.html` within the `https://developer.android.com/reference/android/view/Menu.html`.

| Parameters |
|---|---|
| `destination: https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination` | the `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination` to check whether it is a topLevelDestination |

## Public properties

### drawerLayout

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigation#1.0.0) Deprecated in [2.3.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.3.0)

```
val drawerLayout: DrawerLayout?
```

> [!CAUTION]
> **This property is deprecated.**   
> Use {@link #getOpenableLayout()}.

The `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout` indicating that the Navigation button should be displayed as a drawer symbol when it is not being shown as an Up button.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout?` | The DrawerLayout that should be toggled from the Navigation button |

### fallbackOnNavigateUpListener

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

```
val fallbackOnNavigateUpListener: AppBarConfiguration.OnNavigateUpListener?
```

The `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration.OnNavigateUpListener` that should be invoked if `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigateUp()` returns `false`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration.OnNavigateUpListener?` | a `https://developer.android.com/reference/kotlin/androidx/navigation/ui/AppBarConfiguration.OnNavigateUpListener` for providing custom up navigation logic, if one was set. |

### openableLayout

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

```
val openableLayout: Openable?
```

The `https://developer.android.com/reference/kotlin/androidx/customview/widget/Openable` layout indicating that the Navigation button should be displayed as a drawer symbol when it is not being shown as an Up button.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/customview/widget/Openable?` | The Openable layout that should be toggled from the Navigation button |

### topLevelDestinations

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

```
val topLevelDestinations: Set<Int>
```

The set of destinations by id considered at the top level of your information hierarchy. The Up button will not be displayed when on these destinations.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>` | The set of top level destinations by id. |