ToggleableSurfaceDefaults


@ExperimentalTvMaterial3Api
object ToggleableSurfaceDefaults


Contains the default values used by Toggleable Surface.

Summary

Public functions

ToggleableSurfaceBorder
border(
    border: Border,
    focusedBorder: Border,
    pressedBorder: Border,
    selectedBorder: Border,
    disabledBorder: Border,
    focusedSelectedBorder: Border,
    focusedDisabledBorder: Border,
    pressedSelectedBorder: Border,
    selectedDisabledBorder: Border,
    focusedSelectedDisabledBorder: Border
)

Creates a ToggleableSurfaceBorder that represents the default Borders applied on a toggleable Surface in different Interaction states.

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

Creates a ToggleableSurfaceColors that represents the default container & content colors used in a toggleable Surface.

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

Creates a ToggleableSurfaceGlow that represents the default Glows used in a toggleable Surface.

ToggleableSurfaceScale
scale(
    scale: Float,
    focusedScale: Float,
    pressedScale: Float,
    selectedScale: Float,
    disabledScale: Float,
    focusedSelectedScale: Float,
    focusedDisabledScale: Float,
    pressedSelectedScale: Float,
    selectedDisabledScale: Float,
    focusedSelectedDisabledScale: Float
)

Creates a ToggleableSurfaceScale that represents the default scales used in a toggleable Surface. 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.

ToggleableSurfaceShape
@Composable
shape(
    shape: Shape,
    focusedShape: Shape,
    pressedShape: Shape,
    selectedShape: Shape,
    disabledShape: Shape,
    focusedSelectedShape: Shape,
    focusedDisabledShape: Shape,
    pressedSelectedShape: Shape,
    selectedDisabledShape: Shape,
    focusedSelectedDisabledShape: Shape
)

Creates a ToggleableSurfaceShape that represents the default container shapes used in a toggleable Surface.

Public functions

border

Added in 1.0.0-alpha10
fun border(
    border: Border = Border.None,
    focusedBorder: Border = border,
    pressedBorder: Border = focusedBorder,
    selectedBorder: Border = border,
    disabledBorder: Border = border,
    focusedSelectedBorder: Border = focusedBorder,
    focusedDisabledBorder: Border = disabledBorder,
    pressedSelectedBorder: Border = border,
    selectedDisabledBorder: Border = disabledBorder,
    focusedSelectedDisabledBorder: Border = disabledBorder
): ToggleableSurfaceBorder

Creates a ToggleableSurfaceBorder that represents the default Borders applied on a toggleable Surface in different Interaction states.

Parameters
border: Border = Border.None

the Border used when the Surface is enabled, and has no other Interactions.

focusedBorder: Border = border

the Border used when the Surface is enabled and focused.

pressedBorder: Border = focusedBorder

the Border used when the Surface is enabled and pressed.

selectedBorder: Border = border

the Border used when the Surface is enabled and selected.

disabledBorder: Border = border

the Border used when the Surface is not enabled.

focusedSelectedBorder: Border = focusedBorder

the Border used when the Surface is enabled, focused and selected.

focusedDisabledBorder: Border = disabledBorder

the Border used when the Surface is not enabled and focused.

pressedSelectedBorder: Border = border

the Border used when the Surface is enabled, pressed and selected.

selectedDisabledBorder: Border = disabledBorder

the Border used when the Surface is not enabled and selected.

focusedSelectedDisabledBorder: Border = disabledBorder

the Border used when the Surface is not enabled, focused and selected.

colors

@Composable
fun colors(
    containerColor: Color = MaterialTheme.colorScheme.surface,
    contentColor: Color = contentColorFor(containerColor),
    focusedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface,
    focusedContentColor: Color = contentColorFor(focusedContainerColor),
    pressedContainerColor: Color = focusedContainerColor,
    pressedContentColor: Color = contentColorFor(pressedContainerColor),
    selectedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface .copy(alpha = SelectedContainerAlpha),
    selectedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface,
    disabledContainerColor: Color = MaterialTheme.colorScheme.surfaceVariant .copy(alpha = DisabledContainerAlpha),
    disabledContentColor: Color = MaterialTheme.colorScheme.onSurface,
    focusedSelectedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface .copy(alpha = SelectedContainerAlpha),
    focusedSelectedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface,
    pressedSelectedContainerColor: Color = focusedSelectedContainerColor,
    pressedSelectedContentColor: Color = focusedSelectedContentColor
): ToggleableSurfaceColors

Creates a ToggleableSurfaceColors that represents the default container & content colors used in a toggleable Surface.

Parameters
containerColor: Color = MaterialTheme.colorScheme.surface

the container color used when the Surface is enabled, and has no other Interactions.

contentColor: Color = contentColorFor(containerColor)

the content color used when the Surface is enabled, and has no other Interactions.

focusedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface

the container color used when the Surface is enabled and focused.

focusedContentColor: Color = contentColorFor(focusedContainerColor)

the content color used when the Surface is enabled and focused.

pressedContainerColor: Color = focusedContainerColor

the container color used when the Surface is enabled and pressed.

pressedContentColor: Color = contentColorFor(pressedContainerColor)

the content color used when the Surface is enabled and pressed.

selectedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface .copy(alpha = SelectedContainerAlpha)

the container color used when the Surface is enabled and selected.

selectedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface

the content color used when the Surface is enabled and selected.

disabledContainerColor: Color = MaterialTheme.colorScheme.surfaceVariant .copy(alpha = DisabledContainerAlpha)

the container color used when the Surface is not enabled.

disabledContentColor: Color = MaterialTheme.colorScheme.onSurface

the content color used when the Surface is not enabled.

focusedSelectedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface .copy(alpha = SelectedContainerAlpha)

the container color used when the Surface is enabled, focused and selected.

focusedSelectedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface

the content color used when the Surface is enabled, focused and selected.

pressedSelectedContainerColor: Color = focusedSelectedContainerColor

the container color used when the Surface is enabled, pressed and selected.

pressedSelectedContentColor: Color = focusedSelectedContentColor

the content color used when the Surface is enabled, pressed and selected.

glow

Added in 1.0.0-alpha10
fun glow(
    glow: Glow = Glow.None,
    focusedGlow: Glow = glow,
    pressedGlow: Glow = glow,
    selectedGlow: Glow = glow,
    focusedSelectedGlow: Glow = focusedGlow,
    pressedSelectedGlow: Glow = glow
): ToggleableSurfaceGlow

Creates a ToggleableSurfaceGlow that represents the default Glows used in a toggleable Surface.

Parameters
glow: Glow = Glow.None

the Glow used when the Surface is enabled, and has no other Interactions.

focusedGlow: Glow = glow

the Glow used when the Surface is enabled and focused.

pressedGlow: Glow = glow

the Glow used when the Surface is enabled and pressed.

selectedGlow: Glow = glow

the Glow used when the Surface is enabled and selected.

focusedSelectedGlow: Glow = focusedGlow

the Glow used when the Surface is enabled, focused and selected.

pressedSelectedGlow: Glow = glow

the Glow used when the Surface is enabled, pressed and selected.

scale

Added in 1.0.0-alpha10
fun scale(
    scale: Float = 1.0f,
    focusedScale: Float = 1.1f,
    pressedScale: Float = scale,
    selectedScale: Float = scale,
    disabledScale: Float = scale,
    focusedSelectedScale: Float = focusedScale,
    focusedDisabledScale: Float = disabledScale,
    pressedSelectedScale: Float = scale,
    selectedDisabledScale: Float = disabledScale,
    focusedSelectedDisabledScale: Float = disabledScale
): ToggleableSurfaceScale

Creates a ToggleableSurfaceScale that represents the default scales used in a toggleable Surface. 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: Float = 1.0f

the scale used when the Surface is enabled, and has no other Interactions.

focusedScale: Float = 1.1f

the scale used when the Surface is enabled and focused.

pressedScale: Float = scale

the scale used when the Surface is enabled and pressed.

selectedScale: Float = scale

the scale used when the Surface is enabled and selected.

disabledScale: Float = scale

the scale used when the Surface is not enabled.

focusedSelectedScale: Float = focusedScale

the scale used when the Surface is enabled, focused and selected.

focusedDisabledScale: Float = disabledScale

the scale used when the Surface is not enabled and focused.

pressedSelectedScale: Float = scale

the scale used when the Surface is enabled, pressed and selected.

selectedDisabledScale: Float = disabledScale

the scale used when the Surface is not enabled and selected.

focusedSelectedDisabledScale: Float = disabledScale

the scale used when the Surface is not enabled, focused and selected.

shape

Added in 1.0.0-alpha10
@Composable
fun shape(
    shape: Shape = MaterialTheme.shapes.medium,
    focusedShape: Shape = shape,
    pressedShape: Shape = shape,
    selectedShape: Shape = shape,
    disabledShape: Shape = shape,
    focusedSelectedShape: Shape = shape,
    focusedDisabledShape: Shape = disabledShape,
    pressedSelectedShape: Shape = shape,
    selectedDisabledShape: Shape = disabledShape,
    focusedSelectedDisabledShape: Shape = disabledShape
): ToggleableSurfaceShape

Creates a ToggleableSurfaceShape that represents the default container shapes used in a toggleable Surface.

Parameters
shape: Shape = MaterialTheme.shapes.medium

the shape used when the Surface is enabled, and has no other Interactions.

focusedShape: Shape = shape

the shape used when the Surface is enabled and focused.

pressedShape: Shape = shape

the shape used when the Surface is enabled and pressed.

selectedShape: Shape = shape

the shape used when the Surface is enabled and selected.

disabledShape: Shape = shape

the shape used when the Surface is not enabled.

focusedSelectedShape: Shape = shape

the shape used when the Surface is enabled, focused and selected.

focusedDisabledShape: Shape = disabledShape

the shape used when the Surface is not enabled and focused.

pressedSelectedShape: Shape = shape

the shape used when the Surface is enabled, pressed and selected.

selectedDisabledShape: Shape = disabledShape

the shape used when the Surface is not enabled and selected.

focusedSelectedDisabledShape: Shape = disabledShape

the shape used when the Surface is not enabled, focused and selected.