SelectableSurfaceDefaults

object SelectableSurfaceDefaults


Contains the default values used by Selectable Surface.

Summary

Public functions

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

Creates a SelectableSurfaceBorder that represents the default Borders applied on a selectable Surface in different Interaction states.

SelectableSurfaceColors
@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 SelectableSurfaceColors that represents the default container & content colors used in a selectable Surface.

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

Creates a SelectableSurfaceGlow that represents the default Glows used in a selectable Surface.

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

Creates a SelectableSurfaceScale that represents the default scales used in a selectable 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.

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

Creates a SelectableSurfaceShape that represents the default container shapes used in a selectable Surface.

Public functions

border

Added in 1.0.0
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
): SelectableSurfaceBorder

Creates a SelectableSurfaceBorder that represents the default Borders applied on a selectable 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
): SelectableSurfaceColors

Creates a SelectableSurfaceColors that represents the default container & content colors used in a selectable 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
fun glow(
    glow: Glow = Glow.None,
    focusedGlow: Glow = glow,
    pressedGlow: Glow = glow,
    selectedGlow: Glow = glow,
    focusedSelectedGlow: Glow = focusedGlow,
    pressedSelectedGlow: Glow = glow
): SelectableSurfaceGlow

Creates a SelectableSurfaceGlow that represents the default Glows used in a selectable 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
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
): SelectableSurfaceScale

Creates a SelectableSurfaceScale that represents the default scales used in a selectable 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
@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
): SelectableSurfaceShape

Creates a SelectableSurfaceShape that represents the default container shapes used in a selectable 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.