NavigationDrawerItemDefaults
object NavigationDrawerItemDefaults
Contains the default values used by selectable NavigationDrawerItem
Summary
Public functions |
|
|---|---|
Unit |
@ComposableCreates a trailing badge for |
NavigationDrawerItemBorder |
@ComposableCreates a |
NavigationDrawerItemColors |
@ComposableCreates a |
NavigationDrawerItemGlow |
glow(Creates a |
NavigationDrawerItemScale |
scale(Creates a |
NavigationDrawerItemShape |
shape(Creates a |
Public properties |
|
|---|---|
Dp |
The size of the |
Dp |
The default content padding |
Dp |
The default content padding |
EnterTransition |
Animation enter default for inner content |
ExitTransition |
Animation exit default for inner content |
Border |
Default border used by |
Dp |
The size of the |
Dp |
The default Icon size used by |
Dp |
The default elevation used by |
Color |
The default container color used by |
Color |
The default content color used by |
TextStyle |
The default text style used by |
Public functions
TrailingBadge
@Composable
fun TrailingBadge(
text: String,
containerColor: Color = TrailingBadgeContainerColor,
contentColor: Color = TrailingBadgeContentColor
): Unit
Creates a trailing badge for NavigationDrawerItem
border
@Composable
fun border(
border: Border = Border.None,
focusedBorder: Border = border,
pressedBorder: Border = focusedBorder,
selectedBorder: Border = border,
disabledBorder: Border = border,
focusedSelectedBorder: Border = focusedBorder,
focusedDisabledBorder: Border = DefaultBorder,
pressedSelectedBorder: Border = border
): NavigationDrawerItemBorder
Creates a NavigationDrawerItemBorder that represents the default Borders applied on a selectable NavigationDrawerItem in different Interaction states
| Parameters | |
|---|---|
border: Border = Border.None |
the default |
focusedBorder: Border = border |
the |
pressedBorder: Border = focusedBorder |
the |
selectedBorder: Border = border |
the |
disabledBorder: Border = border |
the |
focusedSelectedBorder: Border = focusedBorder |
the |
focusedDisabledBorder: Border = DefaultBorder |
the |
pressedSelectedBorder: Border = border |
the |
colors
@Composable
fun colors(
containerColor: Color = Color.Transparent,
contentColor: Color = MaterialTheme.colorScheme.onSurface,
inactiveContentColor: Color = contentColor.copy(alpha = 0.4f),
focusedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface,
focusedContentColor: Color = contentColorFor(focusedContainerColor),
pressedContainerColor: Color = focusedContainerColor,
pressedContentColor: Color = contentColorFor(focusedContainerColor),
selectedContainerColor: Color = MaterialTheme.colorScheme.secondaryContainer.copy(alpha = 0.4f),
selectedContentColor: Color = MaterialTheme.colorScheme.onSecondaryContainer,
disabledContainerColor: Color = Color.Transparent,
disabledContentColor: Color = MaterialTheme.colorScheme.onSurface,
disabledInactiveContentColor: Color = disabledContentColor.copy(alpha = 0.4f),
focusedSelectedContainerColor: Color = focusedContainerColor,
focusedSelectedContentColor: Color = focusedContentColor,
pressedSelectedContainerColor: Color = pressedContainerColor,
pressedSelectedContentColor: Color = pressedContentColor
): NavigationDrawerItemColors
Creates a NavigationDrawerItemColors that represents the default container & content colors used in a selectable NavigationDrawerItem
| Parameters | |
|---|---|
containerColor: Color = Color.Transparent |
the default container color used when the |
contentColor: Color = MaterialTheme.colorScheme.onSurface |
the default content color used when the |
inactiveContentColor: Color = contentColor.copy(alpha = 0.4f) |
the content color used when none of the navigation items have focus |
focusedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface |
the container color used when the |
focusedContentColor: Color = contentColorFor(focusedContainerColor) |
the content color used when the |
pressedContainerColor: Color = focusedContainerColor |
the container color used when the |
pressedContentColor: Color = contentColorFor(focusedContainerColor) |
the content color used when the |
selectedContainerColor: Color = MaterialTheme.colorScheme.secondaryContainer.copy(alpha = 0.4f) |
the container color used when the |
selectedContentColor: Color = MaterialTheme.colorScheme.onSecondaryContainer |
the content color used when the |
disabledContainerColor: Color = Color.Transparent |
the container color used when the |
disabledContentColor: Color = MaterialTheme.colorScheme.onSurface |
the content color used when the |
disabledInactiveContentColor: Color = disabledContentColor.copy(alpha = 0.4f) |
the content color used when none of the navigation items have focus and this item is disabled |
focusedSelectedContainerColor: Color = focusedContainerColor |
the container color used when the NavigationDrawerItem is enabled, focused and selected |
focusedSelectedContentColor: Color = focusedContentColor |
the content color used when the |
pressedSelectedContainerColor: Color = pressedContainerColor |
the container color used when the |
pressedSelectedContentColor: Color = pressedContentColor |
the content color used when the |
glow
fun glow(
glow: Glow = Glow.None,
focusedGlow: Glow = glow,
pressedGlow: Glow = glow,
selectedGlow: Glow = glow,
focusedSelectedGlow: Glow = focusedGlow,
pressedSelectedGlow: Glow = glow
): NavigationDrawerItemGlow
Creates a NavigationDrawerItemGlow that represents the default Glows used in a selectable NavigationDrawerItem
| Parameters | |
|---|---|
glow: Glow = Glow.None |
the |
focusedGlow: Glow = glow |
the |
pressedGlow: Glow = glow |
the |
selectedGlow: Glow = glow |
the |
focusedSelectedGlow: Glow = focusedGlow |
the |
pressedSelectedGlow: Glow = glow |
the |
scale
fun scale(
scale: @FloatRange(from = 0.0) Float = 1.0f,
focusedScale: @FloatRange(from = 0.0) Float = 1.05f,
pressedScale: @FloatRange(from = 0.0) Float = scale,
selectedScale: @FloatRange(from = 0.0) Float = scale,
disabledScale: @FloatRange(from = 0.0) Float = scale,
focusedSelectedScale: @FloatRange(from = 0.0) Float = focusedScale,
focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale,
pressedSelectedScale: @FloatRange(from = 0.0) Float = scale
): NavigationDrawerItemScale
Creates a NavigationDrawerItemScale that represents the default scales used in a selectable NavigationDrawerItem
scales are used to modify the size of a composable in different Interaction states e.g. 1f (original) in default state, 1.2f (scaled up) in focused state, 0.8f (scaled down) in pressed state, etc.
| Parameters | |
|---|---|
scale: @FloatRange(from = 0.0) Float = 1.0f |
the scale used when the |
focusedScale: @FloatRange(from = 0.0) Float = 1.05f |
the scale used when the |
pressedScale: @FloatRange(from = 0.0) Float = scale |
the scale used when the |
selectedScale: @FloatRange(from = 0.0) Float = scale |
the scale used when the |
disabledScale: @FloatRange(from = 0.0) Float = scale |
the scale used when the |
focusedSelectedScale: @FloatRange(from = 0.0) Float = focusedScale |
the scale used when the |
focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale |
the scale used when the |
pressedSelectedScale: @FloatRange(from = 0.0) Float = scale |
the scale used when the |
shape
fun shape(
shape: Shape = RoundedCornerShape(50),
focusedShape: Shape = shape,
pressedShape: Shape = shape,
selectedShape: Shape = shape,
disabledShape: Shape = shape,
focusedSelectedShape: Shape = shape,
focusedDisabledShape: Shape = disabledShape,
pressedSelectedShape: Shape = shape
): NavigationDrawerItemShape
Creates a NavigationDrawerItemShape that represents the default container shapes used in a selectable NavigationDrawerItem
| Parameters | |
|---|---|
shape: Shape = RoundedCornerShape(50) |
the default shape used when the |
focusedShape: Shape = shape |
the shape used when the |
pressedShape: Shape = shape |
the shape used when the |
selectedShape: Shape = shape |
the shape used when the |
disabledShape: Shape = shape |
the shape used when the |
focusedSelectedShape: Shape = shape |
the shape used when the |
focusedDisabledShape: Shape = disabledShape |
the shape used when the |
pressedSelectedShape: Shape = shape |
the shape used when the |
Public properties
CollapsedDrawerItemWidth
val CollapsedDrawerItemWidth: Dp
The size of the NavigationDrawerItem when the drawer is collapsed
ContainerHeightOneLine
val ContainerHeightOneLine: Dp
The default content padding PaddingValues used by NavigationDrawerItem with 1 line when the drawer is expanded
ContainerHeightTwoLine
val ContainerHeightTwoLine: Dp
The default content padding PaddingValues used by NavigationDrawerItem with 2 lines when the drawer is expanded
ContentAnimationEnter
val ContentAnimationEnter: EnterTransition
Animation enter default for inner content
ContentAnimationExit
val ContentAnimationExit: ExitTransition
Animation exit default for inner content
ExpandedDrawerItemWidth
val ExpandedDrawerItemWidth: Dp
The size of the NavigationDrawerItem when the drawer is expanded
NavigationDrawerItemElevation
val NavigationDrawerItemElevation: Dp
The default elevation used by NavigationDrawerItem
TrailingBadgeContainerColor
val TrailingBadgeContainerColor: Color
The default container color used by NavigationDrawerItem's trailing badge
TrailingBadgeContentColor
val TrailingBadgeContentColor: Color
The default content color used by NavigationDrawerItem's trailing badge
TrailingBadgeTextStyle
val TrailingBadgeTextStyle: TextStyle
The default text style used by NavigationDrawerItem's trailing badge