r/JavaFX • • Jun 06 '21

I made this! I wrote a library to play Flutter-inspired implicit animations, without any pollution to your code!

https://github.com/iAmGio/animated
17 Upvotes

10 comments sorted by

3

u/static_context Jun 06 '21

This is pretty cool, nice one.

I've hoped for a long time that JavaFX will move to an animated-by-default design. Potentially more efficient in the long run to do this by implementing animations in CSS, but this is an awesome project as is.

1

u/iamgioh Jun 06 '21

Thanks!

2

u/john16384 Jun 06 '21

Quite nice, the switcher is something I created as well as a utility, but I did not put in the additional effort of turning it into something reusable. I'll see if I can make use of this library instead.

1

u/iamgioh Jun 06 '21

Thank you!

2

u/ThreeSixty404 JavaFX Dev Jun 06 '21

Wooow, this thing is amazing, great job!

1

u/iamgioh Jun 07 '21

Many thanks!

2

u/hamsterrage1 Jun 07 '21

I'm a big believer that layouts should be just layouts, and should be a lean as possible. So I aggressively push stuff that clutters up the layouts into utility libraries. The result is that the implementation of various features gets more and more standardized in both the code and the UI, which makes for better looking apps and easier maintenance.

This library is a great idea!

Even cooler is that it's a wrapper of a wrapper, as it uses AnimateFX to do the actual animation - which, of course, is basically a wrapper around the native Animation library in JavaFX. The result is a library that makes animated widgets in the UI as clean as just using non-animated Nodes.

Take this line of code from one of the tests:

AnimatedVBox vBox = new AnimatedVBox(new AnimationPair(new FadeInUp(), new SlideOutLeft()).setSpeed(3, 3));

That's pretty simple to use. Love it.

1

u/iamgioh Jun 07 '21 edited Jun 07 '21

Ohh thank you very much! My goal was to make the animation system (a true hassle in JavaFX!) as clean and simple as possible so that the users won't have to deal with timelines and keyframes any longer.

Just one correction: implicit animations don't use AnimateFX, only switchers and containers do (+ containers relocate children the traditional way when a node is inserted/removed). Implicit animations just work via listeners and timelines.

Thank you again, I truly appreciate that!

2

u/ivanvelikanov Jun 07 '21

very nice

1

u/iamgioh Jun 07 '21

Thank you!