Using Data Binding to make animations even more dynamic
The problem
This is something that me and one of my client have struggled with in the past, but using data binding seems to be the solution!
So the issue we were facing, was that during onboarding, we had the mascot flying in, followed by a text box.
The issue we faced though, was that we wanted to re-use the mascot animation, both throughout the onboarding, but also other places in the app.
But the amount of text and thereby the size of the text box, isn’t always the same size. So adjusting the end position of the mascot on the screen was a bit of a headache.
The Solution
Instead of animating the Y position of the mascot, I created a path from the bottom and to the top of the screen and had the mascot follow that path.
So I would animate the mascot on from 0-100% instead of the Y position
And then I created number input in the data binding and connected it to the Y position of the end point of the path.
This way, it’s a lot easier to work with and makes everyone’s life a lot easier!
One animation, but super flexible.
This is the end result: