SelectableSurfaceDefaults
object SelectableSurfaceDefaults
Contains the default values used by Selectable Surface.
Summary
Public functions |
|
|---|---|
SelectableSurfaceBorder |
border(Creates a |
SelectableSurfaceColors |
@ComposableCreates a |
SelectableSurfaceGlow |
glow(Creates a |
SelectableSurfaceScale |
scale(Creates a |
SelectableSurfaceShape |
@ComposableCreates a |
Public functions
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
Creates a SelectableSurfaceBorder that represents the default Borders applied on a selectable Surface in different Interaction states.
| Parameters | |
|---|---|
border: Border = Border.None |
the |
focusedBorder: Border = border |
the |
pressedBorder: Border = focusedBorder |
the |
selectedBorder: Border = border |
the |
disabledBorder: Border = border |
the |
focusedSelectedBorder: Border = focusedBorder |
the |
focusedDisabledBorder: Border = disabledBorder |
the |
pressedSelectedBorder: Border = border |
the |
selectedDisabledBorder: Border = disabledBorder |
the |
focusedSelectedDisabledBorder: Border = disabledBorder |
the |
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 |
contentColor: Color = contentColorFor(containerColor) |
the content color used when the Surface is enabled, and has no other |
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
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 |
focusedGlow: Glow = glow |
the |
pressedGlow: Glow = glow |
the |
selectedGlow: Glow = glow |
the |
focusedSelectedGlow: Glow = focusedGlow |
the |
pressedSelectedGlow: Glow = glow |
the |
scale
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 |
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
@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 |
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. |