Switch Defaults
object SwitchDefaults
Properties
Link copied to clipboard
The thumb offset in the checked (on) position.
Link copied to clipboard
The drop shadow under the thumb while the Switch is enabled (COUISwitch.setPaintShadowLayer at the 3.5x ColorOS reference density).
Link copied to clipboard
The thumb offset in the unchecked (off) position.
Link copied to clipboard
The track height of the Switch (COUISwitch bar_height).
Link copied to clipboard
The track width of the Switch (COUISwitch bar_width).
Functions
Link copied to clipboard
fun switchColors(checkedThumbColor: Color = if (isDynamicColor) LocalColors.current.onPrimary else COUITheme.colorScheme.onPrimary, uncheckedThumbColor: Color = if (isDynamicColor) LocalColors.current.onPrimary else COUITheme.colorScheme.onSecondary, disabledCheckedThumbColor: Color = if (isDynamicColor) LocalColors.current.surface else COUITheme.colorScheme.disabledOnPrimary, disabledUncheckedThumbColor: Color = COUITheme.colorScheme.disabledOnSecondary, checkedTrackColor: Color = COUITheme.colorScheme.primary, uncheckedTrackColor: Color = COUITheme.colorScheme.secondary, disabledCheckedTrackColor: Color = COUITheme.colorScheme.disabledPrimary, disabledUncheckedTrackColor: Color = COUITheme.colorScheme.disabledSecondary): SwitchColors
The default colors for the Switch. COUISwitch keeps the thumb white in both states.