Object

SelectableSurfaceDefaults

Contains the default values used by Selectable Surface.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Android
object SelectableSurfaceDefaults

Contains the default values used by Selectable Surface.

Functions

shape

@ReadOnlyComposable
    @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(
            shape = shape,
            focusedShape = focusedShape,
            pressedShape = pressedShape,
            selectedShape = selectedShape,
            disabledShape = disabledShape,
            focusedSelectedShape = focusedSelectedShape,
            focusedDisabledShape = focusedDisabledShape,
            pressedSelectedShape = pressedSelectedShape,
            selectedDisabledShape = selectedDisabledShape,
            focusedSelectedDisabledShape = focusedSelectedDisabledShape,
        )

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

Parameters

shape the shape used when the Surface is enabled, and has no other Interactions.
focusedShape the shape used when the Surface is enabled and focused.
pressedShape the shape used when the Surface is enabled and pressed.
selectedShape the shape used when the Surface is enabled and selected.
disabledShape the shape used when the Surface is not enabled.
focusedSelectedShape the shape used when the Surface is enabled, focused and selected.
focusedDisabledShape the shape used when the Surface is not enabled and focused.
pressedSelectedShape the shape used when the Surface is enabled, pressed and selected.
selectedDisabledShape the shape used when the Surface is not enabled and selected.
focusedSelectedDisabledShape the shape used when the Surface is not enabled, focused and selected.

colors

@ReadOnlyComposable
    @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(
            containerColor = containerColor,
            contentColor = contentColor,
            focusedContainerColor = focusedContainerColor,
            focusedContentColor = focusedContentColor,
            pressedContainerColor = pressedContainerColor,
            pressedContentColor = pressedContentColor,
            selectedContainerColor = selectedContainerColor,
            selectedContentColor = selectedContentColor,
            disabledContainerColor = disabledContainerColor,
            disabledContentColor = disabledContentColor,
            focusedSelectedContainerColor = focusedSelectedContainerColor,
            focusedSelectedContentColor = focusedSelectedContentColor,
            pressedSelectedContainerColor = pressedSelectedContainerColor,
            pressedSelectedContentColor = pressedSelectedContentColor,
        )

Creates a SelectableSurfaceColors that represents the default container & content colors used in a selectable Surface.

Parameters

containerColor the container color used when the Surface is enabled, and has no other Interactions.
contentColor the content color used when the Surface is enabled, and has no other Interactions.
focusedContainerColor the container color used when the Surface is enabled and focused.
focusedContentColor the content color used when the Surface is enabled and focused.
pressedContainerColor the container color used when the Surface is enabled and pressed.
pressedContentColor the content color used when the Surface is enabled and pressed.
selectedContainerColor the container color used when the Surface is enabled and selected.
selectedContentColor the content color used when the Surface is enabled and selected.
disabledContainerColor the container color used when the Surface is not enabled.
disabledContentColor the content color used when the Surface is not enabled.
focusedSelectedContainerColor the container color used when the Surface is enabled, focused and selected.
focusedSelectedContentColor the content color used when the Surface is enabled, focused and selected.
pressedSelectedContainerColor the container color used when the Surface is enabled, pressed and selected.
pressedSelectedContentColor the content color used when the Surface is enabled, pressed and selected.

scale

fun scale(
        scale: Float = 1f,
        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(
            scale = scale,
            focusedScale = focusedScale,
            pressedScale = pressedScale,
            selectedScale = selectedScale,
            disabledScale = disabledScale,
            focusedSelectedScale = focusedSelectedScale,
            focusedDisabledScale = focusedDisabledScale,
            pressedSelectedScale = pressedSelectedScale,
            selectedDisabledScale = selectedDisabledScale,
            focusedSelectedDisabledScale = focusedSelectedDisabledScale,
        )

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 the scale used when the Surface is enabled, and has no other Interactions.
focusedScale the scale used when the Surface is enabled and focused.
pressedScale the scale used when the Surface is enabled and pressed.
selectedScale the scale used when the Surface is enabled and selected.
disabledScale the scale used when the Surface is not enabled.
focusedSelectedScale the scale used when the Surface is enabled, focused and selected.
focusedDisabledScale the scale used when the Surface is not enabled and focused.
pressedSelectedScale the scale used when the Surface is enabled, pressed and selected.
selectedDisabledScale the scale used when the Surface is not enabled and selected.
focusedSelectedDisabledScale the scale used when the Surface is not enabled, focused and selected.

border

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(
            border = border,
            focusedBorder = focusedBorder,
            pressedBorder = pressedBorder,
            selectedBorder = selectedBorder,
            disabledBorder = disabledBorder,
            focusedSelectedBorder = focusedSelectedBorder,
            focusedDisabledBorder = focusedDisabledBorder,
            pressedSelectedBorder = pressedSelectedBorder,
            selectedDisabledBorder = selectedDisabledBorder,
            focusedSelectedDisabledBorder = focusedSelectedDisabledBorder,
        )

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

Parameters

border the Border used when the Surface is enabled, and has no other Interactions.
focusedBorder the Border used when the Surface is enabled and focused.
pressedBorder the Border used when the Surface is enabled and pressed.
selectedBorder the Border used when the Surface is enabled and selected.
disabledBorder the Border used when the Surface is not enabled.
focusedSelectedBorder the Border used when the Surface is enabled, focused and selected.
focusedDisabledBorder the Border used when the Surface is not enabled and focused.
pressedSelectedBorder the Border used when the Surface is enabled, pressed and selected.
selectedDisabledBorder the Border used when the Surface is not enabled and selected.
focusedSelectedDisabledBorder the Border used when the Surface is not enabled, focused and selected.

glow

fun glow(
        glow: Glow = Glow.None,
        focusedGlow: Glow = glow,
        pressedGlow: Glow = glow,
        selectedGlow: Glow = glow,
        focusedSelectedGlow: Glow = focusedGlow,
        pressedSelectedGlow: Glow = glow,
    ) =
        SelectableSurfaceGlow(
            glow = glow,
            focusedGlow = focusedGlow,
            pressedGlow = pressedGlow,
            selectedGlow = selectedGlow,
            focusedSelectedGlow = focusedSelectedGlow,
            pressedSelectedGlow = pressedSelectedGlow,
        )

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

Parameters

glow the Glow used when the Surface is enabled, and has no other Interactions.
focusedGlow the Glow used when the Surface is enabled and focused.
pressedGlow the Glow used when the Surface is enabled and pressed.
selectedGlow the Glow used when the Surface is enabled and selected.
focusedSelectedGlow the Glow used when the Surface is enabled, focused and selected.
pressedSelectedGlow the Glow used when the Surface is enabled, pressed and selected.