WideButtonDefaults
object WideButtonDefaults
Summary
Public functions |
|
|---|---|
Unit |
@ComposableDefault background for a |
ButtonBorder |
@ComposableCreates a |
WideButtonContentColor |
@ComposableCreates a |
ButtonGlow |
Creates a |
ButtonScale |
scale(Creates a |
ButtonShape |
shape(Creates a |
Public functions
Background
@Composable
fun Background(enabled: Boolean, interactionSource: MutableInteractionSource): Unit
Default background for a WideButton
border
@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 = ContainerShape )
): ButtonBorder
Creates a ButtonBorder that represents the default Borders applied on a WideButton in different Interaction states
| Parameters | |
|---|---|
border: Border = Border.None |
the |
focusedBorder: Border = border |
the |
pressedBorder: Border = focusedBorder |
the |
disabledBorder: Border = border |
the |
focusedDisabledBorder: Border = Border(
border = BorderStroke(width = 2.dp, color = MaterialTheme.colorScheme.border),
inset = 0.dp,
shape = ContainerShape
) |
the |
contentColor
@Composable
fun contentColor(
color: Color = MaterialTheme.colorScheme.onSurface,
focusedColor: Color = MaterialTheme.colorScheme.inverseOnSurface,
pressedColor: Color = focusedColor,
disabledColor: Color = color
): WideButtonContentColor
Creates a WideButtonContentColor that represents the default content colors used in a WideButton
| Parameters | |
|---|---|
color: Color = MaterialTheme.colorScheme.onSurface |
the content color of this Button when enabled |
focusedColor: Color = MaterialTheme.colorScheme.inverseOnSurface |
the content color of this Button when enabled and focused |
pressedColor: Color = focusedColor |
the content color of this Button when enabled and pressed |
disabledColor: Color = color |
the content color of this Button when not enabled |
glow
fun glow(glow: Glow = Glow.None, focusedGlow: Glow = glow, pressedGlow: Glow = glow): ButtonGlow
Creates a ButtonGlow that represents the default Glows used in a WideButton
scale
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
): ButtonScale
Creates a ButtonScale that represents the default scales used in a WideButton. Scale is 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 Button when enabled |
focusedScale: @FloatRange(from = 0.0) Float = 1.1f |
the scale to be used for this Button when focused |
pressedScale: @FloatRange(from = 0.0) Float = scale |
the scale to be used for this Button when pressed |
disabledScale: @FloatRange(from = 0.0) Float = scale |
the scale to be used for this Button when disabled |
focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale |
the scale to be used for this Button when disabled and focused |
shape
fun shape(
shape: Shape = ContainerShape,
focusedShape: Shape = shape,
pressedShape: Shape = shape,
disabledShape: Shape = shape,
focusedDisabledShape: Shape = disabledShape
): ButtonShape
Creates a ButtonShape that represents the default container shapes used in a WideButton
| Parameters | |
|---|---|
shape: Shape = ContainerShape |
the shape used when the Button is enabled, and has no other |
focusedShape: Shape = shape |
the shape used when the Button is enabled and focused |
pressedShape: Shape = shape |
the shape used when the Button is enabled pressed |
disabledShape: Shape = shape |
the shape used when the Button is not enabled |
focusedDisabledShape: Shape = disabledShape |
the shape used when the Button is not enabled and focused |