How to use the react-native-reanimated.Easing.inOut function in react-native-reanimated

To help you get started, we’ve selected a few react-native-reanimated 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 keybase / client / shared / common-adapters / loading-line.native.tsx View on Github external
function runLoop() {
  const clock = new R.Clock()

  const state = {
    finished: new R.Value(0),
    frameTime: new R.Value(0),
    position: new R.Value(-1),
    time: new R.Value(0),
  }

  const config = {
    duration: new R.Value(600 * 2),
    easing: ReAnimatedEasing.inOut(ReAnimatedEasing.ease),
    toValue: new R.Value(1),
  }

  return R.block([
    R.startClock(clock),
    R.timing(clock, state, config),
    R.cond(state.finished, [
      R.stopClock(clock),
      // reset state
      R.set(state.finished, 0),
      R.set(state.frameTime, 0),
      R.set(state.position, -1),
      R.set(state.time, 0),

      // start clock again
      R.startClock(clock),
github terrysahaidak / react-native-retween / src / animations / runTiming.ts View on Github external
export const runTiming = (
  { clock, oppositeClock, value, dest, onFinish }: IAnimationConfig,
  props: TimingTweenAnimation,
) => {
  const state = {
    finished: new A.Value(0),
    position: new A.Value(0),
    time: new A.Value(0),
    frameTime: new A.Value(0),
  };

  const config = {
    duration: props.timing.duration,
    toValue: new A.Value(0),
    easing: props.timing.easing || Easing.inOut(Easing.ease),
  };

  return A.block([
    // stops opposite (opposite direction) clock
    A.cond(
      A.clockRunning(oppositeClock),
      A.stopClock(oppositeClock),
      0,
    ),
    A.cond(A.clockRunning(clock), 0, [
      updateStateProc(
        value,
        dest,
        state.finished,
        state.position,
        state.time,
github barmej / react-native-youtube-player / src / mobile / ProgressBar.tsx View on Github external
const Progress = ({ progress }: { progress: number }) => {
  const ref = useRef(new Animated.Value(0));
  Animated.timing(ref.current, {
    toValue: progress,
    duration: 250,
    easing: Easing.inOut(Easing.ease)
  }).start();

  return (
    
  );
};
github dsznajder / ReactNativeTemplate / src / helpers / animationConfigs.js View on Github external
export const timingAnimationConfig = (
  duration: number,
  toValue: number,
): TimingAnimationConfig => ({
  duration,
  toValue,
  easing: Easing.inOut(Easing.ease),
})
github wcandillon / can-it-be-done-in-react-native / season2 / safari-tabs / components / Tabs.tsx View on Github external
} from "react-native-reanimated";
import { PanGestureHandler, State } from "react-native-gesture-handler";
import {
  decay,
  limit,
  bInterpolate,
  useTransition,
  gestureEvent
} from "react-native-redash";

import Tab, { ITab, OVERVIEW } from "./Tab";

const { height } = Dimensions.get("window");
const { Value, eq, neq } = Animated;
const durationMs = 400;
const easing = Easing.inOut(Easing.ease);
const transition = (
  
);

export type ITabs = ITab[];

interface TabsProps {
  tabs: ITabs;
}

export default ({ tabs: tabsProps }: TabsProps) => {
  const ref = useRef();
  const [tabs, setTabs] = useState([...tabsProps]);
  const [selectedTab, setSelectedTab] = useState(OVERVIEW);
  const transitionVal = useTransition(
    selectedTab,
github punksta / Cat-or-dog / src / containers / DraggingFallingReanimated.js View on Github external
const dragging = new Value(0);
	const start = new Value(0);
	const position = new Value(0);
	const clock = new Clock();

	const state = {
		finished: new Value(0),
		position: position,
		time: new Value(0),
		frameTime: new Value(0)
	};

	const config = {
		duration: new Value(duration),
		toValue: new Value(-1),
		easing: Easing.inOut(Easing.ease)
	};

	const isNotDragging = and(
		neq(gestureState, State.ACTIVE),
		neq(gestureState, State.BEGAN)
	);

	const isDragging = or(
		eq(gestureState, State.ACTIVE),
		eq(gestureState, State.BEGAN)
	);

	const delayed = new Value(0);

	const translation = translateAnimation(gestureTranslation, gestureState);
github elyalvarado / react-navigation-switch-transitioner / src / views / FadeTransition.js View on Github external
new Promise(resolve => {
        timing(transition.progress, {
          toValue: 1,
          duration: 1000,
          easing: Easing.inOut(Easing.cubic),
        }).start(resolve)
      }),
  }