How to use the react-native-redash.timing function in react-native-redash

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

github wcandillon / can-it-be-done-in-react-native / the-5-min / src / components / TapHandler.tsx View on Github external
and(eq(shouldSpring, 1), neq(value, 1)),
        set(
          value,
          timing({
            from: value,
            to: 1,
            easing,
            duration
          })
        )
      ),
      cond(
        and(eq(shouldSpring, 0), neq(value, 0)),
        set(
          value,
          timing({
            from: value,
            to: 0,
            easing,
            duration
          })
        )
      )
    ]),
    []
  );
  return (
    <TapGestureHandler {...gestureHandler}>
      <Animated.View>{children}</Animated.View>
    </TapGestureHandler>
  );
};
github rainbow-me / rainbow / src / components / value-chart / TimespanSelector.js View on Github external
<ValueTime selected={this.state.currentInterval === interval.MONTH}>
              1M
            </ValueTime>
          </ButtonPressAnimation>
          <ButtonPressAnimation onPress={this.reloadChartToYear}>
            <ValueTime selected={this.state.currentInterval === interval.YEAR}>
              1Y
            </ValueTime>
          </ButtonPressAnimation>
        </View>
        <Animated.Code
          exec={cond(
            neq(this.positionX, this.translateX),
            set(
              this.translateX,
              timing({
                clock: this.clock,
                duration: 150,
                easing: Easing.bezier(0.25, 0.46, 0.45, 0.94),
                from: this.translateX,
                to: this.positionX,
              })
            )
          )}
        />
      </>
    );
  }
}
github rainbow-me / rainbow / src / components / value-chart / ValueChart.js View on Github external
clock: this.clock,
                    duration: 350,
                    easing: Easing.bezier(0.25, 0.46, 0.45, 0.94),
                    from: this.value,
                    to: 0,
                  })
                ),
              ])
            ),
            cond(
              and(lessThan(this.value, 1), eq(this.shouldSpring, 0)),
              block([
                stopClock(this.clock),
                set(
                  this.value,
                  timing({
                    clock: this.clockReversed,
                    duration: 350,
                    easing: Easing.bezier(0.25, 0.46, 0.45, 0.94),
                    from: this.value,
                    to: 1,
                  })
                ),
              ])
            ),
            cond(
              and(lessThan(this.opacity, 1), eq(this.shouldSpring, 1)),
              block([
                set(
                  this.opacity,
                  timing({
                    clock: this.opacityClock,