How to use the @shoutem/animation.getAnimatedStyleValue function in @shoutem/animation

To help you get started, we’ve selected a few @shoutem/animation 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 shoutem / ui / navigation / NavigationBarView.js View on Github external
interpolateNavBarStyle() {
    const { position, scene, scenes } = this.props;
    const { index } = scene;

    const positionValue = getAnimatedStyleValue(position);
    if (positionValue === index) {
      // We are not in a transition, do not override the
      // default style to allow any custom animations that
      // the screen may want to perform on the NavigationBar
      return {};
    } else if (this.props.inline) {
      // The navigation bar is rendered inline with the screen,
      // it will be animated together with the screen, so there
      // is no need for custom animations in this case.
      return {};
    }

    // resolveSceneProps will return the latest version of the props
    // from the parent component. This is necessary to perform the
    // animations to the final state of the navigation bar. Otherwise
    // we are often getting various delays and flickers during transitions.
github shoutem / extensions / shoutem.navigation / app / components / ui / NavigationBarView.js View on Github external
interpolateNavBarStyle() {
    const { position, scene, scenes } = this.props;
    const { index } = scene;

    const positionValue = getAnimatedStyleValue(position);
    if (positionValue === index) {
      // We are not in a transition, do not override the
      // default style to allow any custom animations that
      // the screen may want to perform on the NavigationBar
      return {};
    } else if (this.props.inline) {
      // The navigation bar is rendered inline with the screen,
      // it will be animated together with the screen, so there
      // is no need for custom animations in this case.
      return {};
    }

    // resolveSceneProps will return the latest version of the props
    // from the parent component. This is necessary to perform the
    // animations to the final state of the navigation bar. Otherwise
    // we are often getting various delays and flickers during transitions.
github shoutem / ui / navigation / NavigationBarView.js View on Github external
resolveStatusBarStyle(color, animated) {
    const colorValue = getAnimatedStyleValue(color);
    const barStyle = tinyColor(colorValue).isDark() ? 'light-content' : 'dark-content';

    StatusBar.setBarStyle(barStyle, animated);
  }
github shoutem / extensions / shoutem.navigation / app / components / ui / NavigationBarView.js View on Github external
getColor(colorName, props) {
    const color = _.get(props, `style.container.${colorName}`, 'white');
    return getAnimatedStyleValue(color);
  }
github shoutem / ui / navigation / NavigationBarView.js View on Github external
getColor(colorName, props) {
    const color = _.get(props, `style.container.${colorName}`, 'white');
    return getAnimatedStyleValue(color);
  }
github shoutem / extensions / shoutem.navigation / app / components / ui / NavigationBarView.js View on Github external
resolveStatusBarStyle(color, animated) {
    const colorValue = getAnimatedStyleValue(color);
    const barStyle = tinyColor(colorValue).isDark() ? 'dark-content' : 'light-content';

    StatusBar.setBarStyle(barStyle, animated);
  }