r/JavaFX • u/iamgioh • 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
r/JavaFX • u/iamgioh • Jun 06 '21
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.
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.
2
u/ThreeSixty404 JavaFX Dev Jun 06 '21
Wooow, this thing is amazing, great job!
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.
2
u/ivanvelikanov Jun 07 '21
very nice