Object

SwitchDefaults

Contains the default values used by Switch.

Source set: Android
public object SwitchDefaults

Contains the default values used by Switch.

Functions

colors

Source set: Android
@Composable
    public fun colors(
        checkedThumbColor: Color = MaterialTheme.colors.secondary,
        checkedTrackColor: Color = checkedThumbColor.copy(alpha = ContentAlpha.disabled),
        uncheckedThumbColor: Color = MaterialTheme.colors.onSurface.copy(alpha = 0.6f),
        uncheckedTrackColor: Color =
            uncheckedThumbColor.copy(alpha = uncheckedThumbColor.alpha * ContentAlpha.disabled),
    ): SwitchColors

Creates a SwitchColors for use in a Switch.

Parameters

checkedThumbColor The thumb color of this Switch when enabled and checked.
checkedTrackColor The track color of this Switch when enabled and checked.
uncheckedThumbColor The thumb color of this Switch when enabled and unchecked.
uncheckedTrackColor The track color of this Switch when enabled and unchecked.
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: