Comments (7)
That's a really cool example. I don't have any solutions for that yet, and would even want to have something in my app as well (although it's not a must for me).
I've also been working hard on the successor of magic-move, which is an all native solution. It provides a native primitive for doing shared element transitions. You could take a closer look at that.
https://github.com/IjzerenHein/react-native-shared-element
It doesn't support travel paths other than straight-lines yet though
from react-native-magic-move.
Thanks for the quick reply! I saw shared element on Twitter — looks really cool. I’m excited to try it out when expo v35 comes out. If I manage to get this animation working, I’ll be sure to drop an example here. I’m really impressed by magic move and can’t wait to use it on the native side.
from react-native-magic-move.
I think we can complete this example with animated
from react-native-magic-move.
@hungtrn75 Awesome! Do you have any thoughts on what it would look like to make it happen? I considered measuring the size/position of the input before clicking send, calculating the transform value from there to the messages destination and then animating. It's a bit tricky, though, especially with maintaining 60fps and issues like the user scrolling or closing the keyboard.
from react-native-magic-move.
Got it. I'd love to work on a collaborative example if you'd like. In the meantime, I'm relying on reanimated's Transition API. Not as smooth but still has a nice effect.
Here is a GIF of what it looks like in an example app with GiftedChat: https://giphy.com/gifs/JmJ3G6sn4twEscyOc5
// transition ref
const ref = useRef<TransitioningView>()
// track if component is already "mounted" so it only animates for new messages
const mounted = useRef(false)
// effect that runs whenever a new message comes in
useEffect(() => {
if (mounted.current) {
// only animate if you're updating the component; not on initial mount
ref.current.animateNextTransition()
} else if (messages.length) {
// mark the component as mounted when there are already messages
mounted.current = true
}
}, [messages])
return (
<Transitioning.View
transition={
<Transition.Sequence>
<Transition.Change interpolation="easeInOut" />
<Transition.In type="fade" />
</Transition.Sequence>
}
ref={ref}
style={{ flex: 1 }}
>
// ...FlatList that takes in the messages array
</Transitioning.View>
)
from react-native-magic-move.
@nandorojo it's nice effect.
from react-native-magic-move.
yep, I think the same way. We can make the animation with react-native-reanimated for much greater flexibility.
About some issues, I think:
- prevent the keyboard closing after sending a message
- scroll to end of list message before transforming
from react-native-magic-move.
Related Issues (20)
- multiple transitions are overlapping HOT 10
- Thread: Share your Magic Move transitions here
- Trying to resolve view with tag 327 which doesnt exist HOT 3
- Support for react-native-navigation? HOT 4
- Not working with React Navigation without enabling Remote Debug Debugging HOT 13
- Question: support for react-native-navigation? HOT 2
- pod install failed HOT 2
- RNMagicMove.podspec position HOT 2
- Simple example doesn't show transition HOT 4
- Request to add product in Start React HOT 1
- iOS build fails on RN 0.60.x with native dependencies HOT 2
- Support for hooks
- Can't run examples on expo SDK needs an update
- warning requireNativeComponent running on web
- Is this still alive or abandoned?
- Not work when item source is in FlatList HOT 1
- Same Nested Magic Item on Three Screen HOT 2
- Transition without a navigator HOT 1
- Transitions of <MagicMove.Text> inside another <Text> is not supported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-magic-move.