Package-level declarations

Types

Link copied to clipboard
@Immutable
data class Alpha(val alpha: Float = 1.0f, val focusedAlpha: Float = alpha, val hoveredAlpha: Float = alpha, val pressedAlpha: Float = alpha, val selectedAlpha: Float = alpha, val disabledAlpha: Float = DEFAULT_DISABLED_ALPHA, val focusedSelectedAlpha: Float = focusedAlpha, val pressedSelectedAlpha: Float = pressedAlpha, val hoveredSelectedAlpha: Float = hoveredAlpha, val focusedDisabledAlpha: Float = disabledAlpha, val pressedDisabledAlpha: Float = disabledAlpha, val hoveredDisabledAlpha: Float = disabledAlpha)
Link copied to clipboard
@Immutable
data class Border(val borderStroke: BorderStroke = BorderStroke(0.dp, Color.Unspecified), val inset: Dp = 0.dp, val shape: Shape = BorderDefaults.BorderDefaultShape)
Link copied to clipboard
Link copied to clipboard
open class BorderNode(shape: Shape, borderStroke: BorderStroke, inset: Dp) : Modifier.Node, DrawModifierNode
Link copied to clipboard
@Immutable
data class Borders(val border: Border = BorderDefaults.None, val focusedBorder: Border = border, val hoveredBorder: Border = focusedBorder, val pressedBorder: Border = focusedBorder, val selectedBorder: Border = border, val disabledBorder: Border = border, val focusedSelectedBorder: Border = focusedBorder, val pressedSelectedBorder: Border = pressedBorder, val hoveredSelectedBorder: Border = hoveredBorder, val focusedDisabledBorder: Border = disabledBorder, val pressedDisabledBorder: Border = disabledBorder, val hoveredDisabledBorder: Border = disabledBorder)
Link copied to clipboard
@Immutable
data class Colors(val backgroundColor: Color, val focusedBackgroundColor: Color = backgroundColor, val pressedBackgroundColor: Color = focusedBackgroundColor, val hoveredBackgroundColor: Color = focusedBackgroundColor, val selectedBackgroundColor: Color = backgroundColor, val disabledBackgroundColor: Color = backgroundColor.copy(alpha = DEFAULT_DISABLED_ALPHA), val focusedSelectedBackgroundColor: Color = focusedBackgroundColor, val pressedSelectedBackgroundColor: Color = pressedBackgroundColor, val hoveredSelectedBackgroundColor: Color = hoveredBackgroundColor, val focusedDisabledBackgroundColor: Color = disabledBackgroundColor, val pressedDisabledBackgroundColor: Color = disabledBackgroundColor, val hoveredDisabledBackgroundColor: Color = disabledBackgroundColor, val contentColor: Color, val focusedContentColor: Color = contentColor, val hoveredContentColor: Color = focusedContentColor, val pressedContentColor: Color = focusedContentColor, val selectedContentColor: Color = contentColor, val focusedSelectedContentColor: Color = focusedContentColor, val pressedSelectedContentColor: Color = pressedContentColor, val hoveredSelectedContentColor: Color = hoveredContentColor, val disabledContentColor: Color = contentColor.copy(alpha = DEFAULT_DISABLED_ALPHA), val focusedDisabledContentColor: Color = disabledContentColor, val pressedDisabledContentColor: Color = disabledContentColor, val hoveredDisabledContentColor: Color = focusedDisabledContentColor)
Link copied to clipboard
@Immutable
data class Scale(val scale: Float = 1.0f, val focusedScale: Float = scale, val hoveredScale: Float = focusedScale, val pressedScale: Float = focusedScale, val selectedScale: Float = scale, val disabledScale: Float = scale, val focusedSelectedScale: Float = focusedScale, val pressedSelectedScale: Float = pressedScale, val hoveredSelectedScale: Float = hoveredScale, val focusedDisabledScale: Float = disabledScale, val pressedDisabledScale: Float = disabledScale, val hoveredDisabledScale: Float = disabledScale)
Link copied to clipboard
@Immutable
data class Shapes(val shape: Shape = RectangleShape, val focusedShape: Shape = shape, val hoveredShape: Shape = focusedShape, val pressedShape: Shape = focusedShape, val selectedShape: Shape = shape, val disabledShape: Shape = shape, val focusedSelectedShape: Shape = focusedShape, val pressedSelectedShape: Shape = pressedShape, val hoveredSelectedShape: Shape = hoveredShape, val focusedDisabledShape: Shape = disabledShape, val pressedDisabledShape: Shape = disabledShape, val hoveredDisabledShape: Shape = disabledShape)
Link copied to clipboard
@Immutable
data class Style(val colors: Colors, val borders: Borders, val scale: Scale, val shapes: Shapes, val alpha: Alpha)

Style class for components.

Link copied to clipboard
Link copied to clipboard

A scope used to define the style properties of the element.

Link copied to clipboard

Functions

Link copied to clipboard
@Composable
fun animateInteractionScaleAsState(targetScale: Float, pressed: Boolean, focused: Boolean, hovered: Boolean, label: String = "interaction-scale", visibilityThreshold: Float = 0.01f, finishedListener: (Float) -> Unit? = null, animationSpecProvider: (pressed: Boolean, focused: Boolean, hovered: Boolean) -> AnimationSpec<Float> = { press, focus, hover -> defaultScaleAnimationSpec(pressed = press, focused = focus, hovered = hover) }): State<Float>

Fire-and-forget animation function for Float. Using animateFloatAsState on the provided targetScale updating based on the current Interaction provided on the interactionSource.

Link copied to clipboard
@Stable
fun Border(width: Dp = 0.dp, color: Color = Color.Unspecified, inset: Dp = 0.dp, shape: Shape = BorderDefaults.BorderDefaultShape): Border
Link copied to clipboard
fun Modifier.border(border: Border): Modifier
fun Modifier.border(shape: Shape = BorderDefaults.BorderDefaultShape, width: Dp = Dp.Unspecified, borderStroke: BorderStroke = BorderStroke(0.dp, Color.Unspecified), inset: Dp = 0.dp): Modifier
Link copied to clipboard
fun Modifier.clickable(enabled: Boolean = true, interactionSource: MutableInteractionSource? = null, style: Style? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier
fun Modifier.clickable(enabled: Boolean = true, interactionSource: MutableInteractionSource? = null, style: StyleScope.() -> Unit? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier

Interop Modifier.clickable to apply the correct clickable modifier based on the requirement for hardware input. For example if a Tv device is detected it adds support for hardware clicks from remote controls. This has the added support for Style, applying interactionStyle to update the component based on the current InteractionSource state.

Link copied to clipboard
@Stable
fun hardwareInputStyleIndication(style: Style = StyleDefaults.style()): IndicationNodeFactory

Experimental API to apply Style indication to a component based on the current interaction state.

Link copied to clipboard
fun Modifier.interactable(enabled: Boolean = true, selected: Boolean? = null, style: Style? = null, interactionSource: MutableInteractionSource? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier
fun Modifier.interactable(enabled: Boolean = true, selected: Boolean? = null, style: StyleScope.() -> Unit? = null, interactionSource: MutableInteractionSource? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier

Interop Modifier to support either Modifier.selectable or Modifier.clickable, applying the correct modifier based on the requirement for hardware input. For example if a Tv device is detected it adds support for hardware clicks from remote controls. This has the added support for Style, applying interactionStyle to update the component based on the current InteractionSource state.

Link copied to clipboard
fun Modifier.interactionStyle(interactionSource: InteractionSource?, enabled: Boolean = true, selected: Boolean = false, style: Style): Modifier
fun Modifier.interactionStyle(interactionSource: InteractionSource?, enabled: Boolean = true, selected: Boolean = false, block: StyleScope.() -> Unit): Modifier

Sets a Style on the element that reacts to interactions from the provided interactionSource.

Link copied to clipboard
fun Modifier.selectable(selected: Boolean, enabled: Boolean = true, interactionSource: MutableInteractionSource? = null, style: Style? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier
fun Modifier.selectable(selected: Boolean, enabled: Boolean = true, interactionSource: MutableInteractionSource? = null, style: StyleScope.() -> Unit? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier

Interop Modifier.selectable to apply the correct selectable modifier based on the requirement for hardware input. For example if a Tv device is detected it adds support for hardware clicks from remote controls. This has the added support for Style, applying interactionStyle to update