AppBarConfigurationKt

public final class AppBarConfigurationKt


Summary

Public methods

static final @NonNull AppBarConfiguration
AppBarConfiguration(
    NavGraph navGraph,
    Openable drawerLayout,
    Function0<Boolean> fallbackOnNavigateUpListener
)

Configuration options for NavigationUI methods that interact with implementations of the app bar pattern such as androidx.appcompat.widget.Toolbar, com.google.android.material.appbar.CollapsingToolbarLayout, and androidx.appcompat.app.ActionBar.

static final @NonNull AppBarConfiguration
AppBarConfiguration(
    Menu topLevelMenu,
    Openable drawerLayout,
    Function0<Boolean> fallbackOnNavigateUpListener
)

Configuration options for NavigationUI methods that interact with implementations of the app bar pattern such as androidx.appcompat.widget.Toolbar, com.google.android.material.appbar.CollapsingToolbarLayout, and androidx.appcompat.app.ActionBar.

static final @NonNull AppBarConfiguration
AppBarConfiguration(
    Set<Integer> topLevelDestinationIds,
    Openable drawerLayout,
    Function0<Boolean> fallbackOnNavigateUpListener
)

Configuration options for NavigationUI methods that interact with implementations of the app bar pattern such as androidx.appcompat.widget.Toolbar, com.google.android.material.appbar.CollapsingToolbarLayout, and androidx.appcompat.app.ActionBar.

Public methods

AppBarConfiguration

public static final @NonNull AppBarConfiguration AppBarConfiguration(
    NavGraph navGraph,
    Openable drawerLayout,
    Function0<Boolean> fallbackOnNavigateUpListener
)

Configuration options for NavigationUI methods that interact with implementations of the app bar pattern such as androidx.appcompat.widget.Toolbar, com.google.android.material.appbar.CollapsingToolbarLayout, and androidx.appcompat.app.ActionBar.

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.

Openable drawerLayout

The Openable layout that should be toggled from the Navigation button. The the Navigation button will show a drawer symbol when it is not being shown as an Up button.

Function0<Boolean> fallbackOnNavigateUpListener

Lambda that will be invoked if androidx.navigation.NavController.navigateUp returns false

AppBarConfiguration

public static final @NonNull AppBarConfiguration AppBarConfiguration(
    Menu topLevelMenu,
    Openable drawerLayout,
    Function0<Boolean> fallbackOnNavigateUpListener
)

Configuration options for NavigationUI methods that interact with implementations of the app bar pattern such as androidx.appcompat.widget.Toolbar, com.google.android.material.appbar.CollapsingToolbarLayout, and androidx.appcompat.app.ActionBar.

Parameters
Menu topLevelMenu

A Menu containing MenuItems corresponding with the destinations considered at the top level of your information hierarchy. The Up button will not be displayed when on these destinations.

Openable drawerLayout

The Openable layout that should be toggled from the Navigation button. The the Navigation button will show a drawer symbol when it is not being shown as an Up button.

Function0<Boolean> fallbackOnNavigateUpListener

Lambda that will be invoked if androidx.navigation.NavController.navigateUp returns false

AppBarConfiguration

public static final @NonNull AppBarConfiguration AppBarConfiguration(
    Set<Integer> topLevelDestinationIds,
    Openable drawerLayout,
    Function0<Boolean> fallbackOnNavigateUpListener
)

Configuration options for NavigationUI methods that interact with implementations of the app bar pattern such as androidx.appcompat.widget.Toolbar, com.google.android.material.appbar.CollapsingToolbarLayout, and androidx.appcompat.app.ActionBar.

Parameters
Set<Integer> topLevelDestinationIds

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.

Openable drawerLayout

The Openable layout that should be toggled from the Navigation button. The the Navigation button will show a drawer symbol when it is not being shown as an Up button.

Function0<Boolean> fallbackOnNavigateUpListener

Lambda that will be invoked if androidx.navigation.NavController.navigateUp returns false