Skip to content

Animated widget

payne911 edited this page Oct 4, 2019 · 11 revisions

A very basic "folding/unfolding" animation has been integrated. It was introduced via new classes because it wraps new functionalities around the non-animated implementations.

As it is, it is probable that future versions will change the way they are implemented, hence them being marked as @Deprecated. They have been released this early in the production process just so that people have easy access to a working-out-of-the-box functionality.

Animating your menus

Any RadialGroup or PieMenu can be quickly changed into its Animated version: just change the declaration line such as PieMenu myMenu = new PieMenu(...); to AnimatedPieMenu myMenu = new AnimatedPieMenu(...);.

You can then call methods such as transitionToOpening(float) or animateOpening(float) to obtain an unfolding animation. The same goes for transitionToClosing(float) and animateClosing(float). The input float is the amount of seconds the animation should take to finish.

The toggleVisibility(float) method is also there to automatically transition from an opening to a closing animation and vice-versa.

Warning

setVisible() becomes a bit less intuitive with the current implementation. Because the animation classes use an internal value to keep track of how much of the total amount of degrees should be displayed, it is possible that if you call setVisible(true) you will not see the widget because its internal currentAngle variable's value will be 0.

You can easily get around that through calling myMenu.setCurrentAngle(myMenu.getStyle().totalDegreesDrawn);.