This is easing animation helper class for real time animation.
Android sensor's value (such as mic, accelerometers or gyroscope) is too dynamic to show real time animation.
Values change too quickly so we need make it smoothly.
add you app dependency
compile 'com.altamirasoft.easingmaster:easing-master:1.0.15'
EasingHelper helper = new EasingHelper().setEasing(0.1f);
helper.addUpdateListener(new EasingUpdateListener() {
@Override
public void onUpdateCurrentValue(float value) {
//make ui update
object.setTranslationX(value);
}
@Override
public void onFinishUpdateValue(float value) {
}
});
helper.start();
//set target value
helper.setTargetValue(300);