Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced ability to declare a custom interpolator #68

Closed

Conversation

julienvincent
Copy link

This PR introduces the ability to use custom interpolation with Animatedjs. See #67 for more information.

@souporserious
Copy link

Any status on this? I want to rewrite my slider library using Animated, but I think I need this functionality so I don't regress on features 😕

@browniefed
Copy link
Member

There was originally push back on this in the beginning, although I forget why. Possibly because with animated moving native there is no ability for this to ship to the native world.

@souporserious
Copy link

souporserious commented Jun 21, 2017

Appreciate the quick response. Interesting... I'm a little confused on this library. Is this still the Native stuff as well or is that a completely separate repo now?

Is there any way to do interpolation now until this PR could be considered? Watched the talk on this and was completely sold so I'd love to start using it in all my animation projects.

Edit

Sorry, looked around and noticed it's merged into React Native. But then I saw this AnimatedWeb file while poking around so I'm even more confused 😞 can you shed any light? I'm just not sure what to use haha.

@julienvincent
Copy link
Author

@souporserious

Is this still the Native stuff as well or is that a completely separate repo now?

This library supports both React Native and React as far as I understand

Is there any way to do interpolation now until this PR could be considered?

Animated does support interpolation out of the box - this PR is just a different approach to doing interpolation. Check out the docs for how to do interpolation now

@julienvincent
Copy link
Author

@browniefed

Possibly because with animated moving native there is no ability for this to ship to the native world

This can't be right - as far as I understand all animation, even those given to the native thread via useNativeDriver: true, are still calculated in the JS realm. Although maybe I am missing something.

@browniefed
Copy link
Member

@souporserious This was ripped out of React Native and can technically evolve separate of RN but would like it to match as much as possible.

I had a PR where I brought all the latest RN stuff and merged it back into here but still needs work to split stuff out to separate files.

@julienvincent With the useNativeDriver the animations are controlled in the native world hence why they aren't allow supported yet. Here is the Android directory https://github.com/facebook/react-native/tree/8e81644f64b96ab4726ce37a6a328acbe4a32783/ReactAndroid/src/main/java/com/facebook/react/animated

and here is the SpringAnimation if you want to look at it https://github.com/facebook/react-native/blob/8e81644f64b96ab4726ce37a6a328acbe4a32783/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java

@browniefed
Copy link
Member

@vjeux is busy but if he gives the blessing then I'm happy to merge this.

@vjeux
Copy link
Collaborator

vjeux commented Jun 21, 2017

It's not very intuitive but you can pass a function to easing to achieve the same result. Would that solve your usecase?

@julienvincent
Copy link
Author

julienvincent commented Jun 23, 2017

@browniefed Ah I see - I was sure it was still calculated by js. If it is happening in to native world then this will probably not be viable, unless people are happy with the JS API differing from the native one, which is probably not a good idea.

@vjeux I'll need to give that a try - how does that work with relation to native? Are timing animations with Easing not calculated in the native realm?

@vjeux
Copy link
Collaborator

vjeux commented Jun 24, 2017

If you have custom js functions, you can't use the native driver unfortunately

@vjeux
Copy link
Collaborator

vjeux commented Jun 24, 2017

fwiw, I'm not opposed to this PR.

@julienvincent
Copy link
Author

@vjeux

fwiw, I'm not opposed to this PR.

Even if it means differing web api to native?

@julienvincent julienvincent deleted the add-custom-interpolator branch November 20, 2023 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants