Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!

AppBarConfiguration.Builder

public static class AppBarConfiguration.Builder
extends Object

java.lang.Object
   ↳ androidx.navigation.ui.AppBarConfiguration.Builder


The Builder class for constructing new AppBarConfiguration instances.

Summary

Public constructors

AppBarConfiguration.Builder(NavGraph navGraph)

Create a new Builder whose only top level destination is the start destination of the given NavGraph.

AppBarConfiguration.Builder(int... topLevelDestinationIds)

Create a new Builder with a specific set of top level destinations.

AppBarConfiguration.Builder(Set<Integer> topLevelDestinationIds)

Create a new Builder with a specific set of top level destinations.

Public methods

AppBarConfiguration build()

Construct the AppBarConfiguration instance.

AppBarConfiguration.Builder setDrawerLayout(DrawerLayout drawerLayout)

Display the Navigation button as a drawer symbol when it is not being shown as an Up button.

Inherited methods

Public constructors

AppBarConfiguration.Builder

public AppBarConfiguration.Builder (NavGraph navGraph)

Create a new Builder whose only top level destination is the start destination of the given NavGraph. The Up button will not be displayed when on the start destination of the graph.

Parameters
navGraph NavGraph: The NavGraph whose start destination should be considered the only top level destination. The Up button will not be displayed when on the start destination of the graph.

AppBarConfiguration.Builder

public AppBarConfiguration.Builder (int... topLevelDestinationIds)

Create a new Builder with a specific set of top level destinations. The Up button will not be displayed when on these destinations.

Parameters
topLevelDestinationIds 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.

AppBarConfiguration.Builder

public AppBarConfiguration.Builder (Set<Integer> topLevelDestinationIds)

Create a new Builder with a specific set of top level destinations. The Up button will not be displayed when on these destinations.

Parameters
topLevelDestinationIds Set: 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.

Public methods

build

public AppBarConfiguration build ()

Construct the AppBarConfiguration instance.

Returns
AppBarConfiguration a valid AppBarConfiguration

setDrawerLayout

public AppBarConfiguration.Builder setDrawerLayout (DrawerLayout drawerLayout)

Display the Navigation button as a drawer symbol when it is not being shown as an Up button.

Parameters
drawerLayout DrawerLayout: The DrawerLayout that should be toggled from the Navigation button

Returns
AppBarConfiguration.Builder this AppBarConfiguration.Builder