Object

TextToggleButtonDefaults

Contains the default values used by TextToggleButton.

Source set: Android
public object TextToggleButtonDefaults

Contains the default values used by TextToggleButton.

Properties

shape

Source set: Android
public val shape: RoundedCornerShape

Recommended Shape for TextToggleButton.

pressedShape

Source set: Android
public val pressedShape: CornerBasedShape

Recommended pressed Shape for TextToggleButton.

checkedShape

Source set: Android
public val checkedShape: CornerBasedShape

Recommended checked Shape for TextToggleButton.

Size

Source set: Android
public val Size: Dp

The default size applied for text toggle buttons. It is recommended to apply this size using Modifier.touchTargetAwareSize.

LargeSize

Source set: Android
public val LargeSize: Dp

The recommended size for a large text toggle button. It is recommended to apply this size using Modifier.touchTargetAwareSize.

ExtraLargeSize

Source set: Android
public val ExtraLargeSize: Dp

The recommended size for an extra large text toggle button. It is recommended to apply this size using Modifier.touchTargetAwareSize.

textStyle

Source set: Android
public val textStyle: TextStyle

The default text style applied for text toggle buttons.

largeTextStyle

Source set: Android
public val largeTextStyle: TextStyle

The recommended text style for a large text toggle button.

extraLargeTextStyle

Source set: Android
public val extraLargeTextStyle: TextStyle

The recommended text style for an extra large text toggle button.

Functions

shapes

@Composable
public fun shapes(): TextToggleButtonShapes

Returns the default TextToggleButtonShapes for a TextToggleButton with a static shape.

shapes

@Composable
public fun shapes(shape: Shape): TextToggleButtonShapes

Returns a TextToggleButtonShapes for a TextToggleButton with a static shape.

Parameters

shape The normal shape of the TextToggleButton.

animatedShapes

@Composable
public fun animatedShapes(): TextToggleButtonShapes

Returns the default TextToggleButtonShapes with an animation between two CornerBasedShapes when pressed.

A simple text toggle button using the default colors, animated when pressed.

animatedShapes

@Composable
public fun animatedShapes(
    shape: CornerBasedShape? = null,
    pressedShape: CornerBasedShape? = null,
): TextToggleButtonShapes

Returns a TextToggleButtonShapes with an animation between two CornerBasedShapes when pressed.

A simple text toggle button using the default colors, animated when pressed.

Parameters

shape The normal shape of the TextToggleButton - if null, the default TextToggleButtonDefaults.shape is used.
pressedShape The pressed shape of the TextToggleButton if null, the default TextToggleButtonDefaults.pressedShape is used.

variantAnimatedShapes

@Composable
public fun variantAnimatedShapes(): TextToggleButtonShapes

Returns the default TextToggleButtonShapes with an animation between three CornerSizes based on the pressed state and checked/unchecked.

A simple text toggle button using the default colors, animated on Press and Check/Uncheck:

variantAnimatedShapes

@Composable
public fun variantAnimatedShapes(
    uncheckedShape: CornerBasedShape? = null,
    checkedShape: CornerBasedShape? = null,
): TextToggleButtonShapes

Returns a TextToggleButtonShapes with an animation between three CornerSizes based on the pressed state and checked/unchecked.

A simple text toggle button using the default colors, animated on Press and Check/Uncheck:

Parameters

uncheckedShape the unchecked shape - if null, the default TextToggleButtonDefaults.shape is used.
checkedShape the checked shape - if null, the default TextToggleButtonDefaults.checkedShape is used.

colors

@Composable
public fun colors(): TextToggleButtonColors

Returns a TextToggleButtonColors for a TextToggleButton

  • by default, a colored background with a contrasting content color. If the button is disabled, then the colors will have an alpha (DisabledContainerAlpha or DisabledContentAlpha) value applied.

colors

@Composable
public fun colors(
    checkedContainerColor: Color = Color.Unspecified,
    checkedContentColor: Color = Color.Unspecified,
    uncheckedContainerColor: Color = Color.Unspecified,
    uncheckedContentColor: Color = Color.Unspecified,
    disabledCheckedContainerColor: Color = Color.Unspecified,
    disabledCheckedContentColor: Color = Color.Unspecified,
    disabledUncheckedContainerColor: Color = Color.Unspecified,
    disabledUncheckedContentColor: Color = Color.Unspecified,
): TextToggleButtonColors

Returns a TextToggleButtonColors for a TextToggleButton

  • by default, a colored background with a contrasting content color. If the button is disabled, then the colors will have an alpha (DisabledContainerAlpha or DisabledContentAlpha) value applied.

Parameters

checkedContainerColor the container color of this TextToggleButton when enabled and checked
checkedContentColor the content color of this TextToggleButton when enabled and checked
uncheckedContainerColor the container color of this TextToggleButton when enabled and unchecked
uncheckedContentColor the content color of this TextToggleButton when enabled and unchecked
disabledCheckedContainerColor the container color of this TextToggleButton when checked and not enabled
disabledCheckedContentColor the content color of this TextToggleButton when checked and not enabled
disabledUncheckedContainerColor the container color of this TextToggleButton when unchecked and not enabled
disabledUncheckedContentColor the content color of this TextToggleButton when unchecked and not enabled

Last updated: