Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

AppBarConfiguration

public final class AppBarConfiguration
extends Object

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


Configuration options for NavigationUI methods that interact with implementations of the app bar pattern such as Toolbar, CollapsingToolbarLayout, and ActionBar.

Summary

Nested classes

class AppBarConfiguration.Builder

The Builder class for constructing new AppBarConfiguration instances. 

interface AppBarConfiguration.OnNavigateUpListener

Interface for providing custom 'up' behavior beyond what is provided by NavController.navigateUp()

Public methods

DrawerLayout getDrawerLayout()

The DrawerLayout indicating that the Navigation button should be displayed as a drawer symbol when it is not being shown as an Up button.

AppBarConfiguration.OnNavigateUpListener getFallbackOnNavigateUpListener()

The AppBarConfiguration.OnNavigateUpListener that should be invoked if NavController.navigateUp() returns false.

Set<Integer> getTopLevelDestinations()

The set of destinations by id considered at the top level of your information hierarchy.

Inherited methods

Public methods

getDrawerLayout

public DrawerLayout getDrawerLayout ()

The DrawerLayout indicating that the Navigation button should be displayed as a drawer symbol when it is not being shown as an Up button.

Returns
DrawerLayout The DrawerLayout that should be toggled from the Navigation button

getFallbackOnNavigateUpListener

public AppBarConfiguration.OnNavigateUpListener getFallbackOnNavigateUpListener ()

The AppBarConfiguration.OnNavigateUpListener that should be invoked if NavController.navigateUp() returns false.

Returns
AppBarConfiguration.OnNavigateUpListener a AppBarConfiguration.OnNavigateUpListener for providing custom up navigation logic, if one was set.

getTopLevelDestinations

public Set<Integer> getTopLevelDestinations ()

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
Set<Integer> The set of top level destinations by id.