CountryPickerMotion

data class CountryPickerMotion(val enabled: Boolean = true, val press: FiniteAnimationSpec<Float> = spring(dampingRatio = 0.7f, stiffness = 900f), val selection: FiniteAnimationSpec<Float> = spring(dampingRatio = 0.55f, stiffness = Spring.StiffnessMedium), val layout: FiniteAnimationSpec<Float> = spring(dampingRatio = 0.86f, stiffness = 420f), val offset: FiniteAnimationSpec<IntOffset> = spring( dampingRatio = 0.86f, stiffness = 420f, visibilityThreshold = IntOffset.VisibilityThreshold, ), val size: FiniteAnimationSpec<IntSize> = spring( dampingRatio = 0.9f, stiffness = 500f, visibilityThreshold = IntSize.VisibilityThreshold, ), val dp: FiniteAnimationSpec<Dp> = spring(dampingRatio = 0.8f, stiffness = 600f, visibilityThreshold = 0.1.dp), val color: FiniteAnimationSpec<Color> = tween(COLOR_MILLIS, easing = Standard), val fadeIn: FiniteAnimationSpec<Float> = tween(FADE_IN_MILLIS, easing = EmphasizedDecelerate), val fadeOut: FiniteAnimationSpec<Float> = tween(FADE_OUT_MILLIS, easing = EmphasizedAccelerate), val pressedScale: Float = 0.97f, val shakeDistance: Dp = 7.dp, val selectionDismissDelayMillis: Long = 240, val staggerMillis: Int = 16, val maxStaggeredItems: Int = 14)(source)

How the picker moves.

Interactive motion — presses, selection, layout — is spring-based, so it can be interrupted and reversed mid-flight and always settles from its current velocity rather than restarting. Fades use short eased tweens, which read cleaner than springs for opacity.

Motion switches off entirely when enabled is false, and CountryPickerStyles presets turn it off automatically when the user has asked the system to remove or reduce animations.

Constructors

Link copied to clipboard
constructor(enabled: Boolean = true, press: FiniteAnimationSpec<Float> = spring(dampingRatio = 0.7f, stiffness = 900f), selection: FiniteAnimationSpec<Float> = spring(dampingRatio = 0.55f, stiffness = Spring.StiffnessMedium), layout: FiniteAnimationSpec<Float> = spring(dampingRatio = 0.86f, stiffness = 420f), offset: FiniteAnimationSpec<IntOffset> = spring( dampingRatio = 0.86f, stiffness = 420f, visibilityThreshold = IntOffset.VisibilityThreshold, ), size: FiniteAnimationSpec<IntSize> = spring( dampingRatio = 0.9f, stiffness = 500f, visibilityThreshold = IntSize.VisibilityThreshold, ), dp: FiniteAnimationSpec<Dp> = spring(dampingRatio = 0.8f, stiffness = 600f, visibilityThreshold = 0.1.dp), color: FiniteAnimationSpec<Color> = tween(COLOR_MILLIS, easing = Standard), fadeIn: FiniteAnimationSpec<Float> = tween(FADE_IN_MILLIS, easing = EmphasizedDecelerate), fadeOut: FiniteAnimationSpec<Float> = tween(FADE_OUT_MILLIS, easing = EmphasizedAccelerate), pressedScale: Float = 0.97f, shakeDistance: Dp = 7.dp, selectionDismissDelayMillis: Long = 240, staggerMillis: Int = 16, maxStaggeredItems: Int = 14)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Color transitions.

Link copied to clipboard

Border widths, rings and other dimension changes.

Link copied to clipboard

False collapses every animation to an instant change.

Link copied to clipboard

Content appearing.

Link copied to clipboard

Content leaving.

Link copied to clipboard

Size and position changes.

Link copied to clipboard

Items beyond this appear without delay.

Link copied to clipboard

Item placement and slides.

Link copied to clipboard

Press-down scale feedback.

Link copied to clipboard

Scale applied to a pressed row, tile or button.

Link copied to clipboard

Check marks, toggles and the sliding filter pill — slightly bouncy, so a selection feels physical.

Link copied to clipboard

Pause between a single selection and the sheet closing, so the check mark visibly lands first.

Link copied to clipboard

How far a field shakes when it enters an error state.

Link copied to clipboard

Container resizing.

Link copied to clipboard

Delay between successive list items on the sheet's first appearance.

Functions

Link copied to clipboard

Disables motion when the user has turned animations off at the system level: an animator duration scale of zero on Android ("Remove animations" / developer options), Reduce Motion on iOS.

Link copied to clipboard

This motion with every animation made instant when enabled is false.