Object

RemoteIconToggleButtonDefaults

Contains the default values used by RemoteIconToggleButton.

Source set: Android
public object RemoteIconToggleButtonDefaults

Contains the default values used by RemoteIconToggleButton.

Properties

shape

Source set: Android
public val shape: RemoteRoundedCornerShape = RemoteCircleShape

Recommended RemoteShape for RemoteIconToggleButton.

checkedShape

Source set: Android
public val checkedShape: RemoteCornerBasedShape

Recommended checked RemoteShape for RemoteIconToggleButton when using variantShapes or variantAnimatedShapes.

pressedShape

Source set: Android
public val pressedShape: RemoteCornerBasedShape

Recommended pressed RemoteShape for RemoteIconToggleButton when using animatedShapes.

SmallIconSize

Source set: Android
public val SmallIconSize: RemoteDp = 24.rdp

The recommended size of an icon when used inside an icon toggle button with size SmallSize. Use iconSizeFor to easily determine the icon size.

DefaultIconSize

Source set: Android
public val DefaultIconSize: RemoteDp = 26.rdp

The default size of an icon when used inside an icon toggle button of size Size. Use iconSizeFor to easily determine the icon size.

LargeIconSize

Source set: Android
public val LargeIconSize: RemoteDp = 32.rdp

The size of an icon when used inside an icon toggle button with size LargeSize. Use iconSizeFor to easily determine the icon size.

ExtraLargeIconSize

Source set: Android
public val ExtraLargeIconSize: RemoteDp = 36.rdp

The size of an icon when used inside an icon toggle button with size ExtraLargeSize. Use iconSizeFor to easily determine the icon size.

SmallSize

Source set: Android
public val SmallSize: RemoteDp = 48.rdp

The recommended size for a small RemoteIconToggleButton.

Size

Source set: Android
public val Size: RemoteDp = 52.rdp

The default size applied for RemoteIconToggleButton.

LargeSize

Source set: Android
public val LargeSize: RemoteDp = 60.rdp

The recommended size for a large RemoteIconToggleButton.

ExtraLargeSize

Source set: Android
public val ExtraLargeSize: RemoteDp = 72.rdp

The recommended size for an extra large RemoteIconToggleButton.

Functions

iconSizeFor

Source set: Android
public fun iconSizeFor(buttonSize: RemoteDp): RemoteDp

Recommended icon size for a given icon toggle button size.

Ensures that the minimum recommended icon size is applied.

Examples: for size LargeSize, returns LargeIconSize, for size ExtraLargeSize returns ExtraLargeIconSize.

Parameters

buttonSize The size of the icon toggle button

Return

the recommended icon size in RemoteDp for buttonSize

shapes

Source set: Android
@Composable @RemoteComposable public fun shapes(): RemoteIconToggleButtonShapes

Creates a RemoteIconToggleButtonShapes with a static shape that doesn't change between the checked and unchecked states.

Return

a RemoteIconToggleButtonShapes with the default static shape

shapes

Source set: Android
@Composable
    public fun shapes(shape: RemoteShape): RemoteIconToggleButtonShapes

Creates a RemoteIconToggleButtonShapes with a static shape that doesn't change between the checked and unchecked states.

Parameters

shape The shape of the toggle button.

Return

a RemoteIconToggleButtonShapes with the given static shape

variantShapes

Source set: Android
@Composable
    public fun variantShapes(
        uncheckedShape: RemoteCornerBasedShape = shape,
        checkedShape: RemoteCornerBasedShape = this.checkedShape,
    ): RemoteIconToggleButtonShapes

Creates a RemoteIconToggleButtonShapes where the toggle button changes from uncheckedShape to checkedShape when checked.

The shape is selected at playback time when RemoteIconToggleButton's checked is not a constant, which requires both shapes to be RemoteRoundedCornerShapes.

Parameters

uncheckedShape The shape of the toggle button when unchecked.
checkedShape The shape of the toggle button when checked.

Return

a RemoteIconToggleButtonShapes with the configured unchecked and checked shapes

animatedShapes

Source set: Android
@Composable
    public fun animatedShapes(
        shape: RemoteCornerBasedShape = this.shape,
        pressedShape: RemoteCornerBasedShape = this.pressedShape,
    ): RemoteIconToggleButtonShapes

Creates a RemoteIconToggleButtonShapes with a static shape that animates to pressedShape when pressed.

The press animation requires both shapes to be RemoteRoundedCornerShapes. It is driven by touch events on the player, and is not shown by players that don't dispatch them.

Parameters

shape The shape of the toggle button when not pressed.
pressedShape The shape of the toggle button when pressed.

Return

a RemoteIconToggleButtonShapes with the configured resting and pressed shapes

variantAnimatedShapes

Source set: Android
@Composable
    public fun variantAnimatedShapes(
        uncheckedShape: RemoteCornerBasedShape = shape,
        checkedShape: RemoteCornerBasedShape = this.checkedShape,
    ): RemoteIconToggleButtonShapes

Creates a RemoteIconToggleButtonShapes where the toggle button changes from uncheckedShape to checkedShape when checked, and animates to a shape with smaller corners when pressed.

Dynamic shape selection and the press animation require both shapes to be RemoteRoundedCornerShapes. The press animation is driven by touch events on the player, and is not shown by players that don't dispatch them.

Parameters

uncheckedShape The shape of the toggle button when unchecked.
checkedShape The shape of the toggle button when checked.

Return

a RemoteIconToggleButtonShapes with the configured unchecked, checked and pressed shapes

colors

Source set: Android
@Composable
    public fun colors(): RemoteIconToggleButtonColors

Creates a RemoteIconToggleButtonColors for a RemoteIconToggleButton - by default, a primary container when checked and a tonal container when unchecked.

Return

a RemoteIconToggleButtonColors with the default colors for RemoteIconToggleButton

colors

Source set: Android
@Composable
    public fun colors(
        checkedContainerColor: RemoteColor? = null,
        checkedContentColor: RemoteColor? = null,
        uncheckedContainerColor: RemoteColor? = null,
        uncheckedContentColor: RemoteColor? = null,
        disabledCheckedContainerColor: RemoteColor? = null,
        disabledCheckedContentColor: RemoteColor? = null,
        disabledUncheckedContainerColor: RemoteColor? = null,
        disabledUncheckedContentColor: RemoteColor? = null,
    ): RemoteIconToggleButtonColors

Creates a RemoteIconToggleButtonColors for a RemoteIconToggleButton - by default, a primary container when checked and a tonal container when unchecked.

Parameters

checkedContainerColor The container color of this toggle button when enabled and checked, or null to use the theme default.
checkedContentColor The content color of this toggle button when enabled and checked, or null to use the theme default.
uncheckedContainerColor The container color of this toggle button when enabled and unchecked, or null to use the theme default.
uncheckedContentColor The content color of this toggle button when enabled and unchecked, or null to use the theme default.
disabledCheckedContainerColor The container color of this toggle button when checked and not enabled, or null to use the theme default.
disabledCheckedContentColor The content color of this toggle button when checked and not enabled, or null to use the theme default.
disabledUncheckedContainerColor The container color of this toggle button when unchecked and not enabled, or null to use the theme default.
disabledUncheckedContentColor The content color of this toggle button when unchecked and not enabled, or null to use the theme default.

Return

a RemoteIconToggleButtonColors with the configured colors for RemoteIconToggleButton

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: