ClickableSurfaceDefaults

object ClickableSurfaceDefaults


Contains the default values used by clickable Surface.

Summary

Public functions

ClickableSurfaceBorder
@Composable
border(
    border: Border,
    focusedBorder: Border,
    pressedBorder: Border,
    disabledBorder: Border,
    focusedDisabledBorder: Border
)

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

ClickableSurfaceColors
@Composable
colors(
    containerColor: Color,
    contentColor: Color,
    focusedContainerColor: Color,
    focusedContentColor: Color,
    pressedContainerColor: Color,
    pressedContentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

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

ClickableSurfaceGlow
glow(glow: Glow, focusedGlow: Glow, pressedGlow: Glow)

Creates a ClickableSurfaceGlow that represents the default Glows used in a Surface.

ClickableSurfaceScale
scale(
    scale: @FloatRange(from = 0.0) Float,
    focusedScale: @FloatRange(from = 0.0) Float,
    pressedScale: @FloatRange(from = 0.0) Float,
    disabledScale: @FloatRange(from = 0.0) Float,
    focusedDisabledScale: @FloatRange(from = 0.0) Float
)

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

ClickableSurfaceShape
@Composable
shape(
    shape: Shape,
    focusedShape: Shape,
    pressedShape: Shape,
    disabledShape: Shape,
    focusedDisabledShape: Shape
)

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

Public functions

border

Added in 1.0.0
@Composable
fun border(
    border: Border = Border.None,
    focusedBorder: Border = border,
    pressedBorder: Border = focusedBorder,
    disabledBorder: Border = border,
    focusedDisabledBorder: Border = Border( border = BorderStroke(width = 2.dp, color = MaterialTheme.colorScheme.border), inset = 0.dp, shape = ShapeDefaults.Small )
): ClickableSurfaceBorder

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

Parameters
border: Border = Border.None

the Border to be used for this Surface when enabled

focusedBorder: Border = border

the Border to be used for this Surface when focused

pressedBorder: Border = focusedBorder

the Border to be used for this Surface when pressed

disabledBorder: Border = border

the Border to be used for this Surface when disabled

focusedDisabledBorder: Border = Border( border = BorderStroke(width = 2.dp, color = MaterialTheme.colorScheme.border), inset = 0.dp, shape = ShapeDefaults.Small )

the Border to be used for this Surface when disabled and focused

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),
    disabledContainerColor: Color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = DisabledContainerAlpha),
    disabledContentColor: Color = MaterialTheme.colorScheme.onSurface
): ClickableSurfaceColors

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

Parameters
containerColor: Color = MaterialTheme.colorScheme.surface

the container color of this Surface when enabled

contentColor: Color = contentColorFor(containerColor)

the content color of this Surface when enabled

focusedContainerColor: Color = MaterialTheme.colorScheme.inverseSurface

the container color of this Surface when enabled and focused

focusedContentColor: Color = contentColorFor(focusedContainerColor)

the content color of this Surface when enabled and focused

pressedContainerColor: Color = focusedContainerColor

the container color of this Surface when enabled and pressed

pressedContentColor: Color = contentColorFor(pressedContainerColor)

the content color of this Surface when enabled and pressed

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

the container color of this Surface when not enabled

disabledContentColor: Color = MaterialTheme.colorScheme.onSurface

the content color of this Surface when not enabled

glow

Added in 1.0.0
fun glow(glow: Glow = Glow.None, focusedGlow: Glow = glow, pressedGlow: Glow = glow): ClickableSurfaceGlow

Creates a ClickableSurfaceGlow that represents the default Glows used in a Surface.

Parameters
glow: Glow = Glow.None

the Glow behind this Surface when enabled

focusedGlow: Glow = glow

the Glow behind this Surface when focused

pressedGlow: Glow = glow

the Glow behind this Surface when pressed

scale

Added in 1.0.0
fun scale(
    scale: @FloatRange(from = 0.0) Float = 1.0f,
    focusedScale: @FloatRange(from = 0.0) Float = 1.1f,
    pressedScale: @FloatRange(from = 0.0) Float = scale,
    disabledScale: @FloatRange(from = 0.0) Float = scale,
    focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale
): ClickableSurfaceScale

Creates a ClickableSurfaceScale that represents the default scales used in a 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: @FloatRange(from = 0.0) Float = 1.0f

the scale to be used for this Surface when enabled

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

the scale to be used for this Surface when focused

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

the scale to be used for this Surface when pressed

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

the scale to be used for this Surface when disabled

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

the scale to be used for this Surface when disabled and focused

shape

Added in 1.0.0
@Composable
fun shape(
    shape: Shape = MaterialTheme.shapes.medium,
    focusedShape: Shape = shape,
    pressedShape: Shape = shape,
    disabledShape: Shape = shape,
    focusedDisabledShape: Shape = disabledShape
): ClickableSurfaceShape

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

disabledShape: Shape = shape

the shape used when the Surface is not enabled.

focusedDisabledShape: Shape = disabledShape

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