AppBarConfiguration
public final class AppBarConfiguration
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.
Summary
Nested types |
|---|
public final class AppBarConfiguration.BuilderThe Builder class for constructing new |
public fun interface AppBarConfiguration.OnNavigateUpListenerInterface for providing custom 'up' behavior beyond what is provided by |
Public methods |
|
|---|---|
final DrawerLayout |
This method is deprecated. Use {@link #getOpenableLayout()}. |
final AppBarConfiguration.OnNavigateUpListener |
The |
final Openable |
The |
final @NonNull Set<@NonNull Integer> |
The set of destinations by id considered at the top level of your information hierarchy. |
final boolean |
isTopLevelDestination(@NonNull NavDestination destination)Determines whether a |
Public methods
public final DrawerLayoutgetDrawerLayout()
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 final AppBarConfiguration.OnNavigateUpListener getFallbackOnNavigateUpListener()
The OnNavigateUpListener that should be invoked if androidx.navigation.NavController.navigateUp returns false.
| Returns | |
|---|---|
AppBarConfiguration.OnNavigateUpListener |
a |
getOpenableLayout
public final Openable getOpenableLayout()
The Openable layout indicating that the Navigation button should be displayed as a drawer symbol when it is not being shown as an Up button.
| Returns | |
|---|---|
Openable |
The Openable layout that should be toggled from the Navigation button |
getTopLevelDestinations
public final @NonNull Set<@NonNull 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.
isTopLevelDestination
public final boolean isTopLevelDestination(@NonNull NavDestination destination)
Determines whether a NavDestination is a top level destination in AppBarConfiguration.
Returns true if the NavDestination was added directly as a top level destination via AppBarConfiguration.Builder constructors such as AppBarConfiguration.Builder(topLevelDestinationIds: Set<Int>). If destination was added with a AppBarConfiguration.Builder that could take in a graph, i.e. AppBarConfiguration.Builder(NavGraph) orAppBarConfiguration.Builder(Menu), this helper will return true if the destination is the start destination of a graph (including nested graphs i.e. MenuItem that are also NavGraph), or an individual MenuItem within the Menu.
| Parameters | |
|---|---|
@NonNull NavDestination destination |
the |