ButtonConstants
objectButtonConstants
kotlin.Any | |
↳ | androidx.compose.material.ButtonConstants |
Contains the default values used by Button
Summary
Constants | |
---|---|
const Float |
The default color opacity used for an OutlinedButton's border color |
Public methods | |
---|---|
ButtonColors |
defaultButtonColors(backgroundColor: Color = MaterialTheme.colors.primary, disabledBackgroundColor: Color = MaterialTheme.colors.onSurface.copy(alpha = 0.12f)
.compositeOver(MaterialTheme.colors.surface), contentColor: Color = contentColorFor(backgroundColor), disabledContentColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = ContentAlpha.disabled)) Creates a ButtonColors that represents the default background and content colors used in a Button. |
ButtonElevation |
defaultElevation(defaultElevation: Dp = 2.dp, pressedElevation: Dp = 8.dp, disabledElevation: Dp = 0.dp) Creates a ButtonElevation that will animate between the provided values according to the Material specification for a Button. |
ButtonColors |
defaultOutlinedButtonColors(backgroundColor: Color = MaterialTheme.colors.surface, contentColor: Color = MaterialTheme.colors.primary, disabledContentColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = ContentAlpha.disabled)) Creates a ButtonColors that represents the default background and content colors used in an OutlinedButton. |
ButtonColors |
defaultTextButtonColors(backgroundColor: Color = Color.Transparent, contentColor: Color = MaterialTheme.colors.primary, disabledContentColor: Color = MaterialTheme.colors.onSurface
.copy(alpha = ContentAlpha.disabled)) Creates a ButtonColors that represents the default background and content colors used in a TextButton. |
Properties | |
---|---|
PaddingValues |
The default content padding used by Button |
Dp |
The default size of the icon when used inside a Button. |
Dp |
The default size of the spacing between an icon and a text when they used inside a Button. |
Dp |
The default min width applied for the Button. |
Dp |
The default min width applied for the Button. |
PaddingValues |
The default content padding used by TextButton |
Dp |
The default OutlinedButton's border size |
BorderStroke |
The default disabled content color used by all types of Buttons |
Constants
OutlinedBorderOpacity
const val OutlinedBorderOpacity: Float
The default color opacity used for an OutlinedButton's border color
Value: 0.12f
Public methods
defaultButtonColors
@Composable fundefaultButtonColors(
backgroundColor: Color = MaterialTheme.colors.primary,
disabledBackgroundColor: Color = MaterialTheme.colors.onSurface.copy(alpha = 0.12f) .compositeOver(MaterialTheme.colors.surface),
contentColor: Color = contentColorFor(backgroundColor),
disabledContentColor: Color = MaterialTheme.colors.onSurface .copy(alpha = ContentAlpha.disabled)
): ButtonColors
Deprecated.
Creates a ButtonColors that represents the default background and content colors used in a Button.
Parameters | |
---|---|
backgroundColor: Color = MaterialTheme.colors.primary | the background color of this Button when enabled |
disabledBackgroundColor: Color = MaterialTheme.colors.onSurface.copy(alpha = 0.12f) .compositeOver(MaterialTheme.colors.surface) | the background color of this Button when not enabled |
contentColor: Color = contentColorFor(backgroundColor) | the content color of this Button when enabled |
disabledContentColor: Color = MaterialTheme.colors.onSurface .copy(alpha = ContentAlpha.disabled) | the content color of this Button when not enabled |
defaultElevation
@Composable fundefaultElevation(
defaultElevation: Dp = 2.dp,
pressedElevation: Dp = 8.dp,
disabledElevation: Dp = 0.dp
): ButtonElevation
Deprecated.
Creates a ButtonElevation that will animate between the provided values according to the Material specification for a Button.
Parameters | |
---|---|
defaultElevation: Dp = 2.dp | the elevation to use when the Button is enabled, and has no other Interactions. |
pressedElevation: Dp = 8.dp | the elevation to use when the Button is enabled and is Interaction.Pressed. |
disabledElevation: Dp = 0.dp | the elevation to use when the Button is not enabled. |
defaultOutlinedButtonColors
@Composable fundefaultOutlinedButtonColors(
backgroundColor: Color = MaterialTheme.colors.surface,
contentColor: Color = MaterialTheme.colors.primary,
disabledContentColor: Color = MaterialTheme.colors.onSurface .copy(alpha = ContentAlpha.disabled)
): ButtonColors
Deprecated.
Creates a ButtonColors that represents the default background and content colors used in an OutlinedButton.
Parameters | |
---|---|
backgroundColor: Color = MaterialTheme.colors.surface | the background color of this OutlinedButton |
contentColor: Color = MaterialTheme.colors.primary | the content color of this |