Java Animations
What is this?
Animations is java util which can you help animate with some animation types.
What i can do with it?
You can use some default animations which contains util, like:
• NONE (Linear Animation);
• Quad In, Quad Out, Quad InOut (Both);
• Elastic In, Elastic Out, Elastic InOut (Both);
• Expo In, Expo Out, Expo InOut (Both);
• Back In, Back Out, Back InOut (Both);
• Bounce In, Bounce Out, Bounce InOut (Both);
• Quart In, Quart Out, Quart InOut (Both);
• Circ In, Circ Out, Circ InOut (Both);
• Quint In, Quint Out, Quint InOut (Both);
• Cubic In, Cubic Out, Cubic InOut (Both);
• Sine In, Sine Out, Sine InOut (Both);
https://easings.net/
Also you can add your animation types with math, but mainly it have all animations fromHow to use it?
To start using you need import this repo as library or just download it and move to your src folder.
Gradle Import (Probably now doesn't works)
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.xHogoshi:Animations:SNAPSHOT'
}
Maven Import (Probably now doesn't works)
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.xHogoshi</groupId>
<artifactId>Animations</artifactId>
<version>SNAPSHOT</version>
</dependency>
Next you need initialize animation as variable.
Example:
Animation yourAnimation = new Animation();
After that you need update animation in your render method. ( If you can't or don't need easings, just instead Animation use DAnimation and you don't need any update methods )
Example:
yourAnimation.update();
Next you need animate this animation with duration in millis. ( This method only gives animation target, not updating it!! )
Example:
yourAnimation.animate(value, duration, easing);
// For Example real use
yourAnimation.animate(100, 1500, Easing.BACK_BOTH); // It will animate animation to 100 value and animating 1500 millis or 1,5 second with Back Both easing. All easings: https://easings.net/
All ready!!! Now only little things.
How to get value from animation?
yourAnimation.getValue()
How to set Value without animation?
yourAnimation.setValue(value);
How to check if animation is animating or done?
yourAnimation.isDone() // Checks if animation is done
yourAnimation.isAlive() // Checks if animation is alive