androidx.navigation.ui
Interfaces
OnNavigateUpListener |
Interface for providing custom 'up' behavior beyond what is provided by |
Classes
AppBarConfiguration |
Configuration options for |
NavigationUI |
Class which hooks up elements typically in the 'chrome' of your application such as global navigation patterns like a navigation drawer or bottom nav bar with your |
Top-level functions summary
Extension functions summary
For android.view.MenuItem | |
Boolean |
Attempt to navigate to the NavDestination associated with this MenuItem. |
For androidx.appcompat.app.AppCompatActivity | |
Unit |
Sets up the ActionBar returned by AppCompatActivity.getSupportActionBar for use with a NavController. |
Unit |
AppCompatActivity.setupActionBarWithNavController(: NavController, : AppBarConfiguration = AppBarConfiguration(navController.graph)) Sets up the ActionBar returned by AppCompatActivity.getSupportActionBar for use with a NavController. |
For androidx.appcompat.widget.Toolbar | |
Unit |
Sets up a Toolbar for use with a NavController. |
Unit |
Toolbar.setupWithNavController(: NavController, : AppBarConfiguration = AppBarConfiguration(navController.graph)) Sets up a Toolbar for use with a NavController. |
For com.google.android.material.appbar.CollapsingToolbarLayout | |
Unit |
CollapsingToolbarLayout.setupWithNavController(: Toolbar, : NavController, : DrawerLayout?) Sets up a CollapsingToolbarLayout and Toolbar for use with a NavController. |
Unit |
CollapsingToolbarLayout.setupWithNavController(: Toolbar, : NavController, : AppBarConfiguration = AppBarConfiguration(navController.graph)) Sets up a CollapsingToolbarLayout and Toolbar for use with a NavController. |
For com.google.android.material.bottomnavigation.BottomNavigationView | |
Unit |
BottomNavigationView.setupWithNavController(: NavController) Sets up a BottomNavigationView for use with a NavController. |
For com.google.android.material.navigation.NavigationView | |
Unit |
NavigationView.setupWithNavController(: NavController) Sets up a NavigationView for use with a NavController. |
For NavController | |
Boolean |
Handles the Up button by delegating its behavior to the given NavController. |
Boolean |
Handles the Up button by delegating its behavior to the given NavController. |
Top-level functions
AppBarConfiguration
inline fun AppBarConfiguration(
: NavGraph,
: Openable? = null,
noinline : () -> Boolean = { false }
): 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.
Parameters | |
---|---|
: 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? = null | 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. |
: () -> Boolean = { false } | Lambda that will be invoked if
androidx.navigation.NavController.navigateUp returns false |
AppBarConfiguration
inline fun AppBarConfiguration(
: Menu,
: Openable? = null,
noinline : () -> Boolean = { false }
): 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.
Parameters | |
---|---|
: Menu | 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? = null | 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. |
: () -> Boolean = { false } | Lambda that will be invoked if
androidx.navigation.NavController.navigateUp returns false |
AppBarConfiguration
inline fun AppBarConfiguration(
: Set<Int>,
: Openable? = null,
noinline : () -> Boolean = { false }
): 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.
Parameters | |
---|---|
: Set<Int> | 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. |