Reputation: 1496
I have some code that is using new Animation()
it has a method applyTransformation
that allows you to create a custom animation.
I've created a new Animator()
but can not figure where to put the custom animation.
How do I create a custom animation using Animator
?
Upvotes: 1
Views: 261
Reputation: 1851
Try something like this:
ValueAnimator anim = ValueAnimator.ofInt(0,100);
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
Integer value = (Integer) animation.getAnimatedValue();
Log.v(TAG, String.valueOf(value));
}
});
anim.setDuration(500);
anim.start();
Upvotes: 1