{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

SwitchDefaults

public static class SwitchDefaults


Contains the default values used by Switch

Summary

Public fields

static @NonNull SwitchDefaults

Public methods

final @NonNull SwitchColors

Creates a SwitchColors that represents the different colors used in a Switch in different states.

final @NonNull SwitchColors
@Composable
colors(
    @NonNull Color checkedThumbColor,
    @NonNull Color checkedTrackColor,
    @NonNull Color checkedBorderColor,
    @NonNull Color checkedIconColor,
    @NonNull Color uncheckedThumbColor,
    @NonNull Color uncheckedTrackColor,
    @NonNull Color uncheckedBorderColor,
    @NonNull Color uncheckedIconColor,
    @NonNull Color disabledCheckedThumbColor,
    @NonNull Color disabledCheckedTrackColor,
    @NonNull Color disabledCheckedBorderColor,
    @NonNull Color disabledCheckedIconColor,
    @NonNull Color disabledUncheckedThumbColor,
    @NonNull Color disabledUncheckedTrackColor,
    @NonNull Color disabledUncheckedBorderColor,
    @NonNull Color disabledUncheckedIconColor
)

Creates a SwitchColors that represents the different colors used in a Switch in different states.

final @NonNull Dp

Icon size to use for thumbContent

Public fields

INSTANCE

public static @NonNull SwitchDefaults INSTANCE

Public methods

colors

@Composable
public final @NonNull SwitchColors colors()

Creates a SwitchColors that represents the different colors used in a Switch in different states.

colors

@Composable
public final @NonNull SwitchColors colors(
    @NonNull Color checkedThumbColor,
    @NonNull Color checkedTrackColor,
    @NonNull Color checkedBorderColor,
    @NonNull Color checkedIconColor,
    @NonNull Color uncheckedThumbColor,
    @NonNull Color uncheckedTrackColor,
    @NonNull Color uncheckedBorderColor,
    @NonNull Color uncheckedIconColor,
    @NonNull Color disabledCheckedThumbColor,
    @NonNull Color disabledCheckedTrackColor,
    @NonNull Color disabledCheckedBorderColor,
    @NonNull Color disabledCheckedIconColor,
    @NonNull Color disabledUncheckedThumbColor,
    @NonNull Color disabledUncheckedTrackColor,
    @NonNull Color disabledUncheckedBorderColor,
    @NonNull Color disabledUncheckedIconColor
)

Creates a SwitchColors that represents the different colors used in a Switch in different states.

Parameters
@NonNull Color checkedThumbColor

the color used for the thumb when enabled and checked

@NonNull Color checkedTrackColor

the color used for the track when enabled and checked

@NonNull Color checkedBorderColor

the color used for the border when enabled and checked

@NonNull Color checkedIconColor

the color used for the icon when enabled and checked

@NonNull Color uncheckedThumbColor

the color used for the thumb when enabled and unchecked

@NonNull Color uncheckedTrackColor

the color used for the track when enabled and unchecked

@NonNull Color uncheckedBorderColor

the color used for the border when enabled and unchecked

@NonNull Color uncheckedIconColor

the color used for the icon when enabled and unchecked

@NonNull Color disabledCheckedThumbColor

the color used for the thumb when disabled and checked

@NonNull Color disabledCheckedTrackColor

the color used for the track when disabled and checked

@NonNull Color disabledCheckedBorderColor

the color used for the border when disabled and checked

@NonNull Color disabledCheckedIconColor

the color used for the icon when disabled and checked

@NonNull Color disabledUncheckedThumbColor

the color used for the thumb when disabled and unchecked

@NonNull Color disabledUncheckedTrackColor

the color used for the track when disabled and unchecked

@NonNull Color disabledUncheckedBorderColor

the color used for the border when disabled and unchecked

@NonNull Color disabledUncheckedIconColor

the color used for the icon when disabled and unchecked

getIconSize

public final @NonNull Dp getIconSize()

Icon size to use for thumbContent