object PickerDefaults


Contains the default values used by Picker.

Summary

Public functions

FlingBehavior

Create and remember a FlingBehavior that will represent natural fling curve with snap to central item as the fling decays.

ScalingParams
scalingParams(
    edgeScale: Float,
    edgeAlpha: Float,
    minElementHeight: Float,
    maxElementHeight: Float,
    minTransitionArea: Float,
    maxTransitionArea: Float,
    scaleInterpolator: Easing,
    viewportVerticalOffsetResolver: (Constraints) -> Int
)

Scaling params are used to determine when items start to be scaled down and alpha applied, and how much.

Public properties

Float

Default Picker gradient ratio - the proportion of the Picker height allocated to each of the of the top and bottom gradients.

Public functions

flingBehavior

Added in 1.0.0-alpha25
@Composable
fun flingBehavior(
    state: PickerState,
    decay: DecayAnimationSpec<Float> = exponentialDecay()
): FlingBehavior

Create and remember a FlingBehavior that will represent natural fling curve with snap to central item as the fling decays.

Parameters
state: PickerState

the state of the Picker.

decay: DecayAnimationSpec<Float> = exponentialDecay()

the decay to use.

scalingParams

Added in 1.0.0-alpha25
fun scalingParams(
    edgeScale: Float = 0.45f,
    edgeAlpha: Float = 1.0f,
    minElementHeight: Float = 0.0f,
    maxElementHeight: Float = 0.0f,
    minTransitionArea: Float = 0.45f,
    maxTransitionArea: Float = 0.45f,
    scaleInterpolator: Easing = CubicBezierEasing(0.25f, 0.00f, 0.75f, 1.00f),
    viewportVerticalOffsetResolver: (Constraints) -> Int = { (it.maxHeight / 5f).toInt() }
): ScalingParams

Scaling params are used to determine when items start to be scaled down and alpha applied, and how much. For details, see ScalingParams.

Public properties

GradientRatio

Added in 1.0.0-alpha25
val GradientRatioFloat

Default Picker gradient ratio - the proportion of the Picker height allocated to each of the of the top and bottom gradients.