ToggleButtonDefaults
object ToggleButtonDefaults
Contains the default values used by ToggleButton
.
Summary
Public functions |
|
---|---|
ToggleButtonColors |
@Composable Creates a |
Public properties |
|
---|---|
Dp |
The default size of an icon when used inside a default-sized |
Role |
Role semantics that accessibility services can use to provide more context to users. |
Dp |
The default size applied for the |
Dp |
The size of an icon when used inside a small-sized |
Dp |
The recommended size for a small |
Public functions
toggleButtonColors
@Composable
fun toggleButtonColors(
checkedBackgroundColor: Color = MaterialTheme.colors.primary,
checkedContentColor: Color = contentColorFor(checkedBackgroundColor),
disabledCheckedBackgroundColor: Color = checkedBackgroundColor.copy(alpha = ContentAlpha.disabled),
disabledCheckedContentColor: Color = MaterialTheme.colors.background,
uncheckedBackgroundColor: Color = MaterialTheme.colors.surface,
uncheckedContentColor: Color = contentColorFor(uncheckedBackgroundColor),
disabledUncheckedBackgroundColor: Color = uncheckedBackgroundColor.copy(alpha = ContentAlpha.disabled),
disabledUncheckedContentColor: Color = uncheckedContentColor.copy(alpha = ContentAlpha.disabled)
): ToggleButtonColors
Creates a ToggleButtonColors
that represents the background and content colors used in a ToggleButton
. Defaults to primary-styled checked colors and surface-styled unchecked colors.
Parameters | |
---|---|
checkedBackgroundColor: Color = MaterialTheme.colors.primary |
the background color of this |
checkedContentColor: Color = contentColorFor(checkedBackgroundColor) |
the content color of this |
disabledCheckedBackgroundColor: Color = checkedBackgroundColor.copy(alpha = ContentAlpha.disabled) |
the background color of this |
disabledCheckedContentColor: Color = MaterialTheme.colors.background |
the content color of this |
uncheckedBackgroundColor: Color = MaterialTheme.colors.surface |
the background color of this |
uncheckedContentColor: Color = contentColorFor(uncheckedBackgroundColor) |
the content color of this |
disabledUncheckedBackgroundColor: Color = uncheckedBackgroundColor.copy(alpha = ContentAlpha.disabled) |
the background color of this |
disabledUncheckedContentColor: Color = uncheckedContentColor.copy(alpha = ContentAlpha.disabled) |
the content color of this |
Public properties
DefaultIconSize
val DefaultIconSize: Dp
The default size of an icon when used inside a default-sized ToggleButton
.
DefaultRole
val DefaultRole: Role
Role semantics that accessibility services can use to provide more context to users.
DefaultToggleButtonSize
val DefaultToggleButtonSize: Dp
The default size applied for the ToggleButton
. Note that you can override it by applying Modifier.size directly on ToggleButton
.
SmallIconSize
val SmallIconSize: Dp
The size of an icon when used inside a small-sized ToggleButton
.
SmallToggleButtonSize
val SmallToggleButtonSize: Dp
The recommended size for a small ToggleButton
. You can apply this value for the size by overriding Modifier.size directly on ToggleButton
.