AppBarConfigurationKt

public final class AppBarConfigurationKt


Summary

Public methods

static final @NonNull AppBarConfiguration
AppBarConfiguration(
    @NonNull NavGraph navGraph,
    @Nullable Openable drawerLayout,
    @NonNull Function0<@NonNull 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(
    @NonNull Menu topLevelMenu,
    @Nullable Openable drawerLayout,
    @NonNull Function0<@NonNull 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(
    @NonNull Set<@NonNull Integer> topLevelDestinationIds,
    @Nullable Openable drawerLayout,
    @NonNull Function0<@NonNull 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

@NonNull
public static final AppBarConfiguration AppBarConfiguration(
    @NonNull NavGraph navGraph,
    @Nullable Openable drawerLayout,
    @NonNull Function0<@NonNull 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
@NonNull 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.

@Nullable 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.

@NonNull Function0<@NonNull Boolean> fallbackOnNavigateUpListener

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

AppBarConfiguration

@NonNull
public static final AppBarConfiguration AppBarConfiguration(
    @NonNull Menu topLevelMenu,
    @Nullable Openable drawerLayout,
    @NonNull Function0<@NonNull 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
@NonNull 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.

@Nullable 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.

@NonNull Function0<@NonNull Boolean> fallbackOnNavigateUpListener

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

AppBarConfiguration

@NonNull
public static final AppBarConfiguration AppBarConfiguration(
    @NonNull Set<@NonNull Integer> topLevelDestinationIds,
    @Nullable Openable drawerLayout,
    @NonNull Function0<@NonNull 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
@NonNull Set<@NonNull 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.

@Nullable 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.

@NonNull Function0<@NonNull Boolean> fallbackOnNavigateUpListener

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