DefaultSlideToUnlockColors

data class DefaultSlideToUnlockColors(val startTrackColor: Color = Color(0xFF111111), val endTrackColor: Color = Color(0x9F9C9399), val trackBrush: Brush? = null, val startHintColor: Color = Color.White, val endHintColor: Color = Color.White.copy(alpha = 0f), val slidedHintColor: Color = Color.Black, val thumbColor: Color = Color.White, val thumbIconColor: Color = Color.Black, val thumbBrush: Brush? = null, val progressColor: Color = Color(0xFF11D483)) : SlideToUnlockColors

The default, concrete implementation of the SlideToUnlockColors interface.

This data class holds the specific color values and implements the logic for interpolating colors based on the swipe fraction. It is marked as Stable to ensure that Compose can perform optimizations when it is used as a parameter in a composable.

Constructors

Link copied to clipboard
constructor(startTrackColor: Color = Color(0xFF111111), endTrackColor: Color = Color(0x9F9C9399), trackBrush: Brush? = null, startHintColor: Color = Color.White, endHintColor: Color = Color.White.copy(alpha = 0f), slidedHintColor: Color = Color.Black, thumbColor: Color = Color.White, thumbIconColor: Color = Color.Black, thumbBrush: Brush? = null, progressColor: Color = Color(0xFF11D483))

Properties

Link copied to clipboard

The color of the hint text at the end of the swipe (usually transparent).

Link copied to clipboard

The color of the track when the thumb is at the end.

Link copied to clipboard

The color used for the circular progress indicator.

Link copied to clipboard

The color of the hint text after the slide is completed.

Link copied to clipboard

The color of the hint text at the start of the swipe.

Link copied to clipboard

The color of the track when the thumb is at the start.

Link copied to clipboard
val thumbBrush: Brush? = null

An optional brush for the thumb.

Link copied to clipboard

The solid background color of the thumb.

Link copied to clipboard

The color of the icon displayed inside the thumb.

Link copied to clipboard
val trackBrush: Brush? = null

An optional brush for the track, which overrides color if non-null.

Functions

Link copied to clipboard
open override fun hintColor(slideFraction: Float): Color

Fades out the hint color as the user progresses the swipe.

Link copied to clipboard
open override fun progressColor(): Color

Returns the color used for the loading indicator.

Link copied to clipboard
open override fun slidedHintColor(): Color

Returns the hint text color after the swipe is completed.

Link copied to clipboard
open override fun thumbBrush(slideFraction: Float): Brush?

Returns the brush to be used for the thumb, if provided.

Link copied to clipboard
open override fun thumbColor(): Color

Returns the color for the thumb background.

Link copied to clipboard
open override fun thumbIconColor(): Color

Returns the color for the icon inside the thumb.

Link copied to clipboard
open override fun trackBrush(slideFraction: Float): Brush?

Returns the brush to be used for the track, if provided.

Link copied to clipboard
open override fun trackColor(slideFraction: Float): Color

Interpolates between startTrackColor and endTrackColor based on the swipe progress.