Builder
class Builder
kotlin.Any | |
↳ | androidx.navigation.ui.AppBarConfiguration.Builder |
The Builder class for constructing new AppBarConfiguration
instances.
Summary
Public constructors | |
---|---|
Create a new Builder whose only top level destination is the start destination of the given |
|
Create a new Builder using a |
|
Create a new Builder with a specific set of top level destinations. |
|
<init>(@NonNull : MutableSet<Int!>) Create a new Builder with a specific set of top level destinations. |
Public methods | |
---|---|
AppBarConfiguration |
build() Construct the |
AppBarConfiguration.Builder |
setDrawerLayout(@Nullable : DrawerLayout?) Display the Navigation button as a drawer symbol when it is not being shown as an Up button. |
AppBarConfiguration.Builder |
Adds a |
AppBarConfiguration.Builder |
setOpenableLayout(@Nullable : Openable?) Display the Navigation button as a drawer symbol when it is not being shown as an Up button. |
Public constructors
<init>
Builder(@NonNull : NavGraph)
Create a new Builder whose only top level destination is the start destination of the given NavGraph
. The Up button will not be displayed when on the start destination of the graph.
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. |
<init>
Builder(@NonNull : Menu)
Create a new Builder using a Menu
containing all top level destinations. It is expected that the menu item id
of each item corresponds with a destination in your navigation graph. The Up button will not be displayed when on these destinations.
Parameters | |
---|---|
topLevelMenu |
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. |
<init>
Builder(@NonNull vararg : Int)
Create a new Builder with a specific set of top level destinations. The Up button will not be displayed when on these destinations.
Parameters | |
---|---|
topLevelDestinationIds |
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. |
<init>
Builder(@NonNull : MutableSet<Int!>)
Create a new Builder with a specific set of top level destinations. The Up button will not be displayed when on these destinations.
Parameters | |
---|---|
topLevelDestinationIds |
MutableSet<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. |
Public methods
build
@NonNull fun build(): AppBarConfiguration
Construct the AppBarConfiguration
instance.
Return | |
---|---|
AppBarConfiguration |
a valid AppBarConfiguration |
setDrawerLayout
@NonNull funsetDrawerLayout(@Nullable : DrawerLayout?): AppBarConfiguration.Builder
Deprecated: Use setOpenableLayout(Openable)
.
Display the Navigation button as a drawer symbol when it is not being shown as an Up button.
Parameters | |
---|---|
drawerLayout |
DrawerLayout?: The DrawerLayout that should be toggled from the Navigation button |
Return | |
---|---|
AppBarConfiguration.Builder |
this Builder |
setFallbackOnNavigateUpListener
@NonNull fun setFallbackOnNavigateUpListener(@Nullable : AppBarConfiguration.OnNavigateUpListener?): AppBarConfiguration.Builder
Adds a OnNavigateUpListener
that will be called as a fallback if the default behavior of androidx.navigation.NavController#navigateUp
returns false
.
Parameters | |
---|---|
fallbackOnNavigateUpListener |
AppBarConfiguration.OnNavigateUpListener?: Listener that will be invoked if androidx.navigation.NavController#navigateUp returns false . |
Return | |
---|---|
AppBarConfiguration.Builder |
this Builder |
setOpenableLayout
@NonNull fun setOpenableLayout(@Nullable : Openable?): AppBarConfiguration.Builder
Display the Navigation button as a drawer symbol when it is not being shown as an Up button.
Parameters | |
---|---|
openableLayout |
Openable?: The Openable layout that should be toggled from the Navigation button |
Return | |
---|---|
AppBarConfiguration.Builder |
this Builder |