SwitchDefaults

object SwitchDefaults


Contains the default values used by Switch.

Summary

Public functions

SwitchColors
@Composable
colors(
    checkedThumbColor: Color,
    checkedTrackColor: Color,
    uncheckedThumbColor: Color,
    uncheckedTrackColor: Color
)

Creates a SwitchColors for use in a Switch.

Public functions

colors

@Composable
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: Color = MaterialTheme.colors.secondary

The thumb color of this Switch when enabled and checked.

checkedTrackColor: Color = checkedThumbColor.copy(alpha = ContentAlpha.disabled)

The track color of this Switch when enabled and checked.

uncheckedThumbColor: Color = MaterialTheme.colors.onSurface.copy(alpha = 0.6f)

The thumb color of this Switch when enabled and unchecked.

uncheckedTrackColor: Color = uncheckedThumbColor.copy(alpha = uncheckedThumbColor.alpha * ContentAlpha.disabled)

The track color of this Switch when enabled and unchecked.