1. Starting

There u will see how to use animations

Initializing

Firstly, you need to initialize your animation

Example

public final Animation animation = new Animation();

Animation#animate()

After initializing, you need to call animate method, it will animate value to your

Example

animation.animate(valueTo, duration, easing, safe);

What does means safe?

safe means that animation will not animate if animation's target value == valueTo in Animation#animate()

Animation#isAlive()

Returns true if animation is animating

Animation#isDone()

Returns true if animation is not animating

What does means easing?

Easing functions specify the rate of change of a parameter over time.

Objects in real life don’t just start and stop instantly, and almost never move at a constant speed. When we open a drawer, we first move it quickly, and slow it down as it comes out. Drop something on the floor, and it will first accelerate downwards, and then bounce back up after hitting the floor.

Example

Easings.BACK_BOTH

Important Thing

Because you dont updating animation, after .animate() you need to update animation calling Animation#update()

Example

animation.update();

Done!

Last updated