NavigationDrawerItemDefaults

object NavigationDrawerItemDefaults


Contains the default values used by selectable NavigationDrawerItem

Summary

Public functions

Unit
@Composable
TrailingBadge(text: String, containerColor: Color, contentColor: Color)

Creates a trailing badge for NavigationDrawerItem

NavigationDrawerItemBorder
@Composable
border(
    border: Border,
    focusedBorder: Border,
    pressedBorder: Border,
    selectedBorder: Border,
    disabledBorder: Border,
    focusedSelectedBorder: Border,
    focusedDisabledBorder: Border,
    pressedSelectedBorder: Border
)

Creates a NavigationDrawerItemBorder that represents the default Borders applied on a selectable NavigationDrawerItem in different Interaction states

NavigationDrawerItemColors
@Composable
colors(
    containerColor: Color,
    contentColor: Color,
    inactiveContentColor: Color,
    focusedContainerColor: Color,
    focusedContentColor: Color,
    pressedContainerColor: Color,
    pressedContentColor: Color,
    selectedContainerColor: Color,
    selectedContentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color,
    disabledInactiveContentColor: Color,
    focusedSelectedContainerColor: Color,
    focusedSelectedContentColor: Color,
    pressedSelectedContainerColor: Color,
    pressedSelectedContentColor: Color
)

Creates a NavigationDrawerItemColors that represents the default container & content colors used in a selectable NavigationDrawerItem

NavigationDrawerItemGlow
glow(
    glow: Glow,
    focusedGlow: Glow,
    pressedGlow: Glow,
    selectedGlow: Glow,
    focusedSelectedGlow: Glow,
    pressedSelectedGlow: Glow
)

Creates a NavigationDrawerItemGlow that represents the default Glows used in a selectable NavigationDrawerItem

NavigationDrawerItemScale
scale(
    scale: @FloatRange(from = 0.0) Float,
    focusedScale: @FloatRange(from = 0.0) Float,
    pressedScale: @FloatRange(from = 0.0) Float,
    selectedScale: @FloatRange(from = 0.0) Float,
    disabledScale: @FloatRange(from = 0.0) Float,
    focusedSelectedScale: @FloatRange(from = 0.0) Float,
    focusedDisabledScale: @FloatRange(from = 0.0) Float,
    pressedSelectedScale: @FloatRange(from = 0.0) Float
)

Creates a NavigationDrawerItemScale that represents the default scales used in a selectable NavigationDrawerItem

NavigationDrawerItemShape
shape(
    shape: Shape,
    focusedShape: Shape,
    pressedShape: Shape,
    selectedShape: Shape,
    disabledShape: Shape,
    focusedSelectedShape: Shape,
    focusedDisabledShape: Shape,
    pressedSelectedShape: Shape
)

Creates a NavigationDrawerItemShape that represents the default container shapes used in a selectable NavigationDrawerItem

Public properties

Dp

The size of the NavigationDrawerItem when the drawer is collapsed

Dp

The default content padding PaddingValues used by NavigationDrawerItem with 1 line when the drawer is expanded

Dp

The default content padding PaddingValues used by NavigationDrawerItem with 2 lines when the drawer is expanded

EnterTransition

Animation enter default for inner content

ExitTransition

Animation exit default for inner content

Border

Default border used by NavigationDrawerItem

Dp

The size of the NavigationDrawerItem when the drawer is expanded

Dp

The default Icon size used by NavigationDrawerItem

Dp

The default elevation used by NavigationDrawerItem

Color

The default container color used by NavigationDrawerItem's trailing badge

Color

The default content color used by NavigationDrawerItem's trailing badge

TextStyle

The default text style used by NavigationDrawerItem's trailing badge

Public functions

TrailingBadge

@Composable
fun TrailingBadge(
    text: String,
    containerColor: Color = TrailingBadgeContainerColor,
    contentColor: Color = TrailingBadgeContentColor
): Unit

Creates a trailing badge for NavigationDrawerItem

border

Added in 1.0.0
@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 Border used when the NavigationDrawerItem is enabled

focusedBorder: Border = border

the Border used when the NavigationDrawerItem is enabled and focused

pressedBorder: Border = focusedBorder

the Border used when the NavigationDrawerItem is enabled and pressed

selectedBorder: Border = border

the Border used when the NavigationDrawerItem is enabled and selected

disabledBorder: Border = border

the Border used when the NavigationDrawerItem is not enabled

focusedSelectedBorder: Border = focusedBorder

the Border used when the NavigationDrawerItem is enabled, focused and selected

focusedDisabledBorder: Border = DefaultBorder

the Border used when the NavigationDrawerItem is not enabled and focused

pressedSelectedBorder: Border = border

the Border used when the NavigationDrawerItem is enabled, pressed and selected

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 NavigationDrawerItem is enabled

contentColor: Color = MaterialTheme.colorScheme.onSurface

the default content color used when the NavigationDrawerItem is enabled

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 NavigationDrawerItem is enabled and focused

focusedContentColor: Color = contentColorFor(focusedContainerColor)

the content color used when the NavigationDrawerItem is enabled and focused

pressedContainerColor: Color = focusedContainerColor

the container color used when the NavigationDrawerItem is enabled and pressed

pressedContentColor: Color = contentColorFor(focusedContainerColor)

the content color used when the NavigationDrawerItem is enabled and pressed

selectedContainerColor: Color = MaterialTheme.colorScheme.secondaryContainer.copy(alpha = 0.4f)

the container color used when the NavigationDrawerItem is enabled and selected

selectedContentColor: Color = MaterialTheme.colorScheme.onSecondaryContainer

the content color used when the NavigationDrawerItem is enabled and selected

disabledContainerColor: Color = Color.Transparent

the container color used when the NavigationDrawerItem is not enabled

disabledContentColor: Color = MaterialTheme.colorScheme.onSurface

the content color used when the NavigationDrawerItem is not enabled

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 NavigationDrawerItem is enabled, focused and selected

pressedSelectedContainerColor: Color = pressedContainerColor

the container color used when the NavigationDrawerItem is enabled, pressed and selected

pressedSelectedContentColor: Color = pressedContentColor

the content color used when the NavigationDrawerItem is enabled, pressed and selected

glow

Added in 1.0.0
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 Glow used when the NavigationDrawerItem is enabled, and has no other Interactions

focusedGlow: Glow = glow

the Glow used when the NavigationDrawerItem is enabled and focused

pressedGlow: Glow = glow

the Glow used when the NavigationDrawerItem is enabled and pressed

selectedGlow: Glow = glow

the Glow used when the NavigationDrawerItem is enabled and selected

focusedSelectedGlow: Glow = focusedGlow

the Glow used when the NavigationDrawerItem is enabled, focused and selected

pressedSelectedGlow: Glow = glow

the Glow used when the NavigationDrawerItem is enabled, pressed and selected

scale

Added in 1.0.0
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 NavigationDrawerItem is enabled

focusedScale: @FloatRange(from = 0.0) Float = 1.05f

the scale used when the NavigationDrawerItem is enabled and focused

pressedScale: @FloatRange(from = 0.0) Float = scale

the scale used when the NavigationDrawerItem is enabled and pressed

selectedScale: @FloatRange(from = 0.0) Float = scale

the scale used when the NavigationDrawerItem is enabled and selected

disabledScale: @FloatRange(from = 0.0) Float = scale

the scale used when the NavigationDrawerItem is not enabled

focusedSelectedScale: @FloatRange(from = 0.0) Float = focusedScale

the scale used when the NavigationDrawerItem is enabled, focused and selected

focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale

the scale used when the NavigationDrawerItem is not enabled and focused

pressedSelectedScale: @FloatRange(from = 0.0) Float = scale

the scale used when the NavigationDrawerItem is enabled, pressed and selected

shape

Added in 1.0.0
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 NavigationDrawerItem is enabled

focusedShape: Shape = shape

the shape used when the NavigationDrawerItem is enabled and focused

pressedShape: Shape = shape

the shape used when the NavigationDrawerItem is enabled and pressed

selectedShape: Shape = shape

the shape used when the NavigationDrawerItem is enabled and selected

disabledShape: Shape = shape

the shape used when the NavigationDrawerItem is not enabled

focusedSelectedShape: Shape = shape

the shape used when the NavigationDrawerItem is enabled, focused and selected

focusedDisabledShape: Shape = disabledShape

the shape used when the NavigationDrawerItem is not enabled and focused

pressedSelectedShape: Shape = shape

the shape used when the NavigationDrawerItem is enabled, pressed and selected

Public properties

CollapsedDrawerItemWidth

Added in 1.0.0
val CollapsedDrawerItemWidthDp

The size of the NavigationDrawerItem when the drawer is collapsed

ContainerHeightOneLine

Added in 1.0.0
val ContainerHeightOneLineDp

The default content padding PaddingValues used by NavigationDrawerItem with 1 line when the drawer is expanded

ContainerHeightTwoLine

Added in 1.0.0
val ContainerHeightTwoLineDp

The default content padding PaddingValues used by NavigationDrawerItem with 2 lines when the drawer is expanded

ContentAnimationEnter

Added in 1.0.0
val ContentAnimationEnterEnterTransition

Animation enter default for inner content

ContentAnimationExit

Added in 1.0.0
val ContentAnimationExitExitTransition

Animation exit default for inner content

DefaultBorder

Added in 1.0.0
val DefaultBorderBorder

Default border used by NavigationDrawerItem

ExpandedDrawerItemWidth

Added in 1.0.0
val ExpandedDrawerItemWidthDp

The size of the NavigationDrawerItem when the drawer is expanded

IconSize

Added in 1.0.0
val IconSizeDp

The default Icon size used by NavigationDrawerItem

Added in 1.0.0
val NavigationDrawerItemElevationDp

The default elevation used by NavigationDrawerItem

TrailingBadgeContainerColor

Added in 1.0.0
val TrailingBadgeContainerColorColor

The default container color used by NavigationDrawerItem's trailing badge

TrailingBadgeContentColor

Added in 1.0.0
val TrailingBadgeContentColorColor

The default content color used by NavigationDrawerItem's trailing badge

TrailingBadgeTextStyle

Added in 1.0.0
val TrailingBadgeTextStyleTextStyle

The default text style used by NavigationDrawerItem's trailing badge