Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Value
    • AnimatedValue

Index

Constructors

constructor

  • new AnimatedValue(value: number, callback: Animated.ValueListenerCallback): AnimatedValue

Properties

callback

callback: Animated.ValueListenerCallback

Methods

addListener

  • addListener(callback: ValueListenerCallback): string
  • Adds an asynchronous listener to the value so you can observe updates from animations. This is useful because there is no way to synchronously read the value because it might be driven natively.

    Parameters

    • callback: ValueListenerCallback

    Returns string

extractOffset

  • extractOffset(): void
  • Sets the offset value to the base value, and resets the base value to zero. The final output of the value is unchanged.

    Returns void

flattenOffset

  • flattenOffset(): void
  • Merges the offset value into the base value and resets the offset to zero. The final output of the value is unchanged.

    Returns void

interpolate

  • interpolate(config: InterpolationConfigType): AnimatedInterpolation
  • Interpolates the value before updating the property, e.g. mapping 0-1 to 0-10.

    Parameters

    • config: InterpolationConfigType

    Returns AnimatedInterpolation

removeAllListeners

  • removeAllListeners(): void
  • Returns void

removeListener

  • removeListener(id: string): void
  • Parameters

    • id: string

    Returns void

reset

  • reset(value: number): void

setOffset

  • setOffset(offset: number): void
  • Sets an offset that is applied on top of whatever value is set, whether via setValue, an animation, or Animated.event. Useful for compensating things like the start of a pan gesture.

    Parameters

    • offset: number

    Returns void

setValue

  • setValue(value: number): void
  • Directly set the value. This will stop any animations running on the value and update all the bound properties.

    Parameters

    • value: number

    Returns void

stopAnimation

  • stopAnimation(callback?: undefined | function): void
  • Stops any running animation or tracking. callback is invoked with the final value after stopping the animation, which is useful for updating state to match the animation position with layout.

    Parameters

    • Optional callback: undefined | function

    Returns void