Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Move queueAnimation to component #74

Closed
grabbou opened this issue Jul 17, 2015 · 8 comments
Closed

Move queueAnimation to component #74

grabbou opened this issue Jul 17, 2015 · 8 comments

Comments

@grabbou
Copy link
Collaborator

grabbou commented Jul 17, 2015

So it's overridable and we can easily ignore animationKind and provide own LayoutAnimations. Just an idea, as I am not that happy with the current one and I am investigating changing the LayoutAnimations to something different at all.

@Kureev
Copy link
Owner

Kureev commented Jul 19, 2015

I'd like to implement react-motion for that. Just waiting it to be a bit more stable and tested.

@grabbou
Copy link
Collaborator Author

grabbou commented Jul 20, 2015

Hm, what about Animated?

@Kureev
Copy link
Owner

Kureev commented Jul 20, 2015

@grabbou Animated? If you're talking about AnimatedExperimental, then you should check it out facebook/react-native#796

@grabbou
Copy link
Collaborator Author

grabbou commented Jul 20, 2015

No, I am talking about Animated - https://facebook.github.io/react-native/docs/animations.html#animated they presented that library during ReactEurope and looks like a quite powerful tool to do native animations (it looks a lot like CoreAnimations in terms of how you group different bits, but haven't dig into the details yet) 💃

@Kureev
Copy link
Owner

Kureev commented Jul 21, 2015

Now I'm already using it and you can pass animation prop to component. Am I missing something? What's the idea you want me to implement? Something like support queues?

@grabbou
Copy link
Collaborator Author

grabbou commented Jul 21, 2015

Nah you are using LayoutAnimation, just saying Animated is worth investigating as a good alternative to react-motion (esp. given the fact Animated might be more performant as I am pretty sure they have some really good bindings for that)

@Kureev
Copy link
Owner

Kureev commented Jul 21, 2015

That's true. So, you want to animate opening/closing of the side menu. What is your propose for API? something like

const queue = [
  Animated.decay(position, {   // coast to a stop
    velocity: {x: gestureState.vx, y: gestureState.vy}, // velocity from gesture release
    deceleration: 0.997,
  }),
  Animated.parallel([          // after decay, in parallel:
    Animated.spring(position, {
      toValue: {x: 0, y: 0}    // return to start
    }),
    Animated.timing(twirl, {   // and twirl
      toValue: 360,
    }),
  ]),
];
// ...
<SideMenu animationQueue={queue}/>

right?
And in the background it may be used like this:

updatePosition() {
  // this.sideMenu.setNativeProps({ left: this.left, });
  Animated.queue(this.prop.animationQueue).start();
}

where this.state.left = Animated.Value(0);?

@Kureev
Copy link
Owner

Kureev commented Aug 30, 2015

Should be solved in 0.12.1

@Kureev Kureev closed this as completed Aug 30, 2015
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants