AppBarConfiguration
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 |
|---|
|
The Builder class for constructing new |
fun interface AppBarConfiguration.OnNavigateUpListenerInterface for providing custom 'up' behavior beyond what is provided by |
Public functions |
|
|---|---|
Boolean |
isTopLevelDestination(destination: NavDestination)Determines whether a |
Public properties |
|
|---|---|
DrawerLayout? |
The |
AppBarConfiguration.OnNavigateUpListener? |
The |
Openable? |
The |
Set<Int> |
The set of destinations by id considered at the top level of your information hierarchy. |
Public functions
isTopLevelDestination
fun isTopLevelDestination(destination: NavDestination): Boolean
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 | |
|---|---|
destination: NavDestination |
the |
Public properties
val drawerLayout: DrawerLayout?
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 |
fallbackOnNavigateUpListener
val fallbackOnNavigateUpListener: AppBarConfiguration.OnNavigateUpListener?
The OnNavigateUpListener that should be invoked if androidx.navigation.NavController.navigateUp returns false.
| Returns | |
|---|---|
AppBarConfiguration.OnNavigateUpListener? |
a |
openableLayout
val openableLayout: Openable?
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 |