PickerDefaults


object PickerDefaults


Contains the default values used by Picker

Summary

Public functions

ScalingParams
defaultScalingParams(
    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.

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
)

This function is deprecated. This overload is provided for backwards compatibility with Compose for Wear OS 1.1 and was deprecated.

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

defaultScalingParams

Added in 1.2.0
fun defaultScalingParams(
    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

flingBehavior

Added in 1.0.0
@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
Deprecated in 1.2.0
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

DefaultGradientRatio

Added in 1.0.0
val DefaultGradientRatioFloat

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