How to use the rax-animated.spring function in rax-animated

To help you get started, we’ve selected a few rax-animated examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / rax / examples / animated / src / index.js View on Github external
componentDidMount() {
    this.state.bounceValue.setValue(1.5);
    Animated.spring(
      this.state.bounceValue,
      {
        toValue: 0.8,
        friction: 1,
      }
    ).start();

    this.state.rotateValue.setValue(125);

    Animated.spring(
      this.state.rotateValue,
      {
        toValue: 0,
        friction: 1,
      }
    ).start();
github alibaba / rax / components / rax-navigation / src / views / CardStackPanResponder.js View on Github external
_reset(velocity: number): void {
    const props = this._props;
    Animated.spring(
      props.position,
      {
        toValue: props.navigationState.index,
        duration: ANIMATION_DURATION,
        useNativeDriver: props.position.__isNative,
        velocity: velocity * GESTURE_ANIMATED_VELOCITY_RATIO,
        bounciness: 0,
      }
    ).start();
  }
github alibaba / rax / examples / drag / src / index.js View on Github external
_handlePanResponderGrant = (e, gestureState) => {
    this.state.pan.setOffset({x: this.state.pan.x._value, y: this.state.pan.y._value});
    this.state.pan.setValue({x: 0, y: 0});
    Animated.spring(
      this.state.scale,
      { toValue: 1.1, friction: 3 }
    ).start();
  };
github alibaba / rax / components / rax-navigation / src / views / CardStackPanResponder.js View on Github external
_goBack(velocity: number) {
    const props = this._props;
    if (!props.onNavigateBack) {
      return;
    }
    Animated.spring(
      props.position,
      {
        toValue: Math.max(props.navigationState.index - 1, 0),
        duration: ANIMATION_DURATION,
        useNativeDriver: props.position.__isNative,
        velocity: velocity * GESTURE_ANIMATED_VELOCITY_RATIO,
        bounciness: 0,
      }
    ).start(props.onNavigateBack);
  }
github alibaba / rax / examples / animated / src / index.js View on Github external
componentDidMount() {
    this.state.bounceValue.setValue(1.5);
    Animated.spring(
      this.state.bounceValue,
      {
        toValue: 0.8,
        friction: 1,
      }
    ).start();

    this.state.rotateValue.setValue(125);

    Animated.spring(
      this.state.rotateValue,
      {
        toValue: 0,
        friction: 1,
      }
    ).start();
  }
}

rax-animated

Declarative Animations Library for Rax.

BSD-3-Clause
Latest version published 6 years ago

Package Health Score

60 / 100
Full package analysis

Similar packages