AppBarConfiguration.Builder

public final class AppBarConfiguration.Builder


The Builder class for constructing new AppBarConfiguration instances.

Summary

Public constructors

Builder(NavGraph navGraph)

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

Builder(Menu topLevelMenu)

Create a new Builder using a Menu containing all top level destinations.

Builder(int topLevelDestinationIds)

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

Builder(Set<Integer> topLevelDestinationIds)

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

Public methods

final @NonNull AppBarConfiguration

Construct the AppBarConfiguration instance.

final @NonNull AppBarConfiguration.Builder

This method is deprecated. Use {@link #setOpenableLayout(Openable)}.

final @NonNull AppBarConfiguration.Builder

Adds a OnNavigateUpListener that will be called as a fallback if the default behavior of androidx.navigation.NavController.navigateUp returns false.

final @NonNull AppBarConfiguration.Builder
setOpenableLayout(Openable openableLayout)

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

Public constructors

Builder

public final 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.

Builder

public final Builder(Menu topLevelMenu)

Create a new Builder using a Menu containing all top level destinations. It is expected that the MenuItem.getItemId of each item corresponds with a destination in your navigation graph. The Up button will not be displayed when on these destinations.

Parameters