Animate Your View With Facebook Rebound
Sometimes we want to show some animation while a user interacts with our view. Like user giving like, love, comment, etc.

Rebound is a java library that models spring dynamics. Rebound spring models can be used to create animations that feel natural by introducing real-world physics to your application.
Let me show you the easiest way to implement this.
Implement the library on your app level Gradle file “build.gradle(Module: app).
implementation 'com.facebook.rebound:rebound:0.3.8'
I have to build a method which takes the view and show spring on that view.
public static void springView(final View view) {
SpringSystem mSpringSystem;
Spring mSpring;
double TENSION = 200;
double DAMPER = 15;
mSpringSystem = SpringSystem.create();
mSpring = mSpringSystem.createSpring();
SpringConfig config = new SpringConfig(TENSION, DAMPER);
mSpring.setSpringConfig(config);
mSpring.setCurrentValue(1);
mSpring.addListener(new SimpleSpringListener() {
@Override
public void onSpringUpdate(Spring spring) {
float value = (float) spring.getCurrentValue();
float scale = 1f - (value * 0.5f);
view.setScaleX(scale);
view.setScaleY(scale);
}
});
mSpring.setEndValue(-.1);
}
Increase or decrease TENSION and DAMPER value to control the spring animation. I found this value perfect for me.
Hope you build something exciting :) :)